阅读:10849回复:2
求大神帮解答
import socket
def retBanner(ip,port): try: socket.setdefaulttimeout(2) s = socket.socket() s.connect((ip.port)) benner = s,recv(1024) return banner except: return def checkVulns(banner): if 'FreeFloat Ftp server(version 1.00)' in banner: print '[+] FreeFloat Ftp server is vulnerable.' elif '3Com 3CDaemon Ftp server version 2.0' in banner: print '[+] 3CDaemon Ftp server is vulnerable.' elif '[+] Ability server 2.34' in banner: print '[+] Ability Ftp serveris vulnerable.' elif 'Sami Ftp server 2.0.2' in banner: print '[+] Sami Ftp server is vulnerable.' else: print '[-] Ftp Server is not vulnerable.' return def main(): portList = [21,22,25,80,110,3389] for x in range(1,255): ip = '192.168.1.' + str(x) for port in portList: banner = retBanner(ip,port) if banner: print '[+] ' + ip +': '+ banner checkVulns(banner) if __name__ == '__main__': main() 为什么不能输出东西呢 |
|
沙发#
发布于:2016-11-21 12:20
兄弟,你发错地方了吧,Python在另外一个版块吧,版块我移动下~
|
|
板凳#
发布于:2016-11-21 13:58
端口没开放嘛
你加个else print 把扫描到的不开放的IP也显示 |
|