最近物联网安全很热门,不过作为一个技术吊丝,没有技术也没有硬件资源,可以批量扫描物联网设备,最近看到关于zoomeye的相关介绍,感觉很牛,就尝试了一下。小弟菜鸟一枚,只是为了一个邀请码,希望管理员赏赐。废话不说了,开始了。 首先,在zoomeye的搜索里,输入相关设备的指纹信息,我这里就用了“polycom vsx 8000”,这是一款视频会议的硬件,有很多功能,在网上可以找到相关设备的介绍,我这里就不多说了。好了看图:
我加了一些关键字,country:china 指定搜索中国的主机。 搜到了相关设备,我用zenmap扫描了一下,发现开放了23,24的端口,如图:
之后我尝试telnet ip 24,(ps:ip就是你找到的ip地址),如图
没有口令,就可以进入,可以执行命令,我执行了一句whoami,返回了结果,如图:
当然还有很多指令,可以尝试,使用help命令可以查看,如图:
具体这些指令的作用,有些我也没有尝试,大家可以自行百度,有些是linux的常用命令,有些是这款linuxbox的专属指令,可以上网查找具体设备的使用说明书,应该可以利用。 这样一个一个测试会比较慢,我们可以注册zoomeye的帐号,利用api来批量抓取设备的ip,之后可以用python,批量检测,用python操作zoomeye的api代码,我先放出来,结合了一些网上的代码,从新造轮子不是脚本小子的风格,我们的风格就是拿起工具,复制粘贴,就是干。Haha。
[Python] 纯文本查看 复制代码 # coding: utf-8
# author : evilwebshell
# datetime: 20170209
import os
import requests
import json
access_token = ''
ip_list = []
def login():
"""
输入用户米密码 进行登录操作
:return: 访问口令 access_token
"""
user = raw_input('[-] input : username :')
passwd = raw_input('[-] input : password :')
data = {
'username' : user,
'password' : passwd
}
data_encoded = json.dumps(data) # dumps 将 python 对象转换成 json 字符串
try:
r = requests.post(url = 'https://api.zoomeye.org/user/login',data = data_encoded)
r_decoded = json.loads(r.text) # loads() 将 json 字符串转换成 python 对象
print r_decoded
global access_token
access_token = r_decoded['access_token']
except Exception,e:
print '[-] info : username or password is wrong, please try again '
exit()
def saveStrToFile(file,str):
"""
将字符串写如文件中
:return:
"""
with open(file,'w') as output:
output.write(str)
def saveListToFile(file,list):
"""
将列表逐行写如文件中
:return:
"""
s = '\n'.join(list)
with open(file,'a') as output:
output.write(s)
def apiTest():
"""
进行 api 使用测试
:return:
"""
page = 1
global access_token
with open('access_token.txt','r') as input:
access_token = input.read()
# 将 token 格式化并添加到 HTTP Header 中
headers = {
'Authorization' : 'JWT ' + access_token,
}
# print headers
while(True):
try:
r = requests.get(url = 'https://api.zoomeye.org/host/search?page=1&query=Polycom VSX 8000 ftpd country:china"&facet=app,os&page=' + str(page),
headers = headers)
r_decoded = json.loads(r.text)
# print r_decoded
# print r_decoded['total']
for x in r_decoded['matches']:
print x['ip']
print x['portinfo']['port']
ip_list.append(x['ip']+':'+str(24))
print '[-] info : count ' + str(1 * 10)
except Exception,e:
# 若搜索请求超过 API 允许的最大条目限制 或者 全部搜索结束,则终止请求
if str(e.message) == 'matches':
print '[-] info : account was break, excceeding the max limitations'
break
else:
print '[-] info : ' + str(e.message)
else:
if page == 10:
break
page += 1
def main():
# 访问口令文件不存在则进行登录操作
if not os.path.isfile('access_token.txt'):
print '[-] info : access_token file is not exist, please login'
login()
saveStrToFile('access_token.txt',access_token)
apiTest()
saveListToFile('ip_list.txt',ip_list)
if __name__ == '__main__':
main()
结果看图:
因为关键字搜索的都是21端口,我们需要的是24端口,所以我在代码里做了些处理,在每个ip后面添加了:24的字符,结果如下:
之后,我们可以再用python编写一个批量检测的工具,批量检测那个存在口口令。具体情况,下次写文章时候会放出,See you later。
|