信息安全:信息收集之:被动信息收集

郑重声明:
本笔记编写目的只用于安全知识提升,并与更多人共享安全知识,切勿使用笔记中的技术进行违法活动,利用笔记中的技术造成的后果与作者本人无关。倡导维护网络安全人人有责,共同维护网络文明和谐。

信息收集之:被动信息收集

被动信息收集OSINT: 公开渠道可获得的信息,与目标系统不产⽣生直接交互,尽量避免留下⼀一切痕迹。

OSINT:开源网络情报(Open source intelligence ),是美国中央情报局(CIA)的一种情报搜集手段,从各种公开的信息资源中寻找和获取有价值的情报。

• 美国军⽅方:http://www.fas.org/irp/doddir/army/atp2-22-9.pdf
• 北⼤大⻄西洋公约组织:http://information-retrieval.info/docs/NATO-OSINT.html

**主动信息收集:**直接与目标系统交互通信,无法避免留下访问的痕迹。

1 被动信息收集:OSINT

1.1 获取情报的公开渠道

媒体:报纸(newspapers)、杂志(magazines)、电台( radio)、电视节目(television)、基于计算机的信息(computer-based information)。

基于网络社区(Web-based communities)和用户创造的内容(user generated content):社交站点(social-networking sites)、视频分享站点(video sharing sites)、维基百科(wikis)、博客(blogs)、通俗分类(folksonomies)。

公开数据(Public data):政府报告(government reports)、官方数据(official data )如预算(budgets)、人口统计资料(demographics)、听证会(hearings)、立法辩论(legislative debates)、新闻发布会(press conferences)、演讲(speeches)、海洋和航空的安全警告(marine and aeronautical safety warnings)、环境影响图片( environmental impact statements)、合同签订(contract awards)。

观察(Observation)和报告(reporting):利用业余观察家们的成果,如某些人通过对谷歌地球(Google Earth)进行标注、上传某一地区的照片,从而大量借此扩展出了许多有价值的情报信息。

专家(Professional)和学者( academic):会议(conferences)、研讨会(symposia)、专业组织(professional associations)、学术论文(academic papers)、专家(subject matter experts)

地理信息数据:地图(maps)、地图集(atlases)、地名录( gazetteers)、港口规划(port plans)、重力数据(gravity data)、航空数据(aeronautical data)、导航数据(navigation data)、人类分布数据( human terrain data ,如文化和经济上的)、环境数据(environmental data)、商业影像(commercial imagery)、激光雷达(LIDAR ,Light Detection And Ranging)、超多光谱数据(hyper and multi-spectral data)、机载成像(airborne imagery)、地理名称(geo-names)、地理特征(geo-features)、城市地形(urban terrain)、垂直阻塞的数据(VOD, vertical obstruction data)、界标数据(boundary marker data)、地理空间聚合(geospatial mashups)、空间数据库(spatial databases)、web服务(web services)。许多信息都可以利用地理信息系统(GIS)进行整合、分析、聚合的。

1.2 信息收集内容

  • IP地址段
  • 域名信息
  • 邮件地址
  • ⽂文档图⽚片数据
  • 公司地址
  • 公司组织架构
  • 联系电话 / 传真号码
  • 人员姓名 / 职务
  • 目标系统使⽤用的技术架构
  • 公开的商业信息

1.3 信息用途

  • 用信息描述目标
  • 发现
  • 社会工程学攻击
  • 物理缺口

2 DNS 信息收集

2.1 nslookup

# 查询 DNS 域的名称服务器的信息
$ nslookup qq.com          
Server:         192.168.255.2
Address:        192.168.255.2#53

Non-authoritative answer:
Name:   qq.com
Address: 112.53.26.232
Name:   qq.com
Address: 111.30.144.71

# 查询 IP 地址/邮件交换器/名称服务器 信息。
$ nslookup -query=mx qq.com
$ nslookup -type=any qq.com

$ nslookup
> set type= a(Address)、mx(mail exchanger)、ns(nameserver)、any(所有)
> set q=a、mx、ns、any

