渗透攻击之情报收集

1.情报搜集技术

渗透测试中情报搜集工作有两个方面的任务:
  • [ ] 通过信息搜集工作,确定渗透测试目标的范围;
  • [ ] 发现渗透目标的安全漏洞和脆弱点,为后续渗透攻击打下基础。

1.1外围信息收集

1.1.1通过DNS和IP地址挖掘目标网络信息

  • whois 域名注册信息查询
msf>whois testfire.net
[*] exec: whois testfire.net

   Domain Name: TESTFIRE.NET
   Registry Domain ID: 8363973_DOMAIN_NET-VRSN
   Registrar WHOIS Server: whois.corporatedomains.com
   Registrar URL: http://www.cscglobal.com/global/web/csc/digital-brand-services.html
   Updated Date: 2017-07-19T05:16:54Z
   Creation Date: 1999-07-23T13:52:32Z
   Registry Expiry Date: 2018-07-23T13:52:32Z
   Registrar: CSC Corporate Domains, Inc.
   Registrar IANA ID: 299
   Registrar Abuse Contact Email: domainabuse@cscglobal.com
   Registrar Abuse Contact Phone: 8887802723
   Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
   Name Server: ASIA3.AKAM.NET
   Name Server: EUR2.AKAM.NET
   Name Server: EUR5.AKAM.NET
   Name Server: NS1-206.AKAM.NET
   Name Server: NS1-99.AKAM.NET
   Name Server: USC2.AKAM.NET
   Name Server: USC3.AKAM.NET
   Name Server: USW2.AKAM.NET
   DNSSEC: unsigned
   URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
>>> Last update of whois database: 2018-05-22T00:21:34Z <<<

提示 进行whois 查询时去掉www、ftp等前缀。

  • nslookup 与 dig 域名查询
root@bt:~# nslookup
> set type=A
> testfire.net
Server:     10.10.10.2
Address:    10.10.10.2#53

Non-authoritative answer:
Name:   testfire.net
Address: 65.61.137.117
>exit

提示 set type=A 对其ip地址进行解析,set type=MX 来查找其邮件转发,有些DNS服务器开放了区域传送,可以在nslookup中使用ls -d example.com 来查看其所有的DNS 记录,这些信息往往暴露大量网络内部拓扑消息。

root@bt:~# dig @ASIA3.AKAM.NET testfire.net

; <<>> DiG 9.7.0-P1 <<>> @ASIA3.AKAM.NET testfire.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51070
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;testfire.net.          IN  A

;; ANSWER SECTION:
testfire.net.       86400   IN  A   65.61.137.117

;; Query time: 236 msec
;; SERVER: 23.211.61.64#53(23.211.61.64)
;; WHEN: Mon May 21 20:22:54 2018
;; MSG SIZE  rcvd: 46

提示 dig 命令基本使用方法,

:dig @DNS服务器 待查询域名
  • IP2Location 地理位置查询

查询国外ip:(收费)

查询国内ip: (免费)

  • netcraft 网站提供信息查询服务

进入查询网站

  • IP2Domain 反查域名

国外反查域名

国内反查域名

提示 有一些网站共用一台服务器,可以通过其他网站的漏洞获取服务器访问控制权,进而迂回获取渗透攻击的权限。这种攻击技术成为“旁注”

1.1.2 通过搜索引擎进行信息搜集

  • Google Hacking 技术

SiteDigger 集成了FSDB(Foundstone Signature Database) 和 GHDB(Google Hacking DataBase) 的自动搜索功能。

Search Diggity 使用它不仅能够搜索字符串进行自动探测,还可以对源代码、恶意软件进行分析。

提示 SiteDigger 和 Search Diggity 都是Windows应用程序,由于Google Api 搜索次数限制,每次只选取只对感兴趣项目进行检索。

  • 探索网站的目录结构
    百度搜索 输入 parent directory site:testfire.net,打开第一个链接,网站的bank目录一览无余,在浏览网站目录,应对下面几类文件进行特别留意:
    • [ ] 扩展名为.inc 的文件,可能包含网站的配置信息,如数据库用户名/口令等。
    • [ ] 扩展名为.bak的文件,通常是文本编辑器在编辑源代码后留下的备份文件,可以让你知道与其对应的程序脚本文件中大致内容。
    • [ ] 扩展名为.txt或.sql 的文件, 一般包括网站运行sql脚本,可能会透漏类似数据库结构等信息。

类似工作可以metasploit中的brute_dirs、 dir_listing、 dir_scanner等辅助模块来完成,它们主要是暴力破解的方式工作。

msf > use auxiliary/scanner/http/dir_scanner 
msf auxiliary(dir_scanner) > set THREADS 50
THREADS => 50
msf auxiliary(dir_scanner) > set RHOSTS www.testfire.net
RHOSTS => www.testfire.net
msf auxiliary(dir_scanner) > exploit

[*] Detecting error code
[*] Using code '404' as not found for 65.61.137.117
[*] Error: 65.61.137.117: ActiveRecord::RecordInvalid Validation failed: Pname can't be blank
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(dir_scanner) > exit

提示 这里并没有发现隐藏目录

  • 检索特定类型的文件
使用Google Hacking 技术搜索某网站的xls文件

比如在百度搜索 输入site:sdu.edu.cn filetype:xls 就可以得到一些xls文件。

  • 搜素网站的E-mail地址

使用metasploit的一个辅助模块search_email_collector,进行有针对性邮件地址收集。

  • 搜索易存在SQL注入点的页面

百度搜索 输入site:testfire.net inurl:login ,得到其后台登录url。

Username:admin 'OR'1 
Password:test 'OR'1

上面是通过SQL注入绕过testfire网站登录验证逻辑进入后台管理界面。

转载于:https://www.cnblogs.com/fwb-hack/p/9108127.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Preface Audience for This Book Organization What's New in This Edition Example Programs Using Code Examples Conventions Used in This Book Comments and Questions Safari® Enabled Acknowledgments for the Second Edition Acknowledgments for the First Edition Chapter 1. Introduction to SNMP and Network Management Section 1.1. What Is SNMP? Section 1.2. The Concept of Network Management Section 1.3. Applying the Concepts of Network Management Section 1.4. Change Management Section 1.5. Getting More Information Chapter 2. SNMPv1 and SNMPv2 Section 2.1. SNMP and UDP Section 2.2. SNMP Communities Section 2.3. The Structure of Management Information Section 2.4. Extensions to the SMI in Version 2 Section 2.5. A Closer Look at MIB-II Section 2.6. SNMP Operations Section 2.7. Host Management Revisited Section 2.8. Remote Monitoring Revisited Section 2.9. Reverse Engineering SNMP Chapter 3. SNMPv3 Section 3.1. Changes in SNMPv3 Section 3.2. USM Section 3.3. VACM Section 3.4. SNMPv3 in the Real World Chapter 4. NMS Architectures Section 4.1. Hardware Considerations Section 4.2. NMS Architectures Section 4.3. A Look Ahead Chapter 5. Configuring Your NMS Section 5.1. HP's OpenView Network Node Manager Section 5.2. Castle Rock's SNMPc Enterprise Edition Chapter 6. Configuring SNMP Agents Section 6.1. Parameter Settings Section 6.2. Security Concerns Section 6.3. Agent Configuration Walkthroughs Chapter 7. Polling and Setting Section 7.1. Retrieving a Single MIB Value Section 7.2. Retrieving Multiple MIB Values Section 7.3. Setting a MIB Value Section 7.4. Error Responses Chapter 8. Polling and Thresholds Section 8.1. Internal Polling Section 8.2. External Polling Chapter 9. Traps Section 9.1. Understanding Traps Section 9.2. Receiving Traps Section 9.3. Sending Traps Chapter 10. Extensible SNMP Agents Section 10.1. Net-SNMP Section 10.2. SystemEDGE Section 10.3. OpenView's Extensible Agent Chapter 11. Adapting SNMP to Fit Your Environment Section 11.1. General Trap-Generation Program Section 11.2. Who's Logging into My Machine? (I-Am-In) Section 11.3. Throw Core Section 11.4. Veritas Disk Check Section 11.5. Disk-Space Checker Section 11.6. Port Monitor Section 11.7. Service Monitoring Section 11.8. Pinging with Cisco Section 11.9. Simple SNMP Agent Section 11.10. Switch Port Control Section 11.11. Wireless Networking Section 11.12. SNMP: The Object-Oriented Way Section 11.13. Final Words Chapter 12. MRTG Section 12.1. Using MRTG Section 12.2. Viewing Graphs Section 12.3. Graphing Other Objects Section 12.4. Other Data-Gathering Applications Section 12.5. Pitfalls Section 12.6. Getting Help Chapter 13. RRDtool and Cricket Section 13.1. RRDtool Section 13.2. Cricket Chapter 14. Java and SNMP Section 14.1. SNMP4J Section 14.2. SNMP getnext Section 14.3. SNMP set Section 14.4. Sending Traps and Informs Section 14.5. Receiving Traps and Informs Section 14.6. Resources Appendix A. Using Input and Output Octets Appendix B. More on OpenView's NNM Section B.1. Using External Data Section B.2. Adding a Menu to NNM Section B.3. Profiles for Different Users Section B.4. Using NNM for Communications Appendix C. Net-SNMP Tools Section C.1. Net-SNMP and MIB Files Section C.2. Common Command-Line Arguments Section C.3. Net-SNMP Command-Line Tools Appendix D. SNMP RFCs Section D.1. SMIv1 Data Definition Language Section D.2. SMIv2 Data Definition Language Section D.3. SNMPv3 Protocol Section D.4. SNMP Agent Extensibility Section D.5. SMIv1 MIB Modules Section D.6. SMIv2 MIB Modules Section D.7. IANA-Maintained MIB Modules Section D.8. Related Documents Appendix E. SNMP Support for Perl Section E.1. SNMP_Util Section E.2. Net-SNMP Appendix F. Network Management Software Section F.1. SNMP Agents Section F.2. NMS Suites Section F.3. Element Managers (Vendor-Specific Management) Section F.4. Trend Analysis Section F.5. Supporting Software Appendix G. Open Source Monitoring Software Section G-1. Big Brother Section G-2. Nagios Section G-3. JFFNMS Section G-4. OpenNMS Section G-5. NINO Appendix H. Network Troubleshooting Primer Section H-1. ping Section H-2. ipconfig and ifconfig Section H-3. arp Section H-4. netstat Section H-5. traceroute and tracert Section H-6. nslookup and dig Section H-7. whois Section H-8. Ethereal About the Authors Colophon Index
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值