热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

WMAP

https:www.cnblogs.comcomdodop5324492.htmlWMap是一个集成于Metasploit框架中用于测试Web脆弱性的工具,在使用之

https://www.cnblogs.com/comdodo/p/5324492.html

WMap是一个集成于Metasploit框架中用于测试Web脆弱性的工具,在使用之前,你需要先创建一个数据库连接用于存放扫描的数据、结果,然后加载wmap插件,当你不清楚命令有哪些时,可以使用help命令进行查看帮助。

msf > load wmap

.-.-.-..-.-.-..—..—.

| | | || | | || | || |-‘

-----'-‘-‘-‘-^-'-‘

[WMAP 1.5.1] ===  et [  ] metasploit.com 2012

[*]Successfully loaded plugin: wmap

msf > help

wmap Commands

=============

    Command       Description

    ——-       ———–

    wmap_modules  Manage wmap modules

    wmap_nodes    Manage nodes

    wmap_run      Test targets

    wmap_sites    Manage sites

    wmap_targets  Manage targets

    wmap_vulns    Display web vulns

…snip…


在真正运行扫描之前,需要先使用wmap_sites的-a选项添加一个URL进行扫描,添加了之后你可以使用wmap_sites -l命令查看可用的目标。

msf > wmap_sites -h

[*]  Usage: wmap_targets [options]

    -h        Display this help text

    -a [url]  Add site (vhost,url)

    -l        List all available sites

    -s [id]   Display site structure (vhost,url|ids) (level)

msf > wmap_sites -a http://172.16.194.172

[*] Site created.

msf > wmap_sites -l

[*] Available sites

===============

     Id  Host            Vhost           Port  Proto  # Pages  # Forms

     —  —-            —–           —-  —–  ——-  ——-

     0   172.16.194.172  172.16.194.172  80    http   0        0

然后,将站点添加到“目标”中去,使用wmap_targets命令的-t选项;

msf > wmap_targets -h

[*]Usage: wmap_targets [options]

    -h         Display this help text

    -t [urls]    Define target sites (vhost1,url[space]vhost2,url)

    -d [ids]    Define target sites (id1, id2, id3 …)

    -c         Clean target sites list

    -l          List all target sites

msf > wmap_targets -t http://172.16.194.172/mutillidae/index.php


Once added, we can view our list of targets by using the ‘-l’ switch from the console. 
 

msf > wmap_targets -l

[*] Defined targets

===============

     Id  Vhost           Host            Port  SSL    Path

     —  —–           —-            —-  —    —-

     0   172.16.194.172  172.16.194.172  80    false    /mutillidae/index.php


Using the “wmap_run” command will scan the target system. 
 

msf > wmap_run -h

[*]Usage: wmap_run [options]

    -h                        Display this help text

    -t                        Show all enabled modules

    -m [regex]                Launch only modules that name match provided regex.

    -p [regex]                Only test path defined by regex.

    -e [/path/to/profile]     Launch profile modules against all matched targets.

                              (No profile file runs all enabled modules.)


We first using the “-t” switch to list the modules that will be used to scan the remote system. (使用 wmap_run -l 命令可以列出我们将要使用的扫描模块!)
 

msf > wmap_run -t

[*] Testing target:

[*]     Site: 192.168.1.100 (192.168.1.100)

[*]     Port: 80 SSL: false

[*] ============================================================

[*] Testing started. 2012-01-16 15:46:42 -0500

[*] =[ SSL testing ]=

[*] ============================================================

[*] Target is not SSL. SSL modules disabled.

[*] =[ Web Server testing ]=

[*] ============================================================[*] Loaded auxiliary/admin/http/contentkeeper_fileaccess …[*] Loaded auxiliary/admin/http/tomcat_administration …[*]Loaded auxiliary/admin/http/tomcat_utf8_traversal …[*] Loaded auxiliary/admin/http/trendmicro_dlp_traversal …

..snip…

msf >


All that remains now is to actually run the scan against our target URL. 
 

msf > wmap_run -e

[*] Using ALL wmap enabled modules.

[-] NO WMAP NODES DEFINED. Executing local modules

[*] Testing target:

[*]     Site: 172.16.194.172 (172.16.194.172)

[*]     Port: 80 SSL: false

============================================================

[*] Testing started. 2012-06-27 09:29:13 -0400

[*] =[ SSL testing ]=

============================================================

[*] Target is not SSL. SSL modules disabled.

[*] =[ Web Server testing ]=

============================================================

[*] Module auxiliary/scanner/http/http_version

[*] 172.16.194.172:80 Apache/2.2.8 (Ubuntu) DAV/2 ( Powered by PHP/5.2.4-2ubuntu5.10 )

[*] Module auxiliary/scanner/http/open_proxy

[*] Module auxiliary/scanner/http/robots_txt

..snip…..snip…..snip…

[*] Module auxiliary/scanner/http/soap_xml

[*] Path: /

