Offensive Pentesting之Red Team Recon

前言

  • AD前置

  • 学习如何使用DNS、高级搜索、Recon-ng和Maltego来收集目标信息。

  • Recon(侦察)可以被定义为针对目标(客户)的初步调查或观察,在此期间还应该尽量让目标不注意到你的操作行为;如果你的侦察活动会产生过多的垃圾数据或者记录,那么目标就有可能会收到相关的安全警报,从而就会降低红队完成演练任务的可能性。

    1. 侦察(信息收集)活动的类型;

    2. 了解使用WHOIS以及基于DNS所进行的侦察(信息收集);

    3. 通过高级搜索进行侦察(信息收集);

    4. 使用专门的搜索引擎进行侦察(信息收集);

    5. Recon-ng工具介绍;

    6. Maltego工具介绍。

  • 本节将讨论的一些具体目标包括:

    1. 发现与目标公司相关的子域名;

    2. 针对目标,收集相关主机和IP地址的公开可用信息;

    3. 查找与目标相关的电子邮件地址;

    4. 针对目标,尝试发现相关的登录凭据和所泄露的密码;

    5. 针对目标,查找已泄露的相关文档和电子表格。

  • 侦察可以分为两种:被动侦察和主动侦察。

  • 在本文中,我们将专注于学习被动侦察,所谓被动侦察——指的是在收集信息时,不惊扰目标或制造“太多垃圾记录”的技术。

侦察分类

  • 侦察(recon)活动可分为两种:

    1. 被动侦察(被动信息收集):通过被动观察目标来进行即可;

    2. 主动侦察(主动信息收集):需要与目标发生交互,以便观察目标的反应。

  • 被动侦察不需要与目标发生交互,换句话说,你不会向目标或目标所拥有的系统发送任何数据包或请求;被动侦察主要依赖于由第三方收集和维护的公开可用信息,比如我们可以基于OSINT(开源情报)进行被动侦察,OSINT是指收集有关目标的公开信息,例如查看目标的公开社交媒体资料就属于OSINT的范畴。通过被动侦察,我们可能收集到的示例信息包括:域名、IP 地址块、电子邮件地址、员工姓名和职位发布记录等等。

  • 在主动侦察中,我们需要通过发送请求和数据包并观察目标是否响应、如何响应来与目标进行交互。通过主动侦察收集到的回复——或者没有回复——都将有助于我们更好地进行被动侦察。主动侦察的一个例子是使用 Nmap 扫描目标子网和活动主机,我们期望通过主动侦察发现的信息包括:存活主机名称、正在运行的服务器名称、处于侦听状态的服务名称以及服务的版本号等等。

  • 主动侦察还可以分为以下两种情况:

    1. 外部主动侦察:在目标网络之外进行,重点关注可通过Internet评估的面向外部的网络资产,例如在目标公司网络外部运行 Nikto 并针对目标进行扫描;

    2. 内部主动侦察:在目标公司的网络内部进行,换句话说,渗透测试人员或红队队员可以访问到目标内网;在这种情况下,他们可能会在目标网络上使用被感染的主机,例如在某个目标计算机上使用Nessus来扫描目标的内部网络。

内置工具

  • 信息收集工具有:

    • whois;

    • nslookup,dig, host;

    • traceroute/tracert。

WHOIS(域名查询服务) :

  • 一个遵循RFC 3912规范的请求和响应协议,WHOIS服务器会在TCP端口43上监听传入请求,并且由域名注册商负责维护其租赁域名的WHOIS记录。当我们使用whois命令时,它将查询WHOIS服务器以提供所有保存的相关记录;在下面的例子中,我们可以看到使用whois命令查询目标域名将为我们提供:

    • Registrar WHOIS server——WHOIS服务器注册商的信息;

    • Registrar URL——(目标域名)注册商的URL地址;

    • Record creation date——记录(目标域名)创建日期;

    • Record update date——记录(目标域名)更新日期;

    • Registrant contact info and address (unless withheld for privacy)——注册人的联系方式和地址(除非为保护隐私而选择隐藏);

    • Admin contact info and address (unless withheld for privacy)——管理员的联系信息和地址(除非为了隐私而选择隐藏);

    • Tech contact info and address (unless withheld for privacy)——关于技术支持服务的联系信息和地址(除非为了隐私而选择隐藏);

    • domain name registrar —— 域名注册商;

    • domain registrant —— 域名注册人。

┌──(kali㉿kali)-[~/桌面/THM]
└─$ whois thmredteam.com
   Domain Name: THMREDTEAM.COM
   Registry Domain ID: 2643258257_DOMAIN_COM-VRSN
   Registrar WHOIS Server: whois.namecheap.com
   Registrar URL: http://www.namecheap.com
   Updated Date: 2023-09-30T23:11:17Z
   Creation Date: 2021-09-24T14:04:16Z
   Registry Expiry Date: 2024-09-24T14:04:16Z
   Registrar: NameCheap, Inc.
   Registrar IANA ID: 1068
   Registrar Abuse Contact Email: abuse@namecheap.com
   Registrar Abuse Contact Phone: +1.6613102107
   Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
   Name Server: KIP.NS.CLOUDFLARE.COM
   Name Server: UMA.NS.CLOUDFLARE.COM
   DNSSEC: unsigned
   URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
>>> Last update of whois database: 2023-12-26T13:23:59Z <<<

For more information on Whois status codes, please visit https://icann.org/epp

NOTICE: The expiration date displayed in this record is the date the
registrar's sponsorship of the domain name registration in the registry is
currently set to expire. This date does not necessarily reflect the expiration
date of the domain name registrant's agreement with the sponsoring
registrar.  Users may consult the sponsoring registrar's Whois database to
view the registrar's reported date of expiration for this registration.

TERMS OF USE: You are not authorized to access or query our Whois
database through the use of electronic processes that are high-volume and
automated except as reasonably necessary to register domain names or
modify existing registrations; the Data in VeriSign Global Registry
Services' ("VeriSign") Whois database is provided by VeriSign for
information purposes only, and to assist persons in obtaining information
about or related to a domain name registration record. VeriSign does not
guarantee its accuracy. By submitting a Whois query, you agree to abide
by the following terms of use: You agree that you may use this Data only
for lawful purposes and that under no circumstances will you use this Data
to: (1) allow, enable, or otherwise support the transmission of mass
unsolicited, commercial advertising or solicitations via e-mail, telephone,
or facsimile; or (2) enable high volume, automated, electronic processes
that apply to VeriSign (or its computer systems). The compilation,
repackaging, dissemination or other use of this Data is expressly
prohibited without the prior written consent of VeriSign. You agree not to
use electronic processes that are automated and high-volume to access or
query the Whois database except as reasonably necessary to register
domain names or modify existing registrations. VeriSign reserves the right
to restrict your access to the Whois database in its sole discretion to ensure
operational stability.  VeriSign may restrict or terminate your access to the
Whois database for failure to abide by these terms of use. VeriSign
reserves the right to modify these terms at any time.

