Windows data exfiltrator notes
1. Simple file transfer
Great post about Windows file transfers for hackers.
1.1. SMB (two ways)
Using local SMB server (running on the attacker's OS) an attacker is able transfer files in both ways:
1.2. Evil-WinRM (two ways)
1.3. HTTP (attacker -> victim)
Attacker:
Victim:
There's a method to download a PS script and run it without touching the disk (directly from memory). It's used to avoid antiviruses and so on. It can be used to get a reverse-shell connection (reverse shell Powershell script).
2. TCP socket
This kind of exfiltration is not recommended in a well-secured environments. Non-standard TCP protocol can be detected easily.
Listener (attacker):
Sender (victim):
3. SSH protocol
SSH establishes a secure channel because all transmitted data is encrypted. It's not possible to sniff the unencrypted content.
Sender (victim):
4. HTTP(S) protocol
Exfiltration data through the HTTP protocol is one of the best options because it is hard to distinguish between legitimate and malicious HTTP traffic. Additionally, a POST request data is not stored in log files, cache or any other history.
5. ICMP
ICMP packet has optional data
field where the sensitive data can be stored and transmitted.
Listener (attacker): Metasploit
framework has built-in module to capture malicious ICMP sequence.
Sender (victim): we can use the nping
tool which part of the Nmap package. The ICMP data sequence for the Nmap listener is initialized sending the BOF<filename>
string.
6. DNS
DNS is not a transport protocol and it's basis of the entire internet so it's not usually monitored. Fully Qualified Domain Name (FQDN) can be at most 255 characters long (including .
separators). The subdomain part must not exceed 63 characters. The trick is to transfer data using the subdomain part to the controlled (malicious) DNS server.
On the malicious DNS server capture any incoming UDP/53 packet: