大师兄全网扫描扫描10000端口后的优化脚本
2015-12-15 22:48
369 查看
方法一: #coding=utf-8
import urllib2
import threading
from time import ctime,sleep
print "Start-Time : %s" %ctime()
f = open("ip.txt","r")
lines = f.readlines()
for line in lines:
url = 'http://'+line.strip('\n')+':10000'
try:
r = urllib2.urlopen(url,timeout=1)
if r.getcode() == 200:
print url
infile = open("infiles.txt","a")
infile.write(url+'\n')
infile.close()
except Exception as e :
print e
f.close()
print "Stop--Time : %s" %ctime()
方法二:
#coding=utf-8
#port scan
import os
import subprocess
ip = open('ip.txt')
data = ip.readlines()
for line in data:
line = line.strip()
cmd = '/root/Desktop/tools/masscan/bin/masscan -p10000 %s' %line
for i in os.popen(cmd):
f = open("abc.txt","a")
f.write(i)
f.close()
ip.close()
import urllib2
import threading
from time import ctime,sleep
print "Start-Time : %s" %ctime()
f = open("ip.txt","r")
lines = f.readlines()
for line in lines:
url = 'http://'+line.strip('\n')+':10000'
try:
r = urllib2.urlopen(url,timeout=1)
if r.getcode() == 200:
print url
infile = open("infiles.txt","a")
infile.write(url+'\n')
infile.close()
except Exception as e :
print e
f.close()
print "Stop--Time : %s" %ctime()
方法二:
#coding=utf-8
#port scan
import os
import subprocess
ip = open('ip.txt')
data = ip.readlines()
for line in data:
line = line.strip()
cmd = '/root/Desktop/tools/masscan/bin/masscan -p10000 %s' %line
for i in os.popen(cmd):
f = open("abc.txt","a")
f.write(i)
f.close()
ip.close()
相关文章推荐
- 【随笔】Linux & Shell & Minecraft
- JAVASCRIPT中经典面试题
- Android 应用程序无响应(ANR)报错原因
- git revert 和 git reset
- IO流--粘贴复制
- HDU 1159 最长公共子串
- C++拷贝构造函数和移动构造函数
- 用IDEA启动非maven管理的web项目
- Android 源码解析: 图片加载库Picasso 3 核心类
- 正则表达式
- Ajax技术POST交互实现二级联动菜单
- 彻底弄懂最短路径问题
- 图片放大缩小
- 安装10gR2的硬件要求
- 山东大学使用QLSC_STU避免掉线的方法java版实现
- Tempter of the Bone
- Head First HTML&CSS 笔记(2)-定位与布局
- Unity3D-向量运算-加减点乘叉乘
- Struts2 文件上传
- Spring.net-业务层仓储