[*] Server 172.16.194.172:80 returned HTTP 404 for /.  Use a different one.

[*] Module auxiliary/scanner/http/trace_axd

[*] Path: /

[*] Module auxiliary/scanner/http/verb_auth_bypass

[*]

=[ Unique Query testing ]=

============================================================

[*] Module auxiliary/scanner/http/blind_sql_query

[*] Module auxiliary/scanner/http/error_sql_injection

[*] Module auxiliary/scanner/http/http_traversal

[*] Module auxiliary/scanner/http/rails_mass_assignment

[*] Module exploit/multi/http/lcms_php_exec

[*]

=[ Query testing ]=

============================================================

[*]

=[ General testing ]=

============================================================

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Launch completed in 212.01512002944946 seconds.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[*]

Done.


在扫描执行完了之后,我们可以查看一下数据库中是否存在一些可用的东西—漏洞!

msf > wmap_vulns -l

[*] + [172.16.194.172] (172.16.194.172): scraper /

[*]     scraper Scraper

[*]     GET Metasploitable2 – Linux

[*] + [172.16.194.172] (172.16.194.172): directory /dav/

[*]     directory Directory found.

[*]     GET Res code: 200

[*] + [172.16.194.172] (172.16.194.172): directory /cgi-bin/

[*]     directory Directoy found.

[*]     GET Res code: 403

…snip…

msf >


可以使用 vulns 命令可以查看更详细的信息!
 

msf > vulns

[*]Time: 2012-01-16 20:58:49 UTC Vuln: host=172.16.2.207 port=80 proto=tcp name=auxiliary/scanner/http/options refs=CVE-2005-3398,CVE-2005-3498,OSVDB-877,BID-11604,BID-9506,BID-9561

We can now use this information to gather further information on the reported vulnerability. As pentesters, we would want to investigate each finding further and identify if there are potential methods for attack.

来源: 


总结一下使用wmap的具体步骤:

 

  • 进入Metasploit(在这之前最好先运行:service postgresql start && service metasploit start 命令开启这两个基础服务);
  • 然后连接数据库(db_connect){其实应该是默认连接的,但是估计是因为我之前没有注意,在哪个地方翻了个错误,导致后来都得手动连接};
  • 之后加载wmap插件(load wmap);
  • 添加站点:wmap_sites -a URL
  • 列为目标:wmap_targets -t URL
  • 先是将要执行的扫描模块:wmap_run -t
  • 执行扫描:wmap_run -e
  • 在扫描完成之后显示是否存在可利用漏洞:wmap_vulns -l(若要查看更详细的信息,则使用vulns命令)


msf > load wmap

.-.-.-..-.-.-..—..—.

| | | || | | || | || |-‘

-----'-‘-‘-‘-^-'-‘

[WMAP 1.5.1] ===  et [  ] metasploit.com 2012

[*] Successfully loaded plugin: wmap

msf > help

wmap Commands

=============

    Command       Description

    ——-       ———–

    wmap_modules  Manage wmap modules

    wmap_nodes    Manage nodes

    wmap_run      Test targets

    wmap_sites    Manage sites

    wmap_targets  Manage targets

    wmap_vulns    Display web vulns

Core Commands

=============

    Command       Description

    ——-       ———–

    ?             Help menu

    back          Move back from the current context

    banner        Display an awesome metasploit banner

    cd            Change the current working directory

    color         Toggle color

    connect       Communicate with a host

    exit          Exit the console

    go_pro        Launch Metasploit web GUI

    grep          Grep the output of another command

    help          Help menu

    info          Displays information about one or more module

    irb           Drop into irb scripting mode

    jobs          Displays and manages jobs

    kill          Kill a job

    load          Load a framework plugin

    loadpath      Searches for and loads modules from a path

    makerc        Save commands entered since start to a file

    popm          Pops the latest module off the stack and makes it active

    previous      Sets the previously loaded module as the current module

    pushm         Pushes the active or list of modules onto the module stack

    quit          Exit the console

    reload_all    Reloads all modules from all defined module paths

    resource      Run the commands stored in a file

    route         Route traffic through a session

    save          Saves the active datastores

    search        Searches module names and descriptions

    sessions      Dump session listings and display information about sessions

    set           Sets a variable to a value

    setg          Sets a global variable to a value

    show          Displays modules of a given type, or all modules

    sleep         Do nothing for the specified number of seconds

    spool         Write console output into a file as well the screen

    threads       View and manipulate background threads

    unload        Unload a framework plugin

    unset         Unsets one or more variables

    unsetg        Unsets one or more global variables

    use           Selects a module by name

    version       Show the framework and console library version numbers

Database Backend Commands

