渗透进内网后的一些信息收集脚本
前段时间路过了一个小站,发现内部结果及其复杂。所以自己写了个小脚本来帮助信息收集。由于跳板主机是linux,所以使用python和shell脚本异常方便了。
首先ping存活主机,并将主机结果导入文件中,然后使用端口扫描脚本读取该文件,并进行端口扫描。
1、扫描存活主机脚本
使用方法 ./xxx.sh 192.168.10 > IP
is_alive_ping()
{
ping -c 1 $1 > /dev/null
[ $? -eq 0 ] && echo $i
}
read -p "IP[1.2.3]" IP
for i in $IP.{1..254}
do
is_alive_ping $i & disown
done
使用方法是直接运行该python程序, 比如保存为test.py ,直接运行 python test.py ,不过前提是你需要有IP文件,即就是第一步中你用shell脚本生成的IP列表
import threading,os,time
def ncDetect(IP):
command = "nc -v -z " + IP +" 21-9000 2>&1| grep succeed"
f = os.system(command)
IPHandle = open("IP","r")
test = IPHandle.readline()
test = test.strip('\n')
while test:
for i in range(5):
t = threading.Thread(target=ncDetect,args=(test,))
t.start()
test = IPHandle.readline()
test = test.strip('\n')
time.sleep(5)
test = IPHandle.readline()
test = test.strip('\n')
exit(0)
评论69次
估计里面交换机和路由器多
什么漏洞?
收藏下~~~...
什么漏洞????
恩。(具体漏洞已经报给他们,且已经修复了
@alibaba ---------------------------------------- 话说这工具还真是不错,自己写的吗?
不错,不装工具时候不错的选择
alibaba。。。。