CVE漏洞中文网

0DayBank一个专门收集整理全球互联网漏洞的公开发布网站
  1. 首页
  2. 百科
  3. 正文

bus.61.com

2017年5月22日 784点热度 0人点赞 0条评论
  • 首页
  • 分类阅读
  • 文库
  • 专栏
  • 公开课
  • 商城
  • 漏洞盒子
注册 | 登录
投稿

web渗透信息侦察收集工具——Recon-ng

碳基体2013-02-21共304751人围观 ,发现 15 个不明物体WEB安全
在web渗透测试中,信息侦察与收集相当重要,每个经验丰富的黑客都有自己独特的信息收集妙招,曾有幸参加过大牛们的信息收集交流,点子都非常赞。在秉承黑站思路第一的前提下,能合理的利用现有的优秀工具也是不错的选择,起码对新手而言,可以扩充思路。现在就记录一下Recon-ng 这款较新的信息侦察收集工具的使用。

Recon-ng官方文档

一、安装
1.安装依赖文件dnspython,httplib2,python-0auth2
sudo pip install dnspython (也可以使用easy_install安装)
sudo pip install httplib2
git clone https://github.com/synedra/python-oauth2.git
cd python-oauth2/
sudo python setup.py install

2.安装recon-ng

git clone https://LaNMaSteR53@bitbucket.org/LaNMaSteR53/recon-ng.git

3.运行

cd recon-ng/ ./recon-ng.py 

二、使用

与MSF的使用方法非常类似,插播一下msf使用基础流程,唤起回忆

第一步:search name模块
第二步:use name模块
第三步:info 查看模块信息
第四步:show payloads 查看该模块可以使用的攻击载荷(为scanner的时候不需要)
第五步:set payload 载荷
第六步:show targets查看该攻击载荷使用的系统类型(为scanner的时候不需要)
第七步:set targets num 设置目标的系统类型
第八步:show options 查看需要设置的参数
show advanced 列出所有高级配置选项

mso-hansi-font-family:"Times New Roman";mso-fareast-language:ZH-CN;" >第九步:set name
mso-hansi-font-family:"Times New Roman";mso-fareast-language:ZH-CN;" >设置参数

mso-hansi-font-family:"Times New Roman";mso-fareast-language:ZH-CN;" >第十步:exploit
mso-hansi-font-family:"Times New Roman";mso-fareast-language:ZH-CN;" >(为scanner
"Times New Roman";mso-fareast-language:ZH-CN;" >时用run
"Times New Roman";mso-fareast-language:ZH-CN;" >)
第十一步:session –l –v列出所有可用的交互会话以及详细信息
1. 模块介绍

在使用该工具前,有必要提及一下信息收集的常规步骤,以便如何使用这款工具。信息收集分为三步:侦察Reconnaissance、发现Discovery与汇报reporting。这也对应了该工具的三个模块

recon-ng > show modules
(1). 侦察Reconnaissance

是一种被动的信息收集方式(passive reconnaissance),例如通过搜索引擎google hacker技巧收集目标的敏感信息

(2).发现Discovery

是一种主动的信息收集方式(active reconnaissance),例如通过发送http请求包探测web服务指纹

(3).汇报Reporting

Recon-ng提供两种格式的报表,html与csv

2. 模块使用范例

(1) web应用指纹识别

第一步:搜索指定模块

recon-ng > search whatweb
[*] Searching for 'whatweb'

Recon:
-------------------------------
recon/hosts/enum/http/whatweb

第二步:使用该模块

recon-ng > use recon/hosts/enum/http/whatweb 

第三步:查看模块信息

recon-ng [whatweb] > info

  Name:
    WhatWeb Web Technologies scan

  Author:
    thrapt (thrapt@gmail.com) and Tim Tomes (@LaNMaSteR53)

  Description:
    Leverages WhatWeb.net to recognise web technologies being used.

  Options:

    Name     Current Value  Req  Description
    -------  -------------  ---  -----------
    SOURCE   db             yes  source of module input
    VERBOSE  True           yes  verbose output

  Comments:
    Source options: [ db | <hostname> | ./path/to/file | query <sql> ]

