文章目录
python socket 扫描 漏洞
代码语言:javascript
复制import socket
def retBanner(ip,port):
try:
socket.setdefaulttimeout(2)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect((ip,port))
banner = s.recv(1024)
return banner
except:
print("Failer")
return
def checkBanner(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('[ ] 3Com 3CDaemon FTP server is vulnerable.')
elif 'Ability Server 2.34' in banner:
print('[ ] Ability FTP Server is vulnerable.')
else:
print('Ftp server is not vulnerable.')
def main():
portLis