The Registry database contains ONLY .COM, .NET, .EDU domains and
Registrars.
Domain name: thmredteam.com
Registry Domain ID: 2643258257_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.namecheap.com
Registrar URL: http://www.namecheap.com
Updated Date: 2023-09-30T23:11:17.09Z
Creation Date: 2021-09-24T14:04:16.00Z
Registrar Registration Expiration Date: 2024-09-24T14:04:16.00Z
Registrar: NAMECHEAP INC
Registrar IANA ID: 1068
Registrar Abuse Contact Email: abuse@namecheap.com
Registrar Abuse Contact Phone: +1.9854014545
Reseller: NAMECHEAP INC
Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
Registry Registrant ID: 
Registrant Name: Redacted for Privacy
Registrant Organization: Privacy service provided by Withheld for Privacy ehf
Registrant Street: Kalkofnsvegur 2 
Registrant City: Reykjavik
Registrant State/Province: Capital Region
Registrant Postal Code: 101
Registrant Country: IS
Registrant Phone: +354.4212434
Registrant Phone Ext: 
Registrant Fax: 
Registrant Fax Ext: 
Registrant Email: e17b7976233e4e72a76b3dadb1d574bd.protect@withheldforprivacy.com
Registry Admin ID: 
Admin Name: Redacted for Privacy
Admin Organization: Privacy service provided by Withheld for Privacy ehf
Admin Street: Kalkofnsvegur 2 
Admin City: Reykjavik
Admin State/Province: Capital Region
Admin Postal Code: 101
Admin Country: IS
Admin Phone: +354.4212434
Admin Phone Ext: 
Admin Fax: 
Admin Fax Ext: 
Admin Email: e17b7976233e4e72a76b3dadb1d574bd.protect@withheldforprivacy.com
Registry Tech ID: 
Tech Name: Redacted for Privacy
Tech Organization: Privacy service provided by Withheld for Privacy ehf
Tech Street: Kalkofnsvegur 2 
Tech City: Reykjavik
Tech State/Province: Capital Region
Tech Postal Code: 101
Tech Country: IS
Tech Phone: +354.4212434
Tech Phone Ext: 
Tech Fax: 
Tech Fax Ext: 
Tech Email: e17b7976233e4e72a76b3dadb1d574bd.protect@withheldforprivacy.com
Name Server: kip.ns.cloudflare.com
Name Server: uma.ns.cloudflare.com
DNSSEC: unsigned
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
>>> Last update of WHOIS database: 2023-12-26T02:24:21.35Z <<<
For more information on Whois status codes, please visit https://icann.org/epp
  • 仅用域名就可以获得许多有价值的信息。在针对目标域名使用whois查找之后,我们可能会幸运地找到域名注册者的姓名、电子邮件地址、邮政地址和电话号码,以及关于目标域名的其他技术信息等。在以上whois查询结果的最后,我们还找到了相关域名的权威名称服务器。

nslookup

  • DNS查询可以在我们的系统上使用许多不同的工具来执行,尤其是在类unix系统中。例如,nslookup是类unix系统、Windows系统和macOS中常见的一个内置工具,它可以用于查询DNS信息。在下面的查询示例中,我们可以看到nslookup将如何使用默认的DNS服务器来获取与我们的域相关的A和AAAA记录。nslookup domain [dns-server]

      ┌──(kali㉿kali)-[~/桌面/THM]
      └─$ nslookup cafe.thmredteam.com
      Server:		192.168.223.2     #如果在nslookup命令中未指定[dns-server],则将使用系统默认的DNS服务器。
      Address:	192.168.223.2#53  #此行是系统默认的DNS服务器地址,可在系统中使用以下命令查询:cat /etc/resolv.conf
    
      Non-authoritative answer:
      Name:	cafe.thmredteam.com
      Address: 172.67.212.249
      Name:	cafe.thmredteam.com
      Address: 104.21.93.169
      Name:	cafe.thmredteam.com
      Address: 2606:4700:3034::6815:5da9
      Name:	cafe.thmredteam.com
      Address: 2606:4700:3034::ac43:d4f9
    

dig

  • 在类unix系统上的另一个常见工具是dig,它是Domain Information Groper (dig)的缩写。dig为我们提供了许多查询选项,还允许我们指定在查询时要使用的不同DNS服务器;例如,我们可以使用Cloudflare的DNS服务器来进行域名信息查询:dig @1.1.1.1 tryhackme.com
┌──(kali㉿kali)-[~/桌面/THM]
└─$ dig @1.1.1.1 tryhackme.com

; <<>> DiG 9.18.10-2-Debian <<>> @1.1.1.1 tryhackme.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24579
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;tryhackme.com.			IN	A

;; ANSWER SECTION:
tryhackme.com.		300	IN	A	172.67.27.10
tryhackme.com.		300	IN	A	104.22.54.228
tryhackme.com.		300	IN	A	104.22.55.228

;; Query time: 472 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Tue Dec 26 08:35:21 EST 2023
;; MSG SIZE  rcvd: 90

host

  • host命令是向DNS服务器查询DNS记录的另一个有用的替代方法,相关的参考示例如下所示:
┌──(kali㉿kali)-[~/桌面/THM]
└─$ host cafe.thmredteam.com
cafe.thmredteam.com has address 172.67.212.249
cafe.thmredteam.com has address 104.21.93.169
cafe.thmredteam.com has IPv6 address 2606:4700:3034::6815:5da9
cafe.thmredteam.com has IPv6 address 2606:4700:3034::ac43:d4f9