第四步:设置选参数

recon-ng [whatweb] > set SOURCE resources.infosecinstitute.com
SOURCE => resources.infosecinstitute.com

第五步:运行

recon-ng [whatweb] > run

注意:如果出现 [!] <urlopen error timed out> 的错误提示,可以修改全局参数SOCKET_TIMEOUT

recon-ng [whatweb] > back
recon-ng > show options

Name Current Value Req Description
-------------- ------------- --- -----------
COMPANY no target company name
DB_FILE ./data/data.db yes path to main database file
DOMAIN no target domain
KEY_FILE ./data/keys.db yes path to API key database file
PROXY False yes proxy all requests
PROXY_SERVER 127.0.0.1:8080 yes proxy server
REC_FILE ./data/cmd.rc yes path to resource file for 'record'
SOCKET_TIMEOUT 10 yes socket timeout in seconds
USER-AGENT Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0) yes user-agent string
VERBOSE True yes verbose output

recon-ng > set SOCKET_TIMEOUT 20
SOCKET_TIMEOUT => 20
recon-ng > use recon/hosts/enum/http/whatweb
recon-ng [whatweb] > set SOURCE resources.infosecinstitute.com
SOURCE => resources.infosecinstitute.com
recon-ng [whatweb] > run

探测结果如下图所示

(2)公司职员信息收集

recon-ng > use recon/contacts/gather/http/jigsaw
recon-ng [jigsaw] > info

Name:
Jigsaw Contact Enumerator

Author:
Tim Tomes (@LaNMaSteR53)

Description:
Harvests contacts from Jigsaw.com. This module updates the 'contacts' table of the database with the
results.

Options:

Name Current Value Req Description
-------- ------------- --- -----------
COMPANY yes target company name
KEYWORDS no additional keywords to identify company
VERBOSE True yes verbose output

recon-ng [jigsaw] > set COMPANY google.com
recon-ng [jigsaw] > run

该模块是通过在搜索http://www.jigsaw.com/ 网站,收集公司组织架构信息,需要花费一段时间运行,你可以使用ctrl+c终止查询,搜索结果我们可以采用下面的方法导出来

recon-ng > use reporting/html_report
recon-ng [html_report] > info

  Name:
    HTML Report Generator

  Author:
    Tim Tomes (@LaNMaSteR53)

  Description:
    Creates a HTML report.

  Options:

    Name      Current Value        Req  Description
    --------  -------------        ---  -----------
    FILENAME  ./data/results.html  yes  path and filename for report output
    SANITIZE  True                 yes  mask sensitive data in the report

recon-ng [html_report] > set FILENAME /root/Desktop/result.html
FILENAME => /root/Desktop/result.html
recon-ng [html_report] > run
[*] Report generated at '/root/Desktop/result.html'.

我们打开result.html,可以看到收集到的以下信息

遗憾的是该模块使用的是http://www.jigsaw.com/网站中的信息,而国内网站基本没有收入进来,所以不适合做国内网站渗透信息收集。其实绝大多数好用的开源的被动的信息收集工具(passive reconnaissance)使用的信息源都不适合国内网站渗透信息收集,但可以参考这个思路,做一个国内版的。

(3)查看apache server-status页面是否可以访问
server-status页面会显示apache服务器的重要信息,如下图所示
recon-ng > use discovery/info_disclosure/http/server_status
recon-ng [server_status] > info

Name:
Apache Server-Status Page Scanner

Author:
Tim Tomes (@LaNMaSteR53)

Description:
Checks hosts for a 'server-status' page.

Options:

Name Current Value Req Description
------- ------------- --- -----------
SOURCE db yes source of module input
VERBOSE True yes verbose output

Comments:
Source options: [ db | <hostname> | ./path/to/file | query <sql> ]

http://blog.sucuri.net/2012/10/popular-sites-with-apache-server-status-enabled.html


http://httpd.apache.org/docs/2.2/mod/mod_status.html

Google dork: intitle:"Apache Status" inurl:"server-status"

recon-ng [server_status] > set SOURCE apache.org
SOURCE => apache.org
recon-ng [server_status] > run
recon-ng [server_status] > run
[*] http://apache.org/server-status/ => 200. Possible Apache Status page found!
[*] https://apache.org/server-status/ => 200. Possible Apache Status page found!
[*] 2 Server Status pages found.

(4) 域名信息收集

recon-ng > use recon/hosts/gather/http/yahoo

recon-ng [yahoo] > set DOMAIN qq.com
DOMAIN => qq.com
recon-ng [yahoo] > run

需要花费一段时间运行,可以使用ctrl+c终止查询,搜索结果同样可以采用html或csv的格式导出来,方法见 (2)公司职员信息收集

recon-ng [yahoo] > back
recon-ng > use reporting/html_report
recon-ng [html_report] > set FILENAME /Users/dani/Desktop/result_yahoo.html
FILENAME => /Users/dani/Desktop/result_yahoo.html

类似的域名搜索模块还有

recon/hosts/gather/http/netcraft
recon/hosts/gather/http/baidu
recon/hosts/gather/http/bing
recon/hosts/gather/http/google
(5)服务器指纹
recon-ng > use recon/hosts/enum/http/server_enum
recon-ng [server_enum] > set host apache.org
HOST => apache.org
recon-ng [server_enum] > run
----------------------START-----------------------
[*] ORIG_URL: http://apache.org
[*] DEST_URL: http://apache.org
---------------------HEADERS----------------------
[*] CONTENT-LENGTH: 36028
[*] ACCEPT-RANGES: bytes
[*] EXPIRES: Tue, 19 Feb 2013 16:49:39 GMT
[*] VARY: Accept-Encoding
[*] SERVER: Apache/2.4.3 (Unix) OpenSSL/1.0.0g
[*] LAST-MODIFIED: Tue, 19 Feb 2013 15:10:23 GMT
[*] CONNECTION: close
[*] ETAG: "8cbc-4d6153d9bb79e"
[*] CACHE-CONTROL: max-age=3600
[*] DATE: Tue, 19 Feb 2013 15:49:39 GMT
[*] CONTENT-TYPE: text/html; charset=utf-8
---------------------COOKIES----------------------
--------------------META TAGS---------------------
-----------------------END------------------------

  +------------------------------------------------------+
  | SERVER | Apache/2.4.3 (Unix) OpenSSL/1.0.0g | Apache |
  | ERROR  | 404 (/jxahqyevew.nsa)              | Apache |
  +------------------------------------------------------+

(6) 查找robots.txt
详细的robots.txt会暴露敏感路径

recon-ng > use discovery/info_disclosure/http/robots

recon-ng [robots] > set SOURCE bus.61.com
SOURCE => bus.61.com
recon-ng [robots] > run
[*] http://bus.61.com/robots.txt => 200. robots.txt found!
[*] http://bus.61.com/sitemap.xml => 404
[*] http://bus.61.com/sitemap.xml.gz => 403
[*] https://bus.61.com/robots.txt => Error
[*] https://bus.61.com/sitemap.xml => Error
[*] https://bus.61.com/sitemap.xml.gz => Error
[*] 1 files found.

参考资料:

https://bitbucket.org/LaNMaSteR53/recon-ng/wiki/Home

http://resources.infosecinstitute.com/awesome-modules-of-recon-ng-used-for-web-recon-testing/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+infosecResources+%28InfoSec+Resources%29

http://resources.infosecinstitute.com/awesome-modules-of-recon-ng-used-for-web-recon-testing/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+infosecResources+%28InfoSec+Resources%29

碳基体

碳基体27 篇文章等级: 5级
|
|
  • 上一篇:ecshop最新注入0day分析报告
  • 下一篇:AuthTrans(原创工具)+BurpSuite的暴力美学-破解Http Basic认证

这些评论亮了

  • lonelyking回复
    你以后的男朋友 应该会很痛苦
    )29(亮了
  • laowang回复
    @lonelyking 我是妹子的男朋友,我是挺痛苦的。我用诺基亚1100,大家感受下。
    )12(亮了
  • jack(3级)回复
    @laowang 贼秃,敢和贫道抢师太
    )7(亮了
发表评论

已有 15 条评论

  • laozhang 2013-02-21回复1楼

    判断服务器版本我用nmap,判断应用用老外的东东会水土不服吧

    亮了(2)
  • lonelyking 2013-02-21回复2楼

    你以后的男朋友 应该会很痛苦

    亮了(29)
    • jerry 2013-02-21回复

      @lonelyking 其实人家现在就有男朋友~

      亮了(1)
    • laowang 2013-02-21回复

      @lonelyking 我是妹子的男朋友,我是挺痛苦的。我用诺基亚1100,大家感受下。

      亮了(12)
      • jack (3级) 2013-02-21回复

        @laowang 贼秃,敢和贫道抢师太

        亮了(7)
  • 謝文東的围脖 2013-02-21回复3楼

    快来捉坏人啊

    亮了(0)
  • 謝文東的围脖 2013-02-21回复4楼

    快来捉坏人啊

    亮了(0)
  • webtester629 2013-02-25回复5楼

    工具还行,但感觉不是太好用

    亮了(0)
  • netorgcom (4级) 2013-02-26回复6楼

    呵呵 试试

    亮了(0)
  • L1well (1级)PKAV.NET,誓与AV抢宅男! 2013-03-10回复7楼

    功能很强大,很多国外的工具用到国内就感觉没那么实用。

    亮了(1)
  • Drayce (1级) 2013-03-14回复8楼

    试试

    亮了(0)
  • rosuremember (1级) 2015-01-09回复9楼

    run以后显示 No data returned for ‘resources.infosecinstitute.com’

    什么原因?

    亮了(0)
  • jacksonmike (1级) 2015-09-25回复10楼

    hi,为啥我今天刚装的没有找到whatweb的模块 :arrow:

    亮了(0)
    • firecatzkj (1级) 2016-04-25回复

      @ jacksonmike  我也找不到,不知道为啥

      亮了(0)
      • sungod (1级) 2017-02-26回复

        @ firecatzkj  现在工具版本早就升级了,本文提到的功能基本没了

        亮了(0)

必须您当前尚未登录。登陆?注册

必须(保密)

表情插图

取消

碳基体

碳基体

混迹于安全圈的萌妹子

27 篇文章12 条评论

相关阅读

  • CrackMapExec:Windows活动目录(AD)渗透测试工具集
  • Play框架的XML Entity Exploit
  • 域内特定目标渗透测试方法概要
  • [科普]渗透神器Kali安装使用手册
  • 渗透测试中利用基于时间差反馈的远程代码执行漏洞(Timed Based RCE)进行数据获取

特别推荐

关注我们 分享每日精选文章

不容错过

  • 打造一个自动检测页面是否存在XSS的小插件ⅠBlack-Hole2015-08-12
  • 如何通过WIFI渗透企业内网?felix2016-05-24
  • Linux下密码抓取神器mimipenguin发布zusheng2017-04-06
  • 子域名搜集思路与技巧梳理NSRC2016-10-20

FREEBUF

  • 免责声明
  • 关于我们
  • 加入我们

广告及服务

  • 寻求报道
  • 广告合作
  • 联系我们
  • 友情链接

关注我们

  • 官方微信
  • 新浪微博
  • 腾讯微博
  • Twitter

赞助商

Copyright © 2013 WWW.FREEBUF.COM All Rights Reserved 沪ICP备13033796号

css.php

正在加载中...

0day

标签: 暂无
最后更新:2017年5月22日

小助手

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

您需要 登录 之后才可以评论

COPYRIGHT © 2024 www.pdr.cn CVE漏洞中文网. ALL RIGHTS RESERVED.

鲁ICP备2022031030号

联系邮箱:wpbgssyubnmsxxxkkk@proton.me