【发布时间】:2016-12-17 02:39:14
【问题描述】:
发布数据
POSTDATA =-----------------------------204994970613471446171879029128
Content-Disposition: form-data; name="f"; filename="shell.php"
Content-Type: application/x-php
<?php
echo("oi");
?>
-----------------------------204994970613471446171879029128
Content-Disposition: form-data; name="v"
up
-----------------------------204994970613471446171879029128--
表格
<form method=post enctype=multipart/form-data><input type=file name=f><input name=v type=submit id=v value=up>
Python
import requests
try:
files = {"f": open("page.php", "rb"),"v":"up"}
r = requests.post("http://soportetecnico.nixiweb.com/up.php", files=files, headers={"Content-type": "application/x-php"})
print r.text
except Exception as e:
print e
我需要发送一个 PHP 文件以使用 python 上传吗? 我不知道我做错了什么。 提前感谢您的帮助=]
【问题讨论】:
标签: php python-2.7 python-3.x request python-requests