python socket 扫描(仅供学习)

2021-01-14 11:10:25 浏览数 (1)

文章目录

  • python socket 扫描 漏洞

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

0 人点赞