码迷,mamicode.com
首页 > 其他好文 > 详细

信息收集之zoomeye

时间:2016-08-01 17:33:09      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:

一.浏览器上使用api接口

1.http://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‘]

信息收集之zoomeye

标签:

原文地址:http://www.cnblogs.com/Dleo/p/5726413.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!