=========================

    Command           Description

    ——-           ———–

    creds             List all credentials in the database

    db_connect        Connect to an existing database

    db_disconnect     Disconnect from the current database instance

    db_export         Export a file containing the contents of the database

    db_import         Import a scan result file (filetype will be auto-detected)

    db_nmap           Executes nmap and records the output automatically

    db_rebuild_cache  Rebuilds the database-stored module cache

    db_status         Show the current database status

    hosts             List all hosts in the database

    loot              List all loot in the database

    notes             List all notes in the database

    services          List all services in the database

    vulns             List all vulnerabilities in the database

    workspace         Switch between database workspaces

msf > wmap_

wmap_modules  wmap_nodes    wmap_run      wmap_sites    wmap_targets  wmap_vulns   

msf > wmap_sites -a http://www.dvssc.com/

[-] Unable to create site

msf > wmap_sites -a 10.10.10.129

[-] Unable to create site

msf > wmap_sites -a http://10.10.10.129

[-] Unable to create site

msf > wmap_sites -a http://210.21.21.21

[-] Unable to create site

msf > wmap_sites -a http://210.21.21.21/

[-] Unable to create site

msf > wmap_sites -h

[*] Usage: wmap_sites [options]

   -h        Display this help text

   -a [url]  Add site (vhost,url)

   -d [ids]  Delete sites (separate ids with space)

   -l        List all available sites

   -s [id]   Display site structure (vhost,url|ids) (level)

所以,总的来说wmap的利用流程就是:

  wmap_sites -a http://192.168.10.11

  wmap_sites -l

  wmap_targets -t http://192.168.10.11/mutillidae/index.php

  wmap_targets -t

  wmap_run -t

  wmap_run -e


推荐阅读
  • 1,关于死锁的理解死锁,我们可以简单的理解为是两个线程同时使用同一资源,两个线程又得不到相应的资源而造成永无相互等待的情况。 2,模拟死锁背景介绍:我们创建一个朋友 ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • 标题: ... [详细]
  • 本文介绍了pack布局管理器在Perl/Tk中的使用方法及注意事项。通过调用pack()方法,可以控制部件在显示窗口中的位置和大小。同时,本文还提到了在使用pack布局管理器时,应注意将部件分组以便在水平和垂直方向上进行堆放。此外,还介绍了使用Frame部件或Toplevel部件来组织部件在窗口内的方法。最后,本文强调了在使用pack布局管理器时,应避免在中间切换到grid布局管理器,以免造成混乱。 ... [详细]
  • 本文分享了一个关于在C#中使用异步代码的问题,作者在控制台中运行时代码正常工作,但在Windows窗体中却无法正常工作。作者尝试搜索局域网上的主机,但在窗体中计数器没有减少。文章提供了相关的代码和解决思路。 ... [详细]
  • 本文介绍了使用PHP实现断点续传乱序合并文件的方法和源码。由于网络原因,文件需要分割成多个部分发送,因此无法按顺序接收。文章中提供了merge2.php的源码,通过使用shuffle函数打乱文件读取顺序,实现了乱序合并文件的功能。同时,还介绍了filesize、glob、unlink、fopen等相关函数的使用。阅读本文可以了解如何使用PHP实现断点续传乱序合并文件的具体步骤。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • PHP中的单例模式与静态变量的区别及使用方法
    本文介绍了PHP中的单例模式与静态变量的区别及使用方法。在PHP中,静态变量的存活周期仅仅是每次PHP的会话周期,与Java、C++不同。静态变量在PHP中的作用域仅限于当前文件内,在函数或类中可以传递变量。本文还通过示例代码解释了静态变量在函数和类中的使用方法,并说明了静态变量的生命周期与结构体的生命周期相关联。同时,本文还介绍了静态变量在类中的使用方法,并通过示例代码展示了如何在类中使用静态变量。 ... [详细]
  • 后台获取视图对应的字符串
    1.帮助类后台获取视图对应的字符串publicclassViewHelper{将View输出为字符串(注:不会执行对应的ac ... [详细]
  • Iamtryingtocreateanarrayofstructinstanceslikethis:我试图创建一个这样的struct实例数组:letinstallers: ... [详细]
  • Ihaveaworkfolderdirectory.我有一个工作文件夹目录。holderDir.glob(*)>holder[ProjectOne, ... [详细]
  • python3 nmap函数简介及使用方法
    本文介绍了python3 nmap函数的简介及使用方法,python-nmap是一个使用nmap进行端口扫描的python库,它可以生成nmap扫描报告,并帮助系统管理员进行自动化扫描任务和生成报告。同时,它也支持nmap脚本输出。文章详细介绍了python-nmap的几个py文件的功能和用途,包括__init__.py、nmap.py和test.py。__init__.py主要导入基本信息,nmap.py用于调用nmap的功能进行扫描,test.py用于测试是否可以利用nmap的扫描功能。 ... [详细]
  • Python中的PyInputPlus模块原文:https ... [详细]
  • 精讲代理设计模式
    代理设计模式为其他对象提供一种代理以控制对这个对象的访问。代理模式实现原理代理模式主要包含三个角色,即抽象主题角色(Subject)、委托类角色(被代理角色ÿ ... [详细]
author-avatar
baiwei001
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有