您的位置:首页 > 编程语言 > Python开发

The fisr scan script coded by python

2015-11-20 16:39 489 查看
第一个SCAN程序,菜鸟级别的入门,写在此,也算是种学习纪念。

#scan.py

import 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: