The fisr scan script coded by python

来源:互联网 发布:驱动保护编程 编辑:程序博客网 时间:2024/04/30 14:53

第一个SCAN程序,菜鸟级别的入门,写在此,也算是种学习纪念。

#scan.pyimport socket ports = [80,8080]hosts = ['www.freebuf.com','www.baidu.com','www.sina.com']for host in hosts:    for port in ports:        try:            s = socket.socket()            print "[+]Attempting to connect to " + host + ":" + str(port)            s.connect((host,port))            s.send('agsdfd \n')            banner = s.recv(1024)            if banner:                print "[+]" + host + ":" + str(port) + " open \n" + "[+]The banner infomations are below: \n" + banner            s.close()        except: pass    
0 0
原创粉丝点击