traceroute/tracert

  • 类unix系统所附带的工具traceroute,在MS Windows系统上与之相对应的是tracert工具。顾名思义,traceroute会跟踪数据包从我们的系统到目标主机所采取的路由。如下面的控制台输出所示,traceroute为我们提供了将我们连接到目标系统的路由器(跳数)的相关信息;请注意,有些路由器不响应traceroute所发送的数据包,因此,我们可能看不到某些路由器的IP地址,在相关的输出结果中会用*符号表示这种情况。

      pentester@TryHackMe$ traceroute cafe.thmredteam.com
      traceroute to cafe.thmredteam.com (172.67.212.249), 30 hops max, 60 byte packets
      1  _gateway (192.168.0.1)  3.535 ms  3.450 ms  3.398 ms
      2  * * *
      3  * * *
      4  * * *
      5  * * *
      6  * * *
      7  172.16.79.229 (172.16.79.229)  4.663 ms  6.417 ms  6.347 ms
      8  * * *
      9  172.16.49.1 (172.16.49.1)  6.688 ms 172.16.48.1 (172.16.48.1)  6.671 ms 172.16.49.1 (172.16.49.1)  6.651 ms
      10  213.242.116.233 (213.242.116.233)  96.769 ms 81.52.187.243 (81.52.187.243)  96.634 ms  96.614 ms
      11  bundle-ether302.pastr4.paris.opentransit.net (193.251.131.116)  96.592 ms  96.689 ms  96.671 ms
      12  193.251.133.251 (193.251.133.251)  96.679 ms  96.660 ms  72.465 ms
      13  193.251.150.10 (193.251.150.10)  72.392 ms 172.67.212.249 (172.67.212.249)  91.378 ms  91.306 ms      
    
      ┌──(kali㉿kali)-[~/桌面/THM]
      └─$ traceroute cafe.thmredteam.com
      traceroute to cafe.thmredteam.com (172.67.212.249), 30 hops max, 60 byte packets
      1  _gateway (192.168.223.2)  0.649 ms  0.678 ms  0.375 ms
      2  * * *
      3  * * *
      4  * * *
      5  * * *
      6  * * *
      7  * * *
      8  * * *
      9  * * *
      10  * * *
      11  * * *
      12  * * *
      13  * * *
      14  * * *
      15  * * *
      16  * * *
      17  * * *
      18  * * *
      19  * * *
      20  * * *
      21  * * *
      22  * * *
      23  * * *
      24  * * *
      25  * * *
      26  * * *
      27  * * *
      28  * * *
      29  * * *
      30  * * *
    

总结

  • whois 可用于查询WHOIS数据库;

  • nslookup,dig或者host 可用于查询DNS服务器。

  • WHOIS数据库和DNS服务器都存有一些公开可用的信息,查询这两者并不会产生任何可疑的流量——这属于被动侦察(信息搜集)活动。

  • 此外,我们还可以使用traceroute工具 (在Linux和macOS系统上为traceroute,在Windows系统上为tracert)来发现本地系统和目标主机之间的路由器跳数情况。

高级搜索

  • 能够有效地使用搜索引擎是一项至关重要的技能,下表显示了一些适用于许多流行搜索引擎的高级搜索修饰符。

    Alt text

  • 除了pdf类型之外,其他可以考虑的文件类型还有doc、docx、ppt、pptx、xls和xlsx等。

  • 每个搜索引擎都可能会有一组稍有不同的搜索规则和语法,如果要了解不同搜索引擎的特定语法,你可能需要访问它们各自的帮助页面。某些搜索引擎,如谷歌,还会提供一个用于高级搜索的web界面:Google Advanced Search(谷歌高级搜索)

  • 在通常情况下,我们最好选择记住高级搜索语法,比如 Google Refine Web SearchesDuckDuckGo Search Syntax 以及 Bing Advanced Search Options

  • 搜索引擎日夜抓取万维网,以索引新的网页和文件,有时这会导致索引到一些机密信息,这些机密信息的例子包括:

    • Documents for internal company use——公司内部使用的文档;

    • Confidential spreadsheets with usernames, email addresses, and even passwords——包含用户名、电子邮件地址甚至密码的机密电子表格;

    • Files containing usernames——包含用户名的文件;

    • Sensitive directories——敏感目录;

    • Service version number (some of which might be vulnerable and unpatched)——和网站关联的某些服务的版本号(其中一些可能存在漏洞且未打补丁);

    • Error messages——报错消息(网站在用户访问时可能出现的报错信息)。

  • 将高级谷歌搜索与特定术语相结合,就可能会发现包含敏感信息或易受攻击的web服务器的相关文档,像Google Hacking Database (GHDB)这样的网站会专门收集此类搜索词,并且会公开提供。因此,我们可以了解一些GHDB查询,然后查看我们的目标客户是否会因为搜索引擎而公开了某些机密信息,GHDB将包含以下类别的查询:

    • Footholds(寻找立足点)

      例如GHDB-ID: 6364,它将使用查询 intitle:"index of" "nginx.log"来发现Nginx日志,并可能会揭示一些服务器错误配置(存在漏洞利用的机会)。

    • Files Containing Usernames(包含用户名的文件)

      例如GHDB-ID: 7047会使用查询intitle:"index of" "contacts.txt"来发现泄露重要信息的文件。

    • Sensitive Directories(敏感目录)

      例如GHDB-ID: 6768,它将使用查询 inurl:/certs/server.key来检查RSA私钥是否已暴露。

    • Web Server Detection(Web服务器探测)

      例如GHDB-ID: 6876,它将使用查询intitle:"GlassFish Server - Server Running"来探测GlassFish服务器的相关信息。

    • Vulnerable Files(易受攻击的文件)

      例如,我们可以使用GHDB-ID: 7786所提供的查询intitle:"index of" "*.php"来检索php文件。

    • Vulnerable Servers(易受攻击的服务器)

      例如,可使用GHDB-ID: 6728所提供的查询intext:"user name" intext:"orion core" -solarwinds.com来发现暴露的SolarWinds Orion web控制台。

    • Error Messages(报错消息)

      我们可以从报错消息中提取大量可能有用的信息,例如使用GHDB-ID: 5963所提供的查询intitle:"index of" errors.log来查找与错误相关的日志文件。

  • 在实际使用时,你可能还需要调整上述这些谷歌查询以满足你的需求,因为这些查询将返回来自所有符合标准并被索引的web服务器的结果;此外,为了避免产生法律问题,最好不要访问任何超出法律协议范围的敏感文件。

  • 接下来,我们将探索另外两个可以在不与目标交互的情况下提供有价值信息的来源:

    • Social Media——社交媒体;

    • Job ads——招聘广告。

社交媒体

  • 社交媒体已经变得非常流行,不仅个人喜欢使用,而且企业也经常会使用。某些社交媒体平台可能会透露大量关于目标的信息,当越来越多的用户倾向于过度分享他们自己的生活和工作细节时,这一点尤其正确。以下几个社交媒体值得我们进行信息收集:

    • LinkedIn(领英)
    • Twitter(推特)
    • Facebook
    • Instagram
    • 新浪微博
    • 微信
    • QQ
    • 抖音
    • 知乎
  • 社交媒体网站让收集特定公司员工的姓名变得很容易,此外,在某些情况下,你可能会了解到一些可以揭示密码恢复问题答案的特定信息片段,或者获得一些可以用于生成密码字典文件的信息;而且,来自目标公司的技术人员的帖子可能会透露出有关公司系统和供应商的详细信息,例如,最近获得Juniper认证的网络工程师可能会暗示在其雇主的环境中将使用Juniper网络基础设施这一信息。

招聘广告

  • 招聘广告也能告诉你很多关于目标公司的信息,除了可能会透露目标客户的姓名和电子邮件地址外,技术职位的招聘信息还可能会让我们了解目标公司的系统和基础设施。受欢迎的工作岗位可能因国家而异,所以,一定要在你的客户发布招聘广告的国家的招聘网站上查看;此外,我们还可以查看目标客户的网站上是否有职位空缺,看看是否能泄露出一些有趣的信息。

  • 请注意,Wayback Machine可以帮助我们检索客户网站上以前版本的招聘页面(历史招聘页面)。

在线查询网站&专门的搜索引擎

与WHOIS和DNS相关的在线查询网站

  • 除了前述介绍的标准WHOIS和DNS查询工具之外,第三方还可以基于历史数据提供付费服务;比如WHOIS历史记录,它能够提供关于WHOIS数据的历史记录,如果域名注册人在注册域名时没有使用WHOIS隐私保护,则查询WHOIS历史记录就可以派上用场。

  • 有一些网站还能够提供免费的高级WHOIS和DNS查询等服务,我们可以考虑使用以下网站:

ViewDNS.info

  • ViewDNS.info能够提供反向IP查找服务(这只是ViewDNS.info的其中功能之一)。最初,每个web服务器会选择使用一个或多个IP地址;然而,今天,共享主机服务器也是很常见的,当使用共享主机时,一个IP地址可以在许多具有不同域名的不同web服务器之间共享。通过ViewDNS.info的反向IP查找功能,你就可以从域名或IP地址开始,使用特定的IP地址/域名找到与之相关的其他域名。

  • 如下图所示,我们可以使用反向IP查找功能来查找与cafe.thmredteam.com共享相同IP地址的其他服务器。在此过程中,我们要知道的是一个IP地址并不一定只对应一个单一的网站。

    Alt text

Threat Intelligence Platform

  • Threat Intelligence Platform即威胁情报平台,它需要我们首先提供一个指定的域名或IP地址,然后就会启动一系列测试,从恶意软件检查到WHOIS和DNS查询都会涉及到。其中WHOIS和DNS的查询结果,会与我们之前使用whois和dig工具获得的结果相似,但是威胁情报平台会以更具可读性和视觉吸引力的方式呈现它们。我们以查询thmredteam.com的信息为例,结果将如下所示:

    Alt text Alt text

  • 我们还可以从这个网站的查询结果报告中获得一些额外信息,例如,在我们查找thmredteam.com之后,我们能够看到名称服务器(NS)记录会被解析为它们各自的IPv4和IPv6地址,如下图所示:

    Alt text

  • 另一方面,当我们搜索cafe.thmredteam.com时,我们也可以得到同一个IP地址上的其他域名的列表;我们在下图中看到的结果会与我们使用ViewDNS.info进行反向IP查找所获得的结果类似:

    Alt text

专门的搜索引擎

  • Censys

    可以提供大量关于目标IP地址和目标域名的信息。在以下示例中,我们先查找到了一个由cafe.thmredteam.com解析到的一个IP地址,然后再用Censys搜索这个IP地址,我们很容易地推断出这个IP地址是属于Cloudflare,我们还可以看到此IP的80端口、443端口等相关的信息。因此,示例中的IP地址是用于指向某个服务器网站的,而并不是指向我们所要查找的目标域名cafe.thmredteam.com;换句话说,这个IP地址并不指向目标客户的网站(https://cafe.thmredteam.com),区分这一点很重要,这样我们就不会去探测渗透测试合同范围之外的其他系统。

    Alt text

    Alt text

  • Shodan.io

    Alt text

  • 在本节中,我们将主要演示如何从命令行使用shodan,要从命令行使用shodan,我们首先需要创建一个shodan帐户,然后通过shodan init API_KEY命令来使用你的API密钥并配置shodan。``

    Alt text

    Alt text

  • 我们可以根据shodan帐户的类型使用不同的信息过滤器,如果还想了解有关shodan命令行界面的更多信息,我们可以查看shodan CLI。现在让我们演示一个简单的示例,针对从命令nslookup cafe.thmredteam.com的结果中获得的一个IP地址,使用shodan host IP_ADDRESS,然后我们就可以获得目标IP的地理位置和目标端口开放的情况,具体内容将如下所示。

      pentester@TryHackMe$ shodan host 172.67.212.249
    
      172.67.212.249
      City:                    San Francisco
      Country:                 United States
      Organisation:            Cloudflare, Inc.
      Updated:                 2021-11-22T05:55:54.787113
      Number of open ports:    5
    
      Ports:
          80/tcp
          443/tcp
      |-- SSL Versions: -SSLv2, -SSLv3, -TLSv1, -TLSv1.1, TLSv1.2, TLSv1.3
      2086/tcp
      2087/tcp
      8080/tcp
    

Recon-ng工具

  • Recon-ng是一个能够帮助进行自动化OSINT(开源情报)收集工作的框架,它可以使用来自于不同作者的模块,这些模块能提供大量功能。有些模块需要搭配密钥才能生效,这些密钥允许模块去查询相关的在线API。在本小节中,我们将演示如何在终端中使用recon-ng。

  • 从渗透测试和红队的角度来看,Recon-ng可用于查找有助于渗透操作或OSINT(开源情报)任务的各种信息。Recon-ng所收集到的所有数据都会自动保存在与你的工作区相关的数据库中;例如,你可能会尝试发现目标主机地址,以便稍后进行端口扫描或收集联系人电子邮件地址以进行网络钓鱼攻击等。

  • 你可以使用recon-ng命令来启动Recon-ng,成功启动Recon-ng之后出现一个类似[Recon-ng][default] >的提示;在这个阶段,你需要选择要使用的已安装Recon-ng模块,但是,如果这是你第一次运行recon-ng,那么则需要安装所需的Recon-ng模块。

  • 在本小节中,我们将遵循以下工作流程:

    1. 为你的项目创建一个工作区;
    2. 将起始信息插入数据库;
    3. 在市场中搜索模块,并在安装模块之前了解它;
    4. 列出已安装的模块并加载其中一个;
    5. 运行已加载的模块。

创建工作区

  • 运行workspaces create WORKSPACE_NAME命令为你的信息收集项目创建一个新的工作区;例如,使用workspaces create thmredteam命令将创建一个名为thmredteam的工作区。

  • 使用recon-ng -w WORKSPACE_NAME命令启动指定了工作区的recon-ng。

插入信息到Recon-ng数据库

  • 在侦察(信息收集)活动中,你往往会从一条信息开始,并尝试将其转化为新的信息;例如,你可以从目标公司的名称开始研究,并使用它来发现目标域名、目标联系人以及联系人的个人资料等等,然后你可以使用你获得的新信息来做进一步的信息转换,从而更多地了解你的目标。

  • 让我们考虑这样一种情况:我们已经知道目标的域名thmredteam.com,并且想将其输入到与活动工作区相关的Reccon -ng数据库中;例如,我们想要将目标域名thmredteam.com插入到数据库的域名(domains)表中,我们可以使用命令db insert domains来完成。

    • tips:如果要检查Recon-ng数据库中表的名称,我们可以运行db schema命令。
┌──(kali㉿kali)-[~/桌面/THM]
└─$ recon-ng -w thmredteam
[!] Unable to synchronize module index. (ConnectionError).
[*] Version check disabled.

    _/_/_/    _/_/_/_/    _/_/_/    _/_/_/    _/      _/            _/      _/    _/_/_/
   _/    _/  _/        _/        _/      _/  _/_/    _/            _/_/    _/  _/       
  _/_/_/    _/_/_/    _/        _/      _/  _/  _/  _/  _/_/_/_/  _/  _/  _/  _/  _/_/_/
 _/    _/  _/        _/        _/      _/  _/    _/_/            _/    _/_/  _/      _/ 
_/    _/  _/_/_/_/    _/_/_/    _/_/_/    _/      _/            _/      _/    _/_/_/    


                                          /\
                                         / \\ /\
    Sponsored by...               /\  /\/  \\V  \/\
                                 / \\/ // \\\\\ \\ \/\
                                // // BLACK HILLS \/ \\
                               www.blackhillsinfosec.com

                  ____   ____   ____   ____ _____ _  ____   ____  ____
                 |____] | ___/ |____| |       |   | |____  |____ |
                 |      |   \_ |    | |____   |   |  ____| |____ |____
                                   www.practisec.com

                      [recon-ng v5.1.2, Tim Tomes (@lanmaster53)]                       

[*] No modules enabled/installed.

[recon-ng][thmredteam] >  db insert domains
domain (TEXT): thmredteam.com
notes (TEXT): 
[*] 1 rows affected.
[recon-ng][thmredteam] > db schema

  +---------------+
  |    domains    |
  +---------------+
  | domain | TEXT |
  | notes  | TEXT |
  | module | TEXT |
  +---------------+


  +--------------------+
  |     companies      |
  +--------------------+
  | company     | TEXT |
  | description | TEXT |
  | notes       | TEXT |
  | module      | TEXT |
  +--------------------+


  +-----------------+
  |    netblocks    |
  +-----------------+
  | netblock | TEXT |
  | notes    | TEXT |
  | module   | TEXT |
  +-----------------+


  +-----------------------+
  |       locations       |
  +-----------------------+
  | latitude       | TEXT |
  | longitude      | TEXT |
  | street_address | TEXT |
  | notes          | TEXT |
  | module         | TEXT |
  +-----------------------+


  +---------------------+
  |   vulnerabilities   |
  +---------------------+
  | host         | TEXT |
  | reference    | TEXT |
  | example      | TEXT |
  | publish_date | TEXT |
  | category     | TEXT |
  | status       | TEXT |
  | notes        | TEXT |
  | module       | TEXT |
  +---------------------+


  +-------------------+
  |       ports       |
  +-------------------+
  | ip_address | TEXT |
  | host       | TEXT |
  | port       | TEXT |
  | protocol   | TEXT |
  | banner     | TEXT |
  | notes      | TEXT |
  | module     | TEXT |
  +-------------------+


  +-------------------+
  |       hosts       |
  +-------------------+
  | host       | TEXT |
  | ip_address | TEXT |
  | region     | TEXT |
  | country    | TEXT |
  | latitude   | TEXT |
  | longitude  | TEXT |
  | notes      | TEXT |
  | module     | TEXT |
  +-------------------+


  +--------------------+
  |      contacts      |
  +--------------------+
  | first_name  | TEXT |
  | middle_name | TEXT |
  | last_name   | TEXT |
  | email       | TEXT |
  | title       | TEXT |
  | region      | TEXT |
  | country     | TEXT |
  | phone       | TEXT |
  | notes       | TEXT |
  | module      | TEXT |
  +--------------------+


  +-----------------+
  |   credentials   |
  +-----------------+
  | username | TEXT |
  | password | TEXT |
  | hash     | TEXT |
  | type     | TEXT |
  | leak     | TEXT |
  | notes    | TEXT |
  | module   | TEXT |
  +-----------------+


  +-----------------------------+
  |            leaks            |
  +-----------------------------+
  | leak_id              | TEXT |
  | description          | TEXT |
  | source_refs          | TEXT |
  | leak_type            | TEXT |
  | title                | TEXT |
  | import_date          | TEXT |
  | leak_date            | TEXT |
  | attackers            | TEXT |
  | num_entries          | TEXT |
  | score                | TEXT |
  | num_domains_affected | TEXT |
  | attack_method        | TEXT |
  | target_industries    | TEXT |
  | password_hash        | TEXT |
  | password_type        | TEXT |
  | targets              | TEXT |
  | media_refs           | TEXT |
  | notes                | TEXT |
  | module               | TEXT |
  +-----------------------------+


  +---------------------+
  |       pushpins      |
  +---------------------+
  | source       | TEXT |
  | screen_name  | TEXT |
  | profile_name | TEXT |
  | profile_url  | TEXT |
  | media_url    | TEXT |
  | thumb_url    | TEXT |
  | message      | TEXT |
  | latitude     | TEXT |
  | longitude    | TEXT |
  | time         | TEXT |
  | notes        | TEXT |
  | module       | TEXT |
  +---------------------+


  +-----------------+
  |     profiles    |
  +-----------------+
  | username | TEXT |
  | resource | TEXT |
  | url      | TEXT |
  | category | TEXT |
  | notes    | TEXT |
  | module   | TEXT |
  +-----------------+


  +--------------------+
  |    repositories    |
  +--------------------+
  | name        | TEXT |
  | owner       | TEXT |
  | description | TEXT |
  | resource    | TEXT |
  | category    | TEXT |
  | url         | TEXT |
  | notes       | TEXT |
  | module      | TEXT |
  +--------------------+

[recon-ng][thmredteam] > db query select * from domains

  +---------------------------------------+
  |     domain     | notes |    module    |
  +---------------------------------------+
  | thmredteam.com |       | user_defined |
  +---------------------------------------+

[*] 1 rows returned

Recon-ng模块市场

  • 在Recon-ng中,我们已经有了一个目标域名,因此合乎逻辑的下一步是——搜索能够将域名转换为其他类型信息的模块。假设我们是从安装一个新的Recon-ng开始,我们接下来将从模块市场中寻找合适的模块。

  • 在使用marketplace安装模块之前,我们可以先了解下面这些与marketplace使用相关的命令语法:

    • marketplace search KEYWORD 使用关键字搜索可用的模块;

    • marketplace info MODULE 获取有关指定模块的相关信息;

    • marketplace install MODULE 将指定的模块安装到Recon-ng中;

    • marketplace remove MODULE 移除指定的模块。

  • 这些模块会被分为多个类别,例如发现(discovery)、导入(import)、侦察(recon)和报告(reporting)等;此外,根据信息转换类型的不同,recon模块还可被分为许多子类别。

    • tips:通过运行marketplace search命令,我们可获得一个包含所有可用模块的列表。
  • 在下面的终端示例中,我们将搜索包含domains-的模块。

pentester@TryHackMe$ recon-ng -w thmredteam
[...]
[recon-ng][thmredteam] > marketplace search domains-
[*] Searching module index for 'domains-'...

  +---------------------------------------------------------------------------------------------------+
  |                        Path                        | Version |     Status    |  Updated   | D | K |
  +---------------------------------------------------------------------------------------------------+
  | recon/domains-companies/censys_companies           | 2.0     | not installed | 2021-05-10 | * | * |
  | recon/domains-companies/pen                        | 1.1     | not installed | 2019-10-15 |   |   |
  | recon/domains-companies/whoxy_whois                | 1.1     | not installed | 2020-06-24 |   | * |
  | recon/domains-contacts/hunter_io                   | 1.3     | not installed | 2020-04-14 |   | * |
  | recon/domains-contacts/metacrawler                 | 1.1     | not installed | 2019-06-24 | * |   |
  | recon/domains-contacts/pen                         | 1.1     | not installed | 2019-10-15 |   |   |
  | recon/domains-contacts/pgp_search                  | 1.4     | not installed | 2019-10-16 |   |   |
  | recon/domains-contacts/whois_pocs                  | 1.0     | not installed | 2019-06-24 |   |   |
  | recon/domains-contacts/wikileaker                  | 1.0     | not installed | 2020-04-08 |   |   |
  | recon/domains-credentials/pwnedlist/account_creds  | 1.0     | not installed | 2019-06-24 | * | * |
  | recon/domains-credentials/pwnedlist/api_usage      | 1.0     | not installed | 2019-06-24 |   | * |
  | recon/domains-credentials/pwnedlist/domain_creds   | 1.0     | not installed | 2019-06-24 | * | * |
  | recon/domains-credentials/pwnedlist/domain_ispwned | 1.0     | not installed | 2019-06-24 |   | * |
  | recon/domains-credentials/pwnedlist/leak_lookup    | 1.0     | not installed | 2019-06-24 |   |   |
  | recon/domains-credentials/pwnedlist/leaks_dump     | 1.0     | not installed | 2019-06-24 |   | * |
  | recon/domains-domains/brute_suffix                 | 1.1     | not installed | 2020-05-17 |   |   |
  | recon/domains-hosts/binaryedge                     | 1.2     | not installed | 2020-06-18 |   | * |
  | recon/domains-hosts/bing_domain_api                | 1.0     | not installed | 2019-06-24 |   | * |
  | recon/domains-hosts/bing_domain_web                | 1.1     | not installed | 2019-07-04 |   |   |
  | recon/domains-hosts/brute_hosts                    | 1.0     | not installed | 2019-06-24 |   |   |
  | recon/domains-hosts/builtwith                      | 1.1     | not installed | 2021-08-24 |   | * |
  | recon/domains-hosts/censys_domain                  | 2.0     | not installed | 2021-05-10 | * | * |
  | recon/domains-hosts/certificate_transparency       | 1.2     | not installed | 2019-09-16 |   |   |
  | recon/domains-hosts/google_site_web                | 1.0     | not installed | 2019-06-24 |   |   |
  | recon/domains-hosts/hackertarget                   | 1.1     | not installed | 2020-05-17 |   |   |
  | recon/domains-hosts/mx_spf_ip                      | 1.0     | not installed | 2019-06-24 |   |   |
  | recon/domains-hosts/netcraft                       | 1.1     | not installed | 2020-02-05 |   |   |
  | recon/domains-hosts/shodan_hostname                | 1.1     | not installed | 2020-07-01 | * | * |
  | recon/domains-hosts/spyse_subdomains               | 1.1     | not installed | 2021-08-24 |   | * |
  | recon/domains-hosts/ssl_san                        | 1.0     | not installed | 2019-06-24 |   |   |
  | recon/domains-hosts/threatcrowd                    | 1.0     | not installed | 2019-06-24 |   |   |
  | recon/domains-hosts/threatminer                    | 1.0     | not installed | 2019-06-24 |   |   |
  | recon/domains-vulnerabilities/ghdb                 | 1.1     | not installed | 2019-06-26 |   |   |
  | recon/domains-vulnerabilities/xssed                | 1.1     | not installed | 2020-10-18 |   |   |
  +---------------------------------------------------------------------------------------------------+

  D = Has dependencies. See info for details.
  K = Requires keys. See info for details.

[recon-ng][thmredteam] >
  • 如上例所示,我们可以注意到在recon模块下有许多子类别,例如domains-companiesdomains-contactsdomains-hosts。这些子类别的命名方式能够告诉我们,我们将从相关的信息转换中得到什么样的新信息;例如,domain -hosts意味着使用该模块将找到与所提供的域相关的主机信息。

  • 有些模块,如whoxy_whois,还需要密钥才能使用,我们可以从上述示例中的K列下的*符号看出这一点,这个符号表明,除非我们有使用相关服务的密钥,否则该模块将变得不可用。

  • 如果其他模块有依赖关系,将会用D列下的*符号表示(参考上述示例);根据上例中的依赖项显示:使用相关模块可能需要第三方Python库。

  • 假设我们对recon/domains-hosts/google_site_web模块感兴趣,为了解该特定模块的更多信息,我们可使用marketplace info MODULE(这是用于解释某个模块功能的基本命令语法);例如,使用marketplace info google_site_web命令将提供以下描述:“通过使用 ‘site’搜索操作符从Google.com中获取主机信息,并用相关搜索结果来更新‘hosts’表。”换句话说,该模块将使用谷歌搜索引擎和“site”操作符来进行信息收集。

  • 通过使用marketplace install MODULE命令语法,我们可以安装我们想要的Recon-ng模块,例如marketplace install google_site_web命令。

使用已安装的模块

  • 我们可以通过以下命令来使用已安装的模块:

    • modules search :获取一个包含所有已安装模块的列表;

    • modules load MODULE :将指定模块加载到内存中。

  • 在开始使用模块之前,我们需要加载从模块市场中安装的模块(例如viewdns_reverse_whois),这可以通过使用modules load viewdns_reverse_whois命令来完成;此外,为了成功运行(run)该模块,我们还需要设置该模块所需的选项。

    • options list:列出我们可以为所加载的模块设置的选项;

    • options set <option> <value>:设置选项的值。

  • 在前文中,我们已经安装了模块google_site_web,所以让我们使用modules load google_site_web先加载它,然后使用run运行该模块。由于我们已经将目标域名thmredteam.com添加到了数据库中,因此当google_site_web模块运行时,它将从数据库中读取域名的值,并尝试获取新类型的信息,最后将依次把新信息添加到数据库中。相关命令和结果都显示在下面的终端输出示例中:

      pentester@TryHackMe$ recon-ng -w thmredteam
      [...]
      [recon-ng][thmredteam] > modules load google_site_web
      [recon-ng][thmredteam][google_site_web] > run
    
      --------------
      THMREDTEAM.COM
      --------------
      [*] Searching Google for: site:thmredteam.com
      [*] Country: None
      [*] Host: cafe.thmredteam.com
      [*] Ip_Address: None
      [*] Latitude: None
      [*] Longitude: None
      [*] Notes: None
      [*] Region: None
      [*] --------------------------------------------------
      [*] Country: None
      [*] Host: clinic.thmredteam.com
      [*] Ip_Address: None
      [*] Latitude: None
      [*] Longitude: None
      [*] Notes: None
      [*] Region: None
      [*] --------------------------------------------------
      [...]
      [*] 2 total (2 new) hosts found.
      [recon-ng][thmredteam][google_site_web] >
    
  • 以上示例中的模块,使用了谷歌查询并成功发现了两个和目标域名相关的主机cafe.thmredteam.comclinic.thmredteam.com。在我们实际执行上述示例步骤时,在查询结果中可能还会出现新的主机信息。

密钥

  • 有些模块如果没有对应服务API的密钥就不能使用,在我们搜索可用模块时,搜索结果中K列下的符号*可用于表示需要提供相关的服务密钥才能使用这个特定模块。

    • keys list 列出密钥;

    • keys add KEY_NAME KEY_VALUE 添加密钥;

    • keys remove KEY_NAME 移除密钥。

  • 一旦为特定模块安装好了密钥,我们就可以继续加载并运行这些模块:

    • modules load MODULE 加载已安装的某个模块;

    • CTRL + C 退出已加载的模块;

    • info查看已加载模块的相关信息;

    • options list 列出所选模块的可用选项;

    • options set NAME VALUE设置选项的值;

    • run执行已加载的模块。

练习

[recon-ng][thmredteam] > modules search

  Discovery
  ---------
    discovery/info_disclosure/cache_snoop
    discovery/info_disclosure/interesting_files

  Exploitation
  ------------
    exploitation/injection/command_injector
    exploitation/injection/xpath_bruter

  Import
  ------
    import/csv_file
    import/list
    import/masscan
    import/nmap

  Recon
  -----
    recon/companies-contacts/bing_linkedin_cache
    recon/companies-contacts/pen
    recon/companies-domains/censys_subdomains
    recon/companies-domains/pen
    recon/companies-domains/viewdns_reverse_whois
    recon/companies-domains/whoxy_dns
    recon/companies-multi/github_miner
    recon/companies-multi/shodan_org
    recon/companies-multi/whois_miner
    recon/contacts-contacts/abc
    recon/contacts-contacts/mailtester
    recon/contacts-contacts/mangle
    recon/contacts-contacts/unmangle
    recon/contacts-credentials/hibp_breach
    recon/contacts-credentials/hibp_paste
    recon/contacts-domains/migrate_contacts
    recon/contacts-profiles/fullcontact
    recon/credentials-credentials/adobe
    recon/credentials-credentials/bozocrack
    recon/credentials-credentials/hashes_org
    recon/domains-companies/pen
    recon/domains-companies/whoxy_whois
    recon/domains-contacts/hunter_io
    recon/domains-contacts/pen
    recon/domains-contacts/pgp_search
    recon/domains-contacts/whois_pocs
    recon/domains-contacts/wikileaker
    recon/domains-credentials/pwnedlist/api_usage
    recon/domains-credentials/pwnedlist/domain_ispwned
    recon/domains-credentials/pwnedlist/leak_lookup
    recon/domains-credentials/pwnedlist/leaks_dump

[recon-ng][thmredteam] > marketplace search virustotal
[*] Searching module index for 'virustotal'...

  +---------------------------------------------------------------------------------+
  |               Path               | Version |     Status    |  Updated   | D | K |
  +---------------------------------------------------------------------------------+
  | recon/hosts-hosts/virustotal     | 1.0     | not installed | 2019-06-24 |   | * |
  | recon/netblocks-hosts/virustotal | 1.0     | not installed | 2019-06-24 |   | * |
  +---------------------------------------------------------------------------------+

  D = Has dependencies. See info for details.
  K = Requires keys. See info for details.

[recon-ng][thmredteam] > marketplace search hosts-domains
[*] Searching module index for 'hosts-domains'...

  +----------------------------------------------------------------------------------+
  |                Path               | Version |     Status    |  Updated   | D | K |
  +----------------------------------------------------------------------------------+
  | recon/hosts-domains/migrate_hosts | 1.1     | not installed | 2020-05-17 |   |   |
  +----------------------------------------------------------------------------------+

  D = Has dependencies. See info for details.
  K = Requires keys. See info for details.

[recon-ng][thmredteam] > marketplace info censys_email_address

  +-----------------------------------------------------------------------------------------------------------------------------------+
  | path          | recon/companies-contacts/censys_email_address                                                                     |
  | name          | Censys emails by company                                                                                          |
  | author        | Censys Team                                                                                                       |
  | version       | 2.0                                                                                                               |
  | last_updated  | 2021-05-11                                                                                                        |
  | description   | Retrieves email addresses from the TLS certificates for a company. Updates the 'contacts' table with the results. |
  | required_keys | ['censysio_id', 'censysio_secret']                                                                                |
  | dependencies  | ['censys>=2.0.0']                                                                                                 |
  | files         | []                                                                                                                |
  | status        | disabled                                                                                                          |
  +-----------------------------------------------------------------------------------------------------------------------------------+

Maltego工具

  • Maltego是一款将思维导图与OSINT(开源情报)相结合的应用程序,在进行信息收集时,你一般会从目标的域名、公司名、邮箱地址等信息开始,然后让这些信息经过各种转换以得到新的信息。

  • 在Maltego中收集到的信息可用于渗透测试的后续阶段,例如,收集到的目标公司名称、相关联系人姓名和电子邮件地址等信息可用于创建看起来非常正规的网络钓鱼邮件。

  • 我们将Maltego图中的每个块都视为一个实体,一个实体可以用值来描述它。在Maltego的术语中,实现信息转换(Transform)的是一段代码,它将查询API以检索与特定实体相关的信息,这个过程的逻辑如下图所示,与实体相关的信息通过转换会返回零个或多个实体。

    Alt text

  • 必须指出的是,在Maltego中可用的一些转换(Transform)可能会主动连接到目标系统;因此,如果你想限制自己只使用被动侦察,那么最好在使用之前了解某个转换是如何工作的。

  • 每次转换(Transform)都可能产生几个新值,例如,如果我们从“DNS Name” cafe.thmredteam.com开始,我们期望根据我们所使用的转换(Transform)来获得新的信息实体类型。如果我们使用“To IP Address”,那么预计将返回和目标相关的IP地址信息实体,相关的逻辑如下图所示:

    • tips:DNS Name 指的是由DNS反向解析得到的域名。

    Alt text

  • 在Maltego上实现以上目标的一种方法是右键单击“DNS Name”输入cafe.thmredteam.com并选择:

    • Standard Transforms——标准转换;

    • Resolve to IP——解析IP地址;

    • To IP Address (DNS)——得到IP地址(DNS正向解析过程,由域名->IP)。

  • 实际执行此转换后,我们将获得一个或多个IP地址:

    Alt text

  • 然后我们还可以继续选择对上图结果中的某个IP地址应用另一个转换:

    • DNS from IP——基于IP进行DNS解析(即DNS反向解析,由IP->域名);

    • To DNS Name from passive DNS (Robtex)——基于被动DNS查询,得到DNS name(通过Robtex网站,它一个DNS在线查询网站)

    • tips:DNS Name 指的是由DNS反向解析得到的域名。

  • 这个转换将用新的DNS名称填充我们的查询结果,再单击几次,就可以获得IP地址的位置等信息,相关的结果可能如下图所示。

    Alt text

  • 上面的两个例子应该可以让你了解使用Maltego的工作流程。你可以观察到所有的工作都是基于转换(Transform)的,并且Maltego将帮助你保持信息图形的组织性。虽然通过查询不同的在线网站和数据库,你也会得到相同的结果;然而,只需点击几下,Maltego就可以更方便地帮助你获得所需的所有信息。

  • 我们在前文中了解了whois、nslookup等系统内置工具,使用这些工具,我们会得到目标IP地址、目标email地址等信息。我们使用whois和nslookup能得到的结果也可以显示在Maltego图中,此外,通过Maltego转换(Transform)还能够提取和排列从WHOIS数据库返回的信息,虽然由于隐私保护设置,在返回的信息中,我们可能无法得到某些有效的电子邮件地址,但还是值得看一下Maltego是如何提取这些信息以及如何呈现这些信息的。

    Alt text

  • 我们已经了解了Maltego是如何使用转换(Transform)来收集信息的,因此我们就可以通过添加新的转换(Transform)来使Maltego变得更强大。Maltego中的转换通常可以根据数据类型、定价和目标受众分成不同的类别,虽然我们可以通过Maltego Community Edition(社区版)来使用很多免费转换,但也有一些转换需要付费订阅才能使用。下面是一个截图,可以给你一个更清晰的概念。

    Alt text

  • Maltego需要激活才能使用,即使你选择的是Maltego CE(社区版)。为了使用该工具,我们可以在线访问Maltego Transform Hub或者在我们的本地系统上安装和激活Maltego CE(社区版)。

总结

  • 在本文中,我们学习了一些基本的系统内置工具,如whois、nslookup、dig和traceroute等,它们可用于被动侦察(信息收集);此外,我们还了解了高级搜索以及专门的搜索引擎的强大之处,它们可帮助我们进行被动侦察(信息收集)活动;最后,我们还展示了Recon-ng和Maltego这两种工具,它们允许我们从各种来源收集信息并将它们呈现出来。

  • 侦察(信息收集)活动的目的是为了扩展我们对于目标的了解,并且能够收集到那些可在随后的攻击阶段中会利用到的各种信息。例如,针对被发现的存活主机可以进行扫描和漏洞探测活动,而目标用户的联系信息和电子邮件地址可以被用来有效地发起网络钓鱼活动。简而言之,我们收集的目标信息越多,我们就越能改进红队的攻击策略,进而增加成功完成演练任务的机会。

Reference

Red Team Recon

Shodan命令行界面

关于RECON-NG相关问题解决

Data Sources in the Transform Hub