iis6-0 cve-2017-7269 批量验证脚本

代码地址

import subprocess

f = open('ips.txt', 'r')
flines = f.readlines()

vulnsrvs = 0
i = 1

for line in flines:

    host = line.split(":")

    ip = host[0].replace('\n','')
    port = host[1].replace('\n','')

    print "Try (" + str(i) +") "+ str(ip) +":" + str(port)

    if port == "443":
        #dont bother with SSL/TLS
        continue
    try:
        myout =  subprocess.check_output(['curl', '--connect-timeout', '2', '--max-time', '2', '-s','-I', '-X', 'PROPFIND','http://' + ip  + ':' + port + '/' ])
        print myout
        if "HTTP/1.1 411 Length Required" in myout:
            print "Found one:"
            print myout
            vulnsrvs += 1
    except Exception, e:
        print str(e.output)
    i += 1
    print "Vulnerable: " + str(vulnsrvs)

说明

ips.txt 是待验证的列表格式为:

129.112.44.1:80
129.112.44.2:81
129.112.44.43:8808

它不检测443端口(HTTPS)
你也可以简单改一下进行网段批量验证。

转自群友CF_HB

转载于:https://www.cnblogs.com/Akkuman/p/6963121.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值