您的位置:首页 > 其它

信息收集之zoomeye

2020-02-03 04:57 357 查看

一.浏览器上使用api接口

1.https://api.zoomeye.org/user/login
 post传参:{"username" : "username","password" : "password"}

2.返回的token,用Modify Headers修改为"Authorization: JWT <YOUR-API-TOKEN>"

3.请求http://api.zoomeye.org/host/search?query="corporate/webpages/login.jsp"&facet=app,os,country&page=1可得json信息
 #query查询关键词;page翻页参数(默认为1);facets统计项目,如果为多个,使用, 号分隔各个统计项

二.python自动化利用

# -*- coding: UTF-8 -*-
import json
import requests
page = 1
PAGES = 5

def json_info(page):
access_token='<YOUR-API-TOKEN>'
headers = {'Authorization' : 'JWT ' + access_token,}
r = requests.get(url = 'http://api.zoomeye.org/host/search?query="corporate/webpages/login.jsp"&page=' + str(page),headers = headers)
r_decoded = json.loads(r.text) #将一个json串转化为dict
#print r_decoded
return r_decoded

if __name__ == '__main__':
while page <= PAGES:
r_decoded = json_info(page)
with open('zoomeye.txt','a')as f:
for i in r_decoded['matches']:
print i['ip'] + ' in ' + i['geoinfo']['country']['names']['en']
f.write(i['ip'] + ' in ' + i['geoinfo']['country']['names']['en']+'\n')
page+=1
print 'Searched_ip:' + str(r_decoded['total'])
with open('zoomeye.txt','a')as f:
f.write('Searched_ip:' + str(r_decoded['total']))

固定属性*
| 名称                           |  类型  |  说明                                 | 示例
| ------                        |------  |  -------------                    | ---  
| site                          | string | 网站地址                             | foo.com
| ip                             | string | IP  地址                              | foo.com
| headers                    | string | HTTP  请求头                        | HTTP/1.1...
| title                           | string | HTTP 标题                            | Hello Welcome...
| description                  | strine | HTTP meta description 属性  | foo
| keyword                       | string | HTTP meta 关键词             | foo
| domains                      | string | 站点包含子域                     | a.com
| waf.name                     | string | Web 防火墙名称               | jiasule
| waf.version                  | string | Web 防火墙名称版本         | v1.0
| server.name                 | string | Web 服务器名称               | nginx
| server.version               | string | Web 服务器版本               | 1.9.2
| component.name             | string | Web 容器名称               | mod_ssl
| component.version          | string | Web 容器版本               | v1.0
| language                       | string | Web 编程语言               | php
| db.name                       | string |  数据库名称                  | MySQL
| db.version                     | string | 数据库版本                   | v1.0
| frontend.name                 | string |  前端组件名称              | jQuery
| frontend.version               | string | 前端组件版本               | v1.0
| thirdparty                        | string |  第三方组件民称            | v1.0
| plugin.url                         | string |  插件 url                  | www.google.com/analysics
| plugin.name                     | string |  插件名称                  | google analysics
| plugin.version                  | string | 插件版本                   | v1.0
| webapp.url                      | string | web 应用 url               | wordpress.org
| webapp.name                  | string | Web 应用名称 name          | wordpress
| webapp.version                | string | Web 应用版本               | wordpress version
| html                                | string | HTTP HTML 请求体           | <Doctype....>
| geoinfo.asn                      | string | ASN 号                     | AS4134
| geoinfo.isp                       | string | 运营商                     | China Telecom Guangdong
| geoinfo.city                      | string | 城市                       | Guangzhou
| geoinfo.country.code        | string | 国家码                     | CN
| geoinfo.country.name       | string | 国家名称                   | China
| geoinfo.continent.code      | string | 洲际码                     | AS
| geoinfo.continent.name     | string | 洲际名称                   | Asia
| geoinfo.location.latitude     | float  | 纬度                       | 23.0268
| geoinfo.location.longitude  | float  | 经度                       | 113.1315

*注意转json串转化为了dict,所以要访问内嵌字典eg.i['geoinfo']['country']['names']['en']

转载于:https://www.cnblogs.com/Dleo/p/5726413.html

  • 点赞
  • 收藏
  • 分享
  • 文章举报
diaojiangy94964 发布了0 篇原创文章 · 获赞 0 · 访问量 149 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: