打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
whatweb的命令使用
TARGET SELECTION(目标选择)
1、 --input-file=FILE或-i /dev/stdin  验证文件里的url地址
whatweb --input-file urlfile /dev/stdin或whatweb --input-file=urlfile /dev/stdin输出如下结果:
 
2、给url地址加上前缀 例如:
whatweb .com不加前缀 不能访问
 
加上前缀:whatweb –url-prefix http://www.baidu .com
 
3、给url添加后缀
whatweb --url-suffix .com http://www.baidu
4、--url-pattern 需要和 –inpur-file 配合使用
whatweb -i target.txt --url-pattern www.%insert%.com
 
其中target.txt文件中的内容是:
 
5、--example-urls或-e 自动生成网址并监测网址
whatweb --example-urls
 
AGGRESSION LEVELS 侵略级别
whatweb –a [1/2/3/4] www.example.com 或whatweb –aggression [1/2/3/4] www.example.com 
1 (Passive) Make one HTTP request per target. Except for redirects.
2 (Polite) Reserved for future use
3 (Aggressive) Triggers aggressive plugin functions only when a plugin matches passively.
4 (Heavy) Trigger aggressive functions for all plugins. Guess a lot of URLs like Nikto.
SPIDERING 蜘蛛
1、--recursion或 -r 递归式的追踪当前路径下的链接。默认是不开启的
whatweb –r home.cnblogs.com
 
……..会一直追踪连接
而whatweb  home.cnblogs.com  直追踪当前连接地址
 
2、--depth或-d  最大递归深度 默认是 10;可以 –r或—recursion一起使用;对比递归深度0和深度1  如下图
 
3、--max-links或 -m 设定一个网页的追踪的最大链接数目 默认是250
下面是 递归追踪、递归深度为1时 每页的最大追踪连接数目是2和3时的对比图
 
4、--spider-skip-extensions 扩展跳过的关键词 默认有zip,gz,tar,jpg,exe,png,pdf。
PROXY 代理
1、--proxy 语法<hostname[:port]> 设置代理服务器的主机名和端口
2、--proxy-user <username:password> 设置代理的用户名和密码
PLUGINS 插件操作
1、 --plugins, -p  ????
2、查看插件列表 只显示插件名字和描述
whatweb –l
 
3、查看插件列表 列出每个插件的详细信息
whatweb –I
 
4、自定义一个插件
whatweb --custom-plugin :texttest=>'powere by abc'
LOGGING & OUTPUT 日志输出
1、--verbose,或-v 输出详细信息
whatweb -v www.baidu.com 输出如下:
@localhost ~]$ whatweb -v www.baidu.com
www.baidu.com/ [200]
http://www.baidu.com [200] Country[CHINA][CN], HTTPServer[BWS/1.1], JQuery, Title[百度一下,你就知道], UncommonHeaders[bdpagetype,cxy_all,bdqid,bduserid], HTML5, X-UA-Compatible[IE=Edge], Cookies[BAIDUID,BDSVRTM,BD_HOME,BIDUPSID,H_PS_PSSID], IP[180.97.33.107], X-Powered-By[HPHP], Meta-Refresh-Redirect[/baidu.html?from=noscript]
URL    : http://www.baidu.com
Status : 200
   Cookies --------------------------------------------------------------------
Description: Display the names of cookies in the HTTP headers. The 
            values are not returned to save on space. 
String     : BAIDUID
String     : BIDUPSID
String     : BDSVRTM
String     : BD_HOME
String     : H_PS_PSSID

   Country --------------------------------------------------------------------
Description: GeoIP IP2Country lookup. To refresh DB, replace 
            IpToCountry.csv and remove country-ips.dat. GeoIP database 
            from http://software77.net/geo-ip/. Local IPv4 addresses 
            are represented as ZZ according to an ISO convention. 
            Lookup code developed by Matthias Wachter for rubyquiz.com 
            and used with permission. 
Module     : CN
String     : CHINA

   HTML5 ----------------------------------------------------------------------
Description: HTML version 5, detected by the doctype declaration 

   HTTPServer -----------------------------------------------------------------
Description: HTTP server header string 
String     : BWS/1.1 (from server string)

   IP -------------------------------------------------------------------------
Description: IP address of the target, if available. 
String     : 180.97.33.107

   JQuery ---------------------------------------------------------------------
Description: Javascript library 

   Meta-Refresh-Redirect ------------------------------------------------------
Description: Meta refresh tag is a deprecated URL element that can be 
            used to optionally wait x seconds before reloading the 
            current page or loading a new page. More info: 
            https://secure.wikimedia.org/wikipedia/en/wiki/Meta_refresh 
String     : /baidu.html?from=noscript

   Title ----------------------------------------------------------------------
Description: The HTML page title 
String     : 百度一下,你就知道 (from page title)

   UncommonHeaders ------------------------------------------------------------
Description: Uncommon HTTP server headers. The blacklist includes all 
            the standard headers and many non standard but common ones. 
            Interesting but fairly common headers should have their own 
            plugins, eg. x-powered-by, server and x-aspnet-version. 
            Info about headers can be found at www.http-stats.com 
String     : bdpagetype,cxy_all,bdqid,bduserid (from headers)

   X-Powered-By ---------------------------------------------------------------
Description: X-Powered-By HTTP header 
String     : HPHP (from x-powered-by string)

   X-UA-Compatible ------------------------------------------------------------
Description: This plugin retrieves the X-UA-Compatible value from the 
            HTTP header and meta http-equiv tag. - More Info: 
            http://msdn.microsoft.com/en-us/library/cc817574.aspx 
String     : IE=Edge

www.baidu.com/baidu.html?from=noscript [200]
http://www.baidu.com/baidu.html?from=noscript [200] Country[CHINA][CN], HTTPServer[Apache], Title[百度一下,你就知道], HTML5, Cookies[BAIDUID], IP[180.97.33.108], Apache
URL    : http://www.baidu.com/baidu.html?from=noscript
Status : 200
   Apache ---------------------------------------------------------------------
Description: The Apache HTTP Server Project is an effort to develop and 
            maintain an open-source HTTP server for modern operating 
            systems including UNIX and Windows NT. The goal of this 
            project is to provide a secure, efficient and extensible 
            server that provides HTTP services in sync with the current 
            HTTP standards. - homepage: http://httpd.apache.org/ 

   Cookies --------------------------------------------------------------------
Description: Display the names of cookies in the HTTP headers. The 
            values are not returned to save on space. 
String     : BAIDUID

   Country --------------------------------------------------------------------
Description: GeoIP IP2Country lookup. To refresh DB, replace 
            IpToCountry.csv and remove country-ips.dat. GeoIP database 
            from http://software77.net/geo-ip/. Local IPv4 addresses 
            are represented as ZZ according to an ISO convention. 
            Lookup code developed by Matthias Wachter for rubyquiz.com 
            and used with permission. 
Module     : CN
String     : CHINA

   HTML5 ----------------------------------------------------------------------
Description: HTML version 5, detected by the doctype declaration 

   HTTPServer -----------------------------------------------------------------
Description: HTTP server header string 
String     : Apache (from server string)

   IP -------------------------------------------------------------------------
Description: IP address of the target, if available. 
String     : 180.97.33.108

   Title ----------------------------------------------------------------------
Description: The HTML page title 
String     : 百度一下,你就知道 (from page title)

2、--colour或--color 日志输出颜色控制 never always auto 下图是never和auto两种对比
whatweb –color www.baidu.com
  
3、--quiet或-q 设置简短日志不输出到控制台
whatweb -q www.baidu.com 此时控制台没有信息输出 

4、--log-brief=FILE whatweb --log-brief savelog www.baidu.com 输出简短日志并保存到名为savelog的文件中。日志文件的名字随便取
(1) whatweb --log-brief savelog www.baidu.com
savelog内容如下:
@localhost ~]$ vi savelog 

http://www.baidu.com [200] Country[CHINA][CN], Title[百度一下,你就知道], IP[180.97.33.108], Cookies[BAIDUID,BDSVRTM,BD_HOME,BIDUPSID,H_PS_PSSID], Meta-Refresh-Redirect[/baidu.html?from=noscript], X-Powered-By[HPHP], X-UA-Compatible[IE=Edge], HTML5, HTTPServer[BWS/1.1], JQuery, UncommonHeaders[bduserid,bdpagetype,cxy_all,bdqid]
http://www.baidu.com/baidu.html?from=noscript [200] Country[CHINA][CN], Title[百度一下,你就知道], Apache, IP[180.97.33.107], HTML5, HTTPServer[Apache 2.0]
5、-log-verbose 输出详细日志信息
whatweb --log-verbose verboselog www.baidu.com 生成文件test
vi verboselog内容如下图:
@localhost ~]$ vi test

URL    : http://www.baidu.com
Status : 200
   Cookies --------------------------------------------------------------------
        Description: Display the names of cookies in the HTTP headers. The
                     values are not returned to save on space.
        String     : BAIDUID
        String     : BIDUPSID
        String     : BDSVRTM
        String     : BD_HOME
        String     : H_PS_PSSID

   Country --------------------------------------------------------------------
        Description: GeoIP IP2Country lookup. To refresh DB, replace
                     IpToCountry.csv and remove country-ips.dat. GeoIP database
                     from http://software77.net/geo-ip/. Local IPv4 addresses
                     are represented as ZZ according to an ISO convention.
                     Lookup code developed by Matthias Wachter for rubyquiz.com
                     and used with permission.
        Module     : CN
        String     : CHINA

   HTML5 ----------------------------------------------------------------------
        Description: HTML version 5, detected by the doctype declaration

   HTTPServer -----------------------------------------------------------------
        Description: HTTP server header string
        String     : BWS/1.1 (from server string)

   IP -------------------------------------------------------------------------
        Description: IP address of the target, if available.
        String     : 180.97.33.107

   JQuery ---------------------------------------------------------------------
        Description: Javascript library

   Meta-Refresh-Redirect ------------------------------------------------------
        Description: Meta refresh tag is a deprecated URL element that can be
                     used to optionally wait x seconds before reloading the
                     current page or loading a new page. More info:
                     https://secure.wikimedia.org/wikipedia/en/wiki/Meta_refresh
        String     : /baidu.html?from=noscript

   Title ----------------------------------------------------------------------
        Description: The HTML page title
        String     : 百度一下,你就知道 (from page title)

   UncommonHeaders ------------------------------------------------------------
        Description: Uncommon HTTP server headers. The blacklist includes all
                     the standard headers and many non standard but common ones.
                     Interesting but fairly common headers should have their own
                     plugins, eg. x-powered-by, server and x-aspnet-version.
                     Info about headers can be found at www.http-stats.com
        String     : cxy_all,bdpagetype,bdqid,bduserid (from headers)

   X-Powered-By ---------------------------------------------------------------
        Description: X-Powered-By HTTP header
        String     : HPHP (from x-powered-by string)

   X-UA-Compatible ------------------------------------------------------------
        Description: This plugin retrieves the X-UA-Compatible value from the
                     HTTP header and meta http-equiv tag. - More Info:
                     http://msdn.microsoft.com/en-us/library/cc817574.aspx
        String     : IE=Edge

URL    : http://www.baidu.com/baidu.html?from=noscript
Status : 200
   Apache ---------------------------------------------------------------------
        Description: The Apache HTTP Server Project is an effort to develop and
                     maintain an open-source HTTP server for modern operating
                     systems including UNIX and Windows NT. The goal of this
                     project is to provide a secure, efficient and extensible
                     server that provides HTTP services in sync with the current
                     HTTP standards. - homepage: http://httpd.apache.org/

   Cookies --------------------------------------------------------------------
        Description: Display the names of cookies in the HTTP headers. The
                     values are not returned to save on space.
        String     : BAIDUID

   Country --------------------------------------------------------------------
        Description: GeoIP IP2Country lookup. To refresh DB, replace
                     IpToCountry.csv and remove country-ips.dat. GeoIP database
                     from http://software77.net/geo-ip/. Local IPv4 addresses
                     are represented as ZZ according to an ISO convention.
                     Lookup code developed by Matthias Wachter for rubyquiz.com
                     and used with permission.
        Module     : CN
        String     : CHINA

   HTML5 ----------------------------------------------------------------------
        Description: HTML version 5, detected by the doctype declaration

   HTTPServer -----------------------------------------------------------------
        Description: HTTP server header string
        String     : Apache (from server string)

   IP -------------------------------------------------------------------------
        Description: IP address of the target, if available.
        String     : 180.97.33.107

   Title ----------------------------------------------------------------------
        Description: The HTML page title
        String     : 百度一下,你就知道 (from page title)
6、--log-xml 以xml的格式输出日志文件,记录的是详细信息
whatweb --log-xml logxml www.baidu.com    logxml内容如下:
@localhost ~]$ vi logxml 

<?xml version="1.0"?><?xml-stylesheet type="text/xml" href="whatweb.xsl"?>
<log>
<target>
        <uri>http://www.baidu.com</uri>
        <http-status>200</http-status>
        <plugin>
                <name>JQuery</name>
        </plugin>
        <plugin>
                <name>HTML5</name>
        </plugin>
        <plugin>
                <name>Cookies</name>
                <string>BAIDUID,BDSVRTM,BD_HOME,BIDUPSID,H_PS_PSSID</string>
        </plugin>
        <plugin>
                <name>Title</name>
                <string>百度一下,你就知道</string>
        </plugin>
        <plugin>
                <name>X-UA-Compatible</name>
                <string>IE=Edge</string>
        </plugin>
        <plugin>
                <name>IP</name>
                <string>180.97.33.108</string>
        </plugin>
        <plugin>
                <name>Meta-Refresh-Redirect</name>
                <string>/baidu.html?from=noscript</string>
        </plugin>
        <plugin>
                <name>X-Powered-By</name>
                <string>HPHP</string>
        </plugin>
        <plugin>
                <name>UncommonHeaders</name>
                <string>cxy_all,bdpagetype,bdqid,bduserid</string>
        </plugin>
        <plugin>
                <name>HTTPServer</name>
                <string>BWS/1.1</string>
        </plugin>
        <plugin>
                <name>Country</name>
                <string>CHINA</string>
                <modules>
                        <module>CN</module>
                </modules>
        </plugin>
</target>
<target>
        <uri>http://www.baidu.com/baidu.html?from=noscript</uri>
        <http-status>200</http-status>
        <plugin>
                <name>HTML5</name>
        </plugin>
        <plugin>
                <name>Cookies</name>
                <string>BAIDUID</string>
        </plugin>
        <plugin>
                <name>Title</name>
                <string>百度一下,你就知道</string>
        </plugin>
        <plugin>
                <name>IP</name>
                <string>180.97.33.108</string>
        </plugin>
        <plugin>
                <name>Apache</name>
        </plugin>
        <plugin>
                <name>HTTPServer</name>
                <string>Apache</string>
        </plugin>
        <plugin>
                <name>Country</name>
                <string>CHINA</string>
                <modules>
                        <module>CN</module>
                </modules>
        </plugin>
</target>
</log>
8、--log-magictree 以magictree方式的xml文件记录日志
whatweb --log-magictree magictreelog www.baidu.com
vi magictreelog打开文件:
@localhost ~]$ vi magictreelog

<?xml version="1.0" encoding="UTF-8"?>
<magictree class="MtBranchObject">
<testdata class="MtBranchObject"><host>180.97.33.107<hostname>www.baidu.com</hostname></host><host>180.97.33.107<country>CHINA</country><ipproto>tcp<port>80<state>open</state><service>http
<url>http://www.baidu.com<X-Powered-By>HPHP</X-Powered-By></url><url>http://www.baidu.com<HTTPServer>BWS/1.1</HTTPServer></url><url>http://www.baidu.com<UncommonHeaders>bdqid,bdpagetype,bduserid,cxy_all</UncommonHeaders></url><url>http://www.baidu.com<Title>百度一下,你就知道</Title></url><url>http://www.baidu.com<HTML5></HTML5></url><url>http://www.baidu.com<X-UA-Compatible>IE=Edge</X-UA-Compatible></url><url>http://www.baidu.com<Meta-Refresh-Redirect>/baidu.html?from=noscript</Meta-Refresh-Redirect></url><url>http://www.baidu.com<Cookies>BAIDUIDBDSVRTMBD_HOMEBIDUPSIDH_PS_PSSID</Cookies></url><url>http://www.baidu.com<JQuery></JQuery></url></service></port></ipproto></host></testdata><testdata class="MtBranchObject"><host>180.97.33.108<hostname>www.baidu.com</hostname></host><host>180.97.33.108<country>CHINA</country><ipproto>tcp<port>80<state>open</state><service>http
<url>http://www.baidu.com/baidu.html?from=noscript<HTTPServer>Apache 2.0</HTTPServer></url><url>http://www.baidu.com/baidu.html?from=noscript<Title>百度一下
,你就知道</Title></url><url>http://www.baidu.com/baidu.html?from=noscript<HTML5></HTML5></url><url>http://www.baidu.com/baidu.html?from=noscript<Apache></Apache></url></service></port></ipproto></host></testdata></magictree>
9、--log-object 以Ruby对象格式记录日志
whatweb --log-object rubylog www.baidu.com 内容如下:
@localhost ~]$ vi rubylog 

Identifying: http://www.baidu.com
HTTP-Status: 200
[["UncommonHeaders",
  [{:certainty=>100,
    :name=>"headers",
    :string=>"bdqid,bdpagetype,bduserid,cxy_all"}]],
 ["IP", [{:certainty=>100, :string=>"180.97.33.107"}]],
 ["Cookies",
  [{:certainty=>100, :string=>"BAIDUID"},
   {:certainty=>100, :string=>"BIDUPSID"},
   {:certainty=>100, :string=>"BDSVRTM"},
   {:certainty=>100, :string=>"BD_HOME"},
   {:certainty=>100, :string=>"H_PS_PSSID"}]],
 ["X-UA-Compatible",
  [{:certainty=>100,
    :regexp_compiled=>
     /<meta http-equiv[\s]*=[^>]*X-UA-Compatible[^>]*[\s]+content[\s]*=[\s]*['|"]?([a-z0-9=]+)[^>]*>/i,
    :string=>["IE=Edge"]}]],
 ["JQuery",
  [{:regexp=>
     ["<script type=\"text/javascript\" src=\"http://s1.bdstatic.com/r/www/cache/static/jquery/jquery"],
    :certainty=>100,
    :regexp_compiled=>/<script [^>]*jquery/}]],
 ["X-Powered-By",
  [{:certainty=>100, :name=>"x-powered-by string", :string=>"HPHP"}]],
 ["Title",
  [{:certainty=>100,
    :name=>"page title",
    :string=>
     "\347\231\276\345\272\246\344\270\200\344\270\213\357\274\214\344\275\240\345\260\261\347\237\245\351\201\223"}]],
 ["HTML5",
  [{:regexp=>["<!DOCTYPE html>"],
    :certainty=>100,
    :regexp_compiled=>/<!DOCTYPE html>/i}]],
 ["HTTPServer",
  [{:certainty=>100, :name=>"server string", :string=>"BWS/1.1"}]],
 ["Meta-Refresh-Redirect",
  [{:certainty=>100,
    :regexp_compiled=>
     /<meta[\s]+http\-equiv[\s]*=[\s]*['"]?refresh['"]?[^>]+content[\s]*=[^>]*[0-9]+;[\s]*url=['"]?([^"^'^>]+)['"]?[^>]*>/i,
    :string=>["/baidu.html?from=noscript"]}]],
 ["Country", [{:certainty=>100, :module=>"CN", :string=>"CHINA"}]]]

Identifying: http://www.baidu.com/baidu.html?from=noscript
HTTP-Status: 200
[["IP", [{:certainty=>100, :string=>"180.97.33.108"}]],
 ["Cookies", [{:certainty=>100, :string=>"BAIDUID"}]],
 ["Title",
  [{:certainty=>100,
    :name=>"page title",
    :string=>
     "\347\231\276\345\272\246\344\270\200\344\270\213\357\274\214\344\275\240\345\260\261\347\237\245\351\201\223"}]],
 ["Apache", [{:certainty=>100, :name=>"HTTP Server Header"}]],
 ["HTML5",
  [{:regexp=>["<!doctype html>"],
    :certainty=>100,
    :regexp_compiled=>/<!DOCTYPE html>/i}]],
 ["HTTPServer",
  [{:certainty=>100, :name=>"server string", :string=>"Apache"}]],
 ["Country", [{:certainty=>100, :module=>"CN", :string=>"CHINA"}]]]
PERFORMANCE & STABILITY 性能和稳定
--max-threads或-t 线程并发数设置
--open-timeout 打开连接过期时间
--read-timeout 读取信息过期时间
--wait=SECONDS   Wait SECONDS between connections This is useful when using a single thread


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
curl获取网站的http的状态码
web
HttpClient对URL编码的处理方式解惑! - Java - JavaEye论坛
Java数据接口编写简单例子,Java Json解析,服务端接口输出Json数据,客户端通过HTTP获取接口Json数据
Python 爬虫之urllib库,及urllib库的4个模块的基本了解和使用
Regex.Replace()的用法
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服