# 查询起始授权机构
$ nslookup -type=soa qq.com
Server:         192.168.255.2
Address:        192.168.255.2#53

Non-authoritative answer:
qq.com
        origin = ns1.qq.com
        mail addr = webmaster.qq.com
        serial = 1330914143
        refresh = 3600
        retry = 300
        expire = 86400
        minimum = 300

Authoritative answers can be found from:

# 自定义查询 DNS 所使用的端口号
$ nslookup -port=56 qq.com

2.2 dig

  • dig 正向查询
# 查询 qq.com 所对应的主机地址。
$ dig qq.com

; <<>> DiG 9.16.15-Debian <<>> qq.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2878
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;qq.com.                                IN      A

;; ANSWER SECTION:
qq.com.                 5       IN      A       111.30.144.71
qq.com.                 5       IN      A       112.53.26.232

;; Query time: 16 msec
;; SERVER: 192.168.255.2#53(192.168.255.2)
;; WHEN: Mon May 17 02:41:02 EDT 2021
;; MSG SIZE  rcvd: 56

# 指定 DNS 服务器进行名称解析查询
$ dig @8.8.8.8 qq.com

; <<>> DiG 9.16.15-Debian <<>> @8.8.8.8 qq.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38460
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 16

;; QUESTION SECTION:
;qq.com.                                IN      A

;; ANSWER SECTION:
qq.com.                 247     IN      A       112.53.26.232
qq.com.                 247     IN      A       111.30.144.71

;; AUTHORITY SECTION:
qq.com.                 248     IN      NS      ns1.qq.com.
qq.com.                 248     IN      NS      ns2.qq.com.
qq.com.                 248     IN      NS      ns4.qq.com.
qq.com.                 248     IN      NS      ns3.qq.com.

;; ADDITIONAL SECTION:
ns1.qq.com.             248     IN      A       101.89.19.165
ns1.qq.com.             248     IN      A       157.255.246.101
ns1.qq.com.             248     IN      A       183.3.226.207
ns1.qq.com.             248     IN      A       203.205.220.251
ns1.qq.com.             252     IN      AAAA    2402:4e00:8030::115
ns2.qq.com.             77      IN      A       121.51.160.100
ns2.qq.com.             77      IN      A       123.151.66.78
ns2.qq.com.             77      IN      A       203.205.177.41
ns2.qq.com.             77      IN      A       203.205.249.143
ns2.qq.com.             252     IN      AAAA    2402:4e00:8010:1::11c
ns3.qq.com.             237     IN      A       112.60.1.69
ns3.qq.com.             237     IN      A       183.192.201.116
ns4.qq.com.             248     IN      A       125.39.46.125
ns4.qq.com.             248     IN      A       203.205.195.104
ns4.qq.com.             248     IN      A       203.205.221.79
ns4.qq.com.             248     IN      A       58.144.154.100

;; Query time: 20 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon May 17 03:09:46 EDT 2021
;; MSG SIZE  rcvd: 408

# 查询域名所有信息
$ dig qq.com any 

; <<>> DiG 9.16.15-Debian <<>> qq.com any
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17418
;; flags: qr rd ra; QUERY: 1, ANSWER: 10, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;qq.com.                                IN      ANY

;; ANSWER SECTION:
qq.com.                 300     IN      TXT     "v=spf1 include:spf.mail.qq.com -all"
qq.com.                 300     IN      MX      10 mx3.qq.com.
qq.com.                 300     IN      MX      30 mx1.qq.com.
qq.com.                 300     IN      MX      20 mx2.qq.com.
qq.com.                 63      IN      A       112.53.26.232
qq.com.                 63      IN      A       111.30.144.71
qq.com.                 95      IN      NS      ns2.qq.com.
qq.com.                 95      IN      NS      ns3.qq.com.
qq.com.                 95      IN      NS      ns4.qq.com.
qq.com.                 95      IN      NS      ns1.qq.com.

;; Query time: 28 msec
;; SERVER: 192.168.255.2#53(192.168.255.2)
;; WHEN: Mon May 17 03:11:43 EDT 2021
;; MSG SIZE  rcvd: 247

# 去除注释行
$ dig qq.com +nocomment

# 去除认证信息
$ dig qq.com +noauthority 

# 去除其他信息
$ dig qq.com +noadditional

# 去除回答信息
$ dig qq.com +noanswer
  • dig 反向查询
$ dig +noall +answer -x 8.8.8.8      
8.8.8.8.in-addr.arpa.   5       IN      PTR     dns.google.
  • bind 版本信息查询
# bind 版本信息查询
$ dig +noall +answer txt chaos VERSION.BIND qq.com        
VERSION.BIND.           5       CH      TXT     "9.9.8-P4-build017"
  • DNS 追踪
# DNS 追踪
$ dig @8.8.8.8 163.com +trace
; <<>> DiG 9.16.15-Debian <<>> @8.8.8.8 163.com +trace
; (1 server found)
;; global options: +cmd
.                       86668   IN      NS      a.root-servers.net.
.                       86668   IN      NS      b.root-servers.net.
.                       86668   IN      NS      c.root-servers.net.
.                       86668   IN      NS      d.root-servers.net.
.                       86668   IN      NS      e.root-servers.net.
.                       86668   IN      NS      f.root-servers.net.
.                       86668   IN      NS      g.root-servers.net.
.                       86668   IN      NS      h.root-servers.net.
.                       86668   IN      NS      i.root-servers.net.
.                       86668   IN      NS      j.root-servers.net.
.                       86668   IN      NS      k.root-servers.net.
.                       86668   IN      NS      l.root-servers.net.
.                       86668   IN      NS      m.root-servers.net.
.                       86668   IN      RRSIG   NS 8 0 518400 20210529170000 20210516160000 14631 . CjMMGXC7zKa54x+W1hlTUx7HAeHtdTC9/BQJgHj0P6DCXghs85iEDPW2 sfgZQP00+H2RYkkVjssgTMUwt1TnacC8AhQEr1QgDNedvYET/tchp6iq gBwl/b2Gc9SmNFdQwLtVf32IW9UE5WMtUolEnojdpxALjfZ3hRaVoJxO QrTrR0ZKcPTnZL7zgu5AFjncGCaq1H8tVkf5CyB13rOjuqpHmSGtwXoX h9SQKx4AfU1PgllCqmr0OpgXMU8JVV8ivCVJcK6n6BkPLaokMlrRmFsL 2BekYB3X5ZEAIqb/oS8y17iL3aQjt3S13pcgWtfLnJlBgbA7An2UZOB3 Qht2Lw==
;; Received 525 bytes from 8.8.8.8#53(8.8.8.8) in 40 ms

163.com.                84      IN      A       123.58.180.7
163.com.                84      IN      A       123.58.180.8
;; Received 57 bytes from 199.9.14.201#53(b.root-servers.net) in 12 ms

2.3 递归查询与迭代查询

递归查询:代理 DNS 负责请求

  • 如果主机所询问的本地域名服务器没有被查询的域名的 IP 地址,那么本地域名服务器就以DNS客户的身份,向其它根域名服务器继续发出查询请求报文(即替主机继续查询),而不是让主机自己进行下一步查询。

  • 因此,递归查询返回的查询结果或者是所要查询的IP地址,或者是报错,表示无法查询到所需的 IP 地址。

迭代查询:依次向上查询至根域名服务器,再依次向下查询目的域名地址

  • 当根域名服务器收到本地域名服务器发出的迭代查询请求报文时,要么给出所要查询的IP地址,要么告诉本地服务器:“你下一步应当向哪一个域名服务器进行查询”。

  • 然后让本地服务器进行后续的查询。根域名服务器通常是把自己知道的顶级域名服务器的IP地址告诉本地域名服务器,让本地域名服务器再向顶级域名服务器查询。

  • 顶级域名服务器在收到本地域名服务器的查询请求后,要么给出所要查询的IP地址,要么告诉本地服务器下一步应当向哪一个权限域名服务器进行查询。

  • 最后,知道了所要解析的IP地址或报错,然后把这个结果返回给发起查询的主机

2.4 DNS 区域传输

**DNS主从复制:**将主DNS服务器的解析库复制传送至从DNS服务器,进而从服务器就可以进行正向、反向解析了。

**区域传输:**从服务器向主服务器查询更新数据,保证数据一致性。

**DNS主从复制与区域传输的关系:**DNS区域传输,就是DNS主从复制的实现方法,DNS主从复制是DNS区域传输的表现形式。

DNS区域传输两种方式:

  • axfr:完全区域传输
  • ixfr:增量区域传输

当一个新的DNS服务器添加到区域中并配置为从DNS服务器时,它则会执行完全区域传送,在主DNS服务器上获取完整的资源记录副本;同时,为了保证数据同步,主域名服务器有更新时也会及时通知辅助域名服务器从而进行更新(增量区域传输)。

区域传输可能会发生条件

  • 当区域的刷新间隔到期时
  • 当其主服务器向辅助服务器通知区域更改时
  • 当 DNS 服务器服务在区域的辅助服务器上启动时
  • 在区域的辅助服务器使用 DNS 控制台以便手动启动来自其主服务器的传输时
# 配置时开启了区域传输功能,将会导致任何一台主机都可以跟这台 DNS 服务器进行数据库同步。从而可以获取该 DNS 服务器下的所有域名解析信息。
# DNS 传输
$ dig @ns3.sina.com sina.com axfr

; <<>> DiG 9.16.15-Debian <<>> @ns3.sina.com sina.com axfr
; (1 server found)
;; global options: +cmd
; Transfer failed.

# DNS 传输
$ host -T -l qq.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases: 

Host qq.com not found: 2(SERVFAIL)
; Transfer failed.

2.5 DNS 字典爆破

2.5.1 fierce

$ fierce --dns-server 8.8.8.8 --domain qq.com --subdomain-file  /usr/lib/python3/dist-packages/fierce/lists/default.txt
NS: ns4.qq.com. ns1.qq.com. ns2.qq.com. ns3.qq.com.
SOA: ns1.qq.com. (101.89.19.165)
Zone: failure
Wildcard: failure
Found: 0.qq.com. (0.0.0.1)
Found: 01.qq.com. (120.240.95.36)
...
Found: 61.qq.com. (112.53.27.11)


2.5.2 dnsenmu

$ dnsenum -f /usr/share/dnsenum/dns.txt --thread 5 qq.com -o qq.txt
dnsenum VERSION:1.2.6

-----   qq.com   -----
Host's addresses:
__________________  
qq.com.                                  19       IN    A        111.30.144.71
qq.com.                                  19       IN    A        112.53.26.232

Wildcard detection using: wppedwijlanx
_______________________________________
wppedwijlanx.qq.com.                     128      IN    A        120.240.95.36    

2.5.3 dnsrecon

$ dnsrecon -D /usr/share/dnsrecon/namelist.txt -d qq.com -n 8.8.8.8 --threads 5 --tcp

[*] Performing General Enumeration of Domain: qq.com
[-] DNSSEC is not configured for qq.com
[*]      SOA ns1.qq.com 101.89.19.165
...
[*]      NS ns2.qq.com 203.205.249.143

$ dnsrecon -D /usr/share/dnsrecon/namelist.txt -d qq.com --lifetime 10 -t std

[*] Performing General Enumeration of Domain:qq.com
[!] Wildcard resolution is enabled on this domain
[!] It is resolving to 120.240.95.36
[!] All queries will resolve to this address!!
[-] DNSSEC is not configured for qq.com
[*]      SOA ns1.qq.com 157.255.246.101
...
[*]      NS ns3.qq.com 112.60.1.69

2.6 DNS 注册信息

2.6.1 whois

$ whois qq.com
   Domain Name: QQ.COM
   Registry Domain ID: 2895300_DOMAIN_COM-VRSN
   Registrar WHOIS Server: whois.markmonitor.com
   Registrar URL: http://www.markmonitor.com
   Updated Date: 2021-03-31T04:00:05Z
   Creation Date: 1995-05-04T04:00:00Z
   Registry Expiry Date: 2030-07-27T02:09:19Z
   Registrar: MarkMonitor Inc.
   Registrar IANA ID: 292
   Registrar Abuse Contact Email: abusecomplaints@markmonitor.com
   Registrar Abuse Contact Phone: +1.2083895740
   Domain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited
   Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
   Domain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited
   Domain Status: serverDeleteProhibited https://icann.org/epp#serverDeleteProhibited
   Domain Status: serverTransferProhibited https://icann.org/epp#serverTransferProhibited
   Domain Status: serverUpdateProhibited https://icann.org/epp#serverUpdateProhibited
   Name Server: NS1.QQ.COM
   Name Server: NS2.QQ.COM
   Name Server: NS3.QQ.COM
   Name Server: NS4.QQ.COM
   DNSSEC: unsigned
   URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
>>> Last update of whois database: 2021-05-17T09:13:46Z <<<

GitHub - lijiejie/subDomainsBrute: A fast sub domain brute tool for pentesters

GitHub - ring04h/wydomain: to discover subdomains of your target domain

GitHub - aboul3la/Sublist3r: Fast subdomains enumeration tool for penetration testers

3 搜索引擎

3.1 搜索联网的设备

3.1.1 SHODAN

https://www.shodan.io/

  • Banner:http、ftp、ssh、telnet
  • 常见filter:
    • net (192.168.20.1)
    • city
    • country(CN、US)
    • port(80、21、22、23)
    • os
    • server
    • Hostname(主机或域名)

例:200 OK cisco country: JP

3.1.2 fofa

https://fofa.so/

想必到了这里搜索引擎的语句构造就不需要再赘述了,那么简单说两个例子:

1、查询C段

ip=“10.0.0.0/24”

2、查询网站名(可列出钓鱼网站)

title="网站名"

其他的可以自行参考文档:https://fofa.so/help

`查询语法

直接输入查询语句,将从标题,html内容,http头信息,url字段中搜索

title="abc" 从标题中搜索abc。例:[标题中有北京的网站](https://fofa.so/result?qbase64=dGl0bGU9IuWMl%2BS6rCI%3D)

header="abc" 从http头中搜索abc。例:[jboss服务器](https://fofa.so/result?qbase64=aGVhZGVyPSJqYm9zcyI%3D)

body="abc" 从html正文中搜索abc。例:[正文包含Hacked by](https://fofa.so/result?qbase64=Ym9keT0iSGFja2VkIGJ5Ig%3D%3D)

domain="qq.com" 搜索根域名带有qq.com的网站。例: [根域名是qq.com的网站](https://fofa.so/result?qbase64=ZG9tYWluPSJxcS5jb20i)

host=".gov.cn" 从url中搜索.gov.cn,注意搜索要用host作为名称。例: [政府网站](https://fofa.so/result?qbase64=aG9zdD0iLmdvdi5jbiI%3D), [教育网站](https://fofa.so/result?qbase64=aG9zdD0iLmVkdS5jbiI%3D)

port="443" 查找对应443端口的资产。例: [查找对应443端口的资产](https://fofa.so/result?qbase64=cG9ydD0iNDQzIg%3D%3D)

ip="1.1.1.1" 从ip中搜索包含1.1.1.1的网站,注意搜索要用ip作为名称。例: [查询IP为220.181.111.1的网站](https://fofa.so/result?qbase64=aXA9IjIyMC4xODEuMTExLjEi); 如果想要查询网段,可以是:ip="220.181.111.1/24",例如[查询IP为220.181.111.1的C网段资产](https://fofa.so/result?qbase64=aXA9IjIyMC4xODEuMTExLjEvMjQi)

protocol="https" 搜索指定协议类型(在开启端口扫描的情况下有效)。例: [查询https协议资产](https://fofa.so/result?qbase64=cHJvdG9jb2w9Imh0dHBzIg%3D%3D)

city="Hangzhou" 搜索指定城市的资产。例: [搜索指定城市的资产](https://fofa.so/result?qbase64=Y2l0eT0iSGFuZ3pob3Ui)

region="Zhejiang" 搜索指定行政区的资产。例: [搜索指定行政区的资产](https://fofa.so/result?qbase64=cmVnaW9uPSJaaGVqaWFuZyI%3D)

country="CN" 搜索指定国家(编码)的资产。例: [搜索指定国家(编码)的资产](https://fofa.so/result?qbase64=Y291bnRyeT0iQ04i)

cert="google" 搜索证书(https或者imaps等)中带有google的资产。例: [搜索证书(https或者imaps等)中带有google的资产](https://fofa.so/result?qbase64=Y2VydD0iZ29vZ2xlIg%3D%3D)

banner=users && protocol=ftp 搜索FTP协议中带有users文本的资产。例: [搜索FTP协议中带有users文本的资产](https://fofa.so/result?qbase64=YmFubmVyPXVzZXJzICYmIHByb3RvY29sPWZ0cA%3D%3D)

type=service 搜索所有协议资产,支持subdomain和service两种。例: [搜索所有协议资产](https://fofa.so/result?qbase64=dHlwZT1zZXJ2aWNl)

os=windows 搜索Windows资产。例: [搜索Windows资产](https://fofa.so/result?qbase64=b3M9d2luZG93cw%3D%3D)

server=="Microsoft-IIS/7.5" 搜索IIS 7.5服务器。例: [搜索IIS 7.5服务器](https://fofa.so/result?qbase64=c2VydmVyPT0iTWljcm9zb2Z0LUlJUy83LjUi)

app="HIKVISION-视频监控" 搜索海康威视设备,[更多app规则](https://fofa.so/rules/library)。例: [搜索海康威视设备](https://fofa.so/result?qbase64=YXBwPSJISUtWSVNJT04t6KeG6aKR55uR5o6nIg%3D%3D)

after="2017" && before="2017-10-01" 时间范围段搜索。例: [时间范围段搜索](https://fofa.so/result?qbase64=YWZ0ZXI9IjIwMTciICYmIGJlZm9yZT0iMjAxNy0xMC0wMSI%3D),注意: after是大于并且等于,before是小于,这里 after="2017" 就是日期大于并且等于 2017-01-01 的数据,而 before="2017-10-01" 则是小于 2017-10-01 的数据

asn="19551" 搜索指定asn的资产。例: [搜索指定asn的资产](https://fofa.so/result?qbase64=YXNuPSIxOTU1MSI%3D)

org="Amazon.com, Inc." 搜索指定org(组织)的资产。例: [搜索指定org(组织)的资产](https://fofa.so/result?qbase64=b3JnPSJBbWF6b24uY29tLCBJbmMuIg%3D%3D)

base_protocol="udp" 搜索指定udp协议的资产。例: [搜索指定udp协议的资产](https://fofa.so/result?qbase64=YmFzZV9wcm90b2NvbD0idWRwIg%3D%3D)

is_ipv6=true 搜索ipv6的资产,只接受true和false。例: [搜索ipv6的资产](https://fofa.so/result?qbase64=aXNfaXB2Nj10cnVl)

is_domain=true 搜索域名的资产,只接受true和false。例: [搜索域名的资产](https://fofa.so/result?qbase64=aXNfZG9tYWluPXRydWU%3D)

ip_ports="80,443" 或者 ports="80,443" 搜索同时开放80和443端口的ip资产(以ip为单位的资产数据)。例: [搜索同时开放80和443端口的ip](https://fofa.so/result?qbase64=aXBfcG9ydHM9IjgwLDQ0MyI%3D)

ip_ports"80,443" 或者 ports"80,443" 搜索同时开放80和443端口的ip资产(以ip为单位的资产数据)。例: [搜索只开放80和443端口的ip](https://fofa.so/result?qbase64=aXBfcG9ydHM9PSI4MCw0NDMi)

ip_country="CN" 搜索中国的ip资产(以ip为单位的资产数据)。例: [搜索中国的ip资产](https://fofa.so/result?qbase64=aXBfY291bnRyeT0iQ04i)

ip_region="Zhejiang" 搜索指定行政区的ip资产(以ip为单位的资产数据)。例: [搜索指定行政区的资产](https://fofa.so/result?qbase64=aXBfcmVnaW9uPSJaaGVqaWFuZyI%3D)

ip_city="Hangzhou" 搜索指定城市的ip资产(以ip为单位的资产数据)。例: [搜索指定城市的资产](https://fofa.so/result?qbase64=aXBfY2l0eT0iSGFuZ3pob3Ui)

ip_after="2019-01-01" 搜索2019-01-01以后的ip资产(以ip为单位的资产数据)。例: [搜索2019-01-01以后的ip资产](https://fofa.so/result?qbase64=aXBfYWZ0ZXI9IjIwMTktMDEtMDEi)

ip_before="2019-01-01" 搜索2019-01-01以前的ip资产(以ip为单位的资产数据)。例: [搜索2019-01-01以前的ip资产](https://fofa.so/result?qbase64=aXBfYmVmb3JlPSIyMDE5LTAxLTAxIg%3D%3D)

# 高级搜索:可以使用括号 和 && || !=等符号,如
title="powered by" && title!=discuz
title!="powered by" && body=discuz
( body="content="WordPress" || (header="X-Pingback" && header="/xmlrpc.php" && body="/wp-includes/") ) && host="gov.cn"
新增完全匹配的符号,可以加快搜索速度,比如查找qq.com所有host,可以是domain"qq.com"

3.2 GOOGLE 搜索

3.2.1 高级搜索:

  • 搜索完全匹配的结果("")或者(+):

  • 从搜索结果中排除特定字词(-): 例如:美食 -麻辣

  • 限制只在标题中搜索(intitle:):

  • 模糊搜索(*):

  • 搜索指定文件类型的结果(filetype:):

  • 搜索指定的社交媒体(@): 例如:@twitter。

  • 搜索特定价格($): 例如:相机 $400。

  • 在某个数字范围内执行搜索(…): 例如:相机 $50…$100。

  • 组合搜索(OR): 例如:马拉松 OR 比赛

  • 搜索特定网站(site:)或者(inurl:): 例如:site:youtube.com 或 site:.gov。

  • 搜索相关网站(related:): 例如:related:time.com。

  • 搜索指定的文档类型(filetype:): 例如:python入门 filetype:pdf

  • 查看网站的 Google 缓存版本在网址前加上“cache:”。

  • 在网页标题中查找(intitle:): 例如:intitle:知乎

  • 搜索文档正文关键字(intext:): 例如:intext:法定代表人

3.2.2 GOOGLE 搜索实例:

  • inurl:“level/15/exec/-/show”

  • intitle:“netbotz appliance” “ok”

  • inurl /admin/login.php

  • inurl:qq.txt

  • filetype:xls "username | password“

  • inurl:ftp “password” filetype:xls site:baidu.com

  • inurl:Service.pwd

3.3 YANDEX

俄罗斯搜索引擎

https://www.yandex.com/

4 WEB 信息探测

WEB 信息探测内容:

  • 网站类型:判断网站是独立开发还是cms二次修改或cms套用模版
  • 敏感文件:网站的登录接口、后台、未被保护的页面、备份文件(www.rar webroot.zip…)

在线CMS指纹识别平台

工具软件

  • 御剑 CMS 识别工具

5 邮箱查询

途径:

  • 社工库
  • qq群
  • whois 注册邮箱

5.1 TheHarvester

TheHarvester能够收集电子邮件账号、用户名、主机名和子域名等信息。它通过Google、Bing、PGP、LinkedIn、Baidu、Yandex、People123、Jigsaw、Shodan等公开资源整理收集这些信息。

$ theHarvester -d csdn.net -l 100 -b baidu 

*******************************************************************
*  _   _                                            _             *          
* | |_| |__   ___    /\  /\__ _ _ ____   _____  ___| |_ ___ _ __  *          
* | __|  _ \ / _ \  / /_/ / _` | '__\ \ / / _ \/ __| __/ _ \ '__| *          
* | |_| | | |  __/ / __  / (_| | |   \ V /  __/\__ \ ||  __/ |    *          
*  \__|_| |_|\___| \/ /_/ \__,_|_|    \_/ \___||___/\__\___|_|    *          
*                                                                 *          
* theHarvester 3.2.4                                              *          
* Coded by Christian Martorella                                   *          
* Edge-Security Research                                          *          
* cmartorella@edge-security.com                                   *          
*                                                                 *          
*******************************************************************          
                                                                             
                                                                             
[*] Target: csdn.net 
                                                                             
[*] Searching Baidu. 

[*] No IPs found.

[*] Emails found: 2
----------------------
kefu@csdn.net
vip@csdn.net

[*] Hosts found: 6
---------------------
blog.csdn.net:182.92.187.217
cto.csdn.net:39.96.132.69
feed.csdn.net:39.96.132.69
news.csdn.net:39.96.132.69
weixin.csdn.net:39.96.132.69
www.csdn.net:39.106.226.142

# 使用 proxychains 进行代理查询
proxychains theharvester -d 163.com -l 200 -b bing

6 Recon-ng 搜索

Recon-ng V5 需要手动下载模块:

  1. 更新模块列表: marketplace refresh

  2. 搜索模块索引: marketplace search whoxy_dns

  3. 安装模块: marketplace install recon/companies-domains/whoxy_dns

  4. 加载模块: modules load recon/companies-domains/whoxy_dns

Recon-ng V5 下载所有模块:

  • 方式一:

    1. 设置Recon-ng proxy: options set proxy 192.168.2.122:12321
    2. 输入 marketplace refresh 更新模块列表
    3. 输入 marketplace install all/或前缀(如: recon)
  • 方式二(推荐):

    1. 终端下执行 mv ~/.recon-ng ~/.recon-ngbak && git clone https://github.com/lanmaster53/recon-ng-marketplace.git ~/.recon-ng
    2. 如果网络原因还是不行,可以将把recon-ng-marketplace可以导入到码云上或者挂你的代理,最终目的就是把recon-ng-marketplace内所有文件放在家目录下的.recon-ng目录下

7 Metagoofil

Metagoofil 是一种命令行信息收集工具,用于提取属于目标公司公开的文件(PDF,DOC,XLS,PPT,DOCX,PPTX,XLSX)的元数据。它可以通过扫描获得的文件给予很多重要的信息。它可以根据提取元数据的生成HTML报告,再加上潜在的用户名列表对暴力破解开放的服务,如FTP、Web应用程序、VPN、POP3等非常有用。

metagoofil -d target.com -t pdf,doc,ppt -l 200 -n 5 -o metagoofil/ -f metagoofil/result.html

# 使用 proxychains 进行代理查询
metagoofil -d target.com -t pdf,doc,ppt -l 200 -n 5 -o metagoofil/ -f metagoofil/result.html

8 Maltego

Maltego 是为分析复杂环境而开发的高级平台。除了数据挖掘,它还进行数据关联并以可视方式呈现。Maltego与实体(人员,公司,网站,文档等)合作,你可以连接这些实体以获取来自不同来源的关于它们的进一步信息,以获得有意义的结果。该工具的独特功能是“转换”-插件库,可帮助运行各种测试以及与外部应用程序的数据集成。

其他途径

  • 社交网络
  • 工商注册
  • 新闻组 / 论坛
  • 招聘网站
  • 历史存档网站
  • 域名查询到注册人和注册邮箱,可以通过注册人或注册邮箱反查反查网站和注册人
      1. 爱站
      2. 站长工具
      3. 天眼
      4. http://whois.chinaz.com/?DomainName=qqpk.cn
      5. c段查询http://www.webscan.cc/ 查询 0-255 ip反查域名
      6. 超级ping 查询是否用了CDN http://ping.chinaz.com/www.moonsec.com
posted @ 2021-05-20 12:20  f_carey  阅读(54)  评论(0编辑  收藏  举报  来源