zoukankan      html  css  js  c++  java
  • web扫描工具-Nikto介绍与使用

    Nikto
    Perl语言开发的开源Web安全扫描器


    web扫描模式:
    截断代理
    主动扫描


    可以扫描的方面:
    软件版本
    搜索存在安全隐患的文件
    服务器配置漏洞
    WEB Application层面的安全隐患
    避免404误判
    -很多服务器不尊从RFC标准,对于不存在的对象返回200响应码
    -依据响应文件内容判断,不同扩展名的文件404响应内容不同
    -去除时间信息后的内容取MD5
    -no404(考虑速度的话,)

    1.Nikto 简单使用
    2.Nikto-interactive(交互方式)
    3.设置使用 cookie 自动登录扫描
    4.使用 LibWhisker 中对 IDS 的躲避技术


    1.简单使用

    a 最基本的nikto扫描只需要指定目标的host(通过 -host 参数指定),也可以指定要扫描的端口号(通过 -port 来指定),默认是80,output是输出这个文件
    nikto -host ip -port 80

    nikto -host ip -ssl -port 443

    nikto -host ip -port 80 -output


    b 多端口扫描
    扫描80,88,443三个端口

    nikto -host ip -port 80,88,443


    nikto -host ip -ssl -port 80,88,443

    扫描80~90共10个端口

    nikto -host ip -p 80-90

    c 多host扫描
    -h 参数的值为一个文件,该文件存一系列的host或者ip。

    文件的格式要求是:每个host必须占一行,端口号放行末,端口号通过冒号或者逗号和host其他端口号区分开
    文件示例:
    192.168.0.1:80

    http://192.168.0.1:8080
    192.168.0.3:80

    nikto -host host.txt


    d 和nmap结合使用,将 nmap 发现的主机进行扫描

    nmap -p80 192.168.1.0/24 -oG - | nikto -host -


    e 支持代理
    nikto -host ip -usertproxy url


    2.Nikto-interactive(交互方式)

    在扫描的过程中敲下按键,即可打开开关


    按一次为打开开关,再按一次为关闭

    Space – report current scan status

    v – verbose mode on/off
    //显示正在扫描的内容详细信息


    d – debug mode on/off
    //更详细的扫描内容信息


    e – error reporting on/off

    //查看扫描过程中错误的信息


    p – progress reporting on/off
    //查看扫描的进度


    r – redirect display on/off
    //把所有的重定向显示出来


    c – cookie display on/off

    //把所有COOKIE显示出来


    a – auth display on/off

    //把身份认证的过程显示出来


    q – quit

    //退出扫描


    N – next host

    //停止这个地址的扫描,扫描host列表的下一个


    P - Pause

    //暂停


    3.设置使用 cookie 自动登录扫描


    第一种:基于HTTP身份认证
    现在使用基于HTTP做身份验证的网站很少,这种方式更多应用于嵌入式设备,更多网站基于表单做身份验证。

    使用id参数
    id 主机使用的身份验证,格式是 ID:密码 或 ID:密码:域

    第二种:使用 cookie 自动登录扫描

    我们需要把cookie设置到配置文件
    配置文件位置: /etc/nikto.conf


    a 配置文件默认使用 Nikto 的 User Agent,更改为 IE8 或其他


    root@kali:~# vim /etc/nikto.conf

    #USERAGENT=Mozilla/5.00 (Nikto/@VERSION) (Evasions:@EVASIONS) (Test:@TESTID)

    USERAGENT=Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)
    # 17行

    # 更换为 IE8:单击 User-Agent-Swicher,选择并复制其中的UA值


    b 配置默认 cookie


    # "cookie1"="cookie value";"cookie2"="cookie val"

    STATIC-COOKIE="PHPSESSID"="31ce7cd539ed93f182d7881460fe0def";"security"="high"
    # 57行


    c 使用修改过配置文件的 nikto 进行扫描,扫描过程中按 d 进行 debug 模式,进行验证配置信息

    root@kali:~# nikto -host http://172.16.10.133/dvwa -port 80

    4. 使用 LibWhisker 中对 IDS 的躲避技术
    # -evasion
    Specify the LibWhisker IDS evasion technique to use (see the LibWhisker docs for detailed information on
    these). Use the reference number to specify the type, multiple may be used:

    1 - Random URI encoding (non-UTF8)

    2 - Directory self-reference (/./)

    3 - Premature URL ending

    4 - Prepend long random string

    5 - Fake parameter

    6 - TAB as request spacer

    7 - Change the case of the URL

    8 - Use Windows directory separator ()

    # -evasion 使用 LibWhisker 中对 IDS 的躲避技术,可使用以下几种类型:

    1 随机 URL 编码(非 UTF-8 方式)

    2 自然选择路径 (/./)

    3 过早的结束URL

    4 优先考虑长随机字符串

    5 参数欺骗

    6 使用 TAB 作为命令的分隔符

    7 使用变化的 URL

    8 使用 windows 路径风额度 ""

    例子:nikto -host http://172.16.10.133/dvwa -evasion 167

    nikto 参数
    Nikto 是一个比较全面的网页扫描器。

    选项:
    -ask+ Whether to ask about submitting updates yes Ask about each (default)
    no Don't ask, don't send
    auto Don't ask, just send
    -Cgidirs+ 扫描这些CGI目录: "none", "all", or values like "/cgi/ /cgi-a/"
    -config+ 使用指定的config文件来替代安装在本地的config.txt文件


    -Display+ Turn on/off display outputs:
    1 显示重定向
    2 显示接受 cookie
    3 显示所有200/OK响应
    4 显示要求验证的 URL
    D 调试输出
    E 显示所有HTTP错误 P 打印处理进度到STDOUT
    S 格式输出IP地址和主机名
    V 详细输出


    -dbcheck Check database and other key files for syntax errors

    -evasion+ 编码技术: 该选项能够对扫描包进行一些变形,绕过IDC检测。可使用以下几种类型:
    1 随机URI编码 (non-UTF8)
    2 使用相对路径作为参考 (/./)
    3 Premature URL ending 虚假的请求结束
    4 Prepend long random string 长的URL请求
    5 隐藏参数
    6 使用 TAB 作为命令的分隔符
    7 大小写敏感
    8 使用Windows路径分隔符替换

    A Use a carriage return (0x0d) as a request spacer

    B Use binary value 0x0b as a request spacer


    -Format+ Save file (-o) format:
    csv 逗号分隔值
    htm HTML格式
    nbe Nessus的NBE格式
    sql Generic SQL (see docs for schema)
    txt 文本(默认情况下,如果没有指定)
    xml XML格式
    (if not specified the format will be taken from the file extension passed to -output)


    -Help 帮助
    -host+ 目标主机
    -404code Ignore these HTTP codes as negative responses (always). Format is "302,301".
    -404string Ignore this string in response body content as negative response (always). Can be a regular expression.
    -id+ 主机使用的身份验证,格式是 ID:密码 或 ID:密码:领域
    -key+ Client certificate key file
    -list-plugins 列出所有可用的插件,不执行测试
    -maxtime+ 每个主机的最大测试时间 (e.g., 1h, 60m, 3600s)


    -mutate+ 猜额外的文件名。变化猜测技术:
    1 测试所有的文件,所有的根目录
    2 猜测密码文件名
    3 通过Apache枚举用户名(/~user type requests)
    4 通过cgiwrap枚举用户名(/cgi-bin/cgiwrap/~user type requests)
    5 试暴力破解子域名,假设主机名称是父域名
    6 尝试使用从提供的字典文件的目录名称


    -mutate-options Provide information for mutates
    -nointeractive 禁用交互特性
    -nolookup 禁止DNS查找
    -nossl 禁止使用SSL
    -no404 禁用Nikto尝试猜测404页
    -Option Over-ride an option in nikto.conf, can be issued multiple times
    -output+ Write output to this file ('.' for auto-name)
    -Pause+ 测试之间的停顿(秒,整数或浮点数)
    -Plugins+ 列出正在运行的插件(默认:ALL)
    -port+ 要使用的端口(默认80)
    -RSAcert+ Client certificate file
    -root+ 前面加上root值到所有请求,格式为/目录
    -Save Save positive responses to this directory ('.' for auto-name)
    -ssl 强制SSL端口模式


    -Tuning+ 扫描选项: 选项控制Nikto使用不同的方式来扫描目标。
    1 日志文件
    2 默认文件
    3 信息泄漏
    4 注入 (XSS/Script/HTML)
    5 远程文件检索 - Inside Web Root
    6 拒绝服务
    7 远程文件检索 - Server Wide
    8 执行命令 / 远程shell
    9 SQL 注入
    0 文件上传
    a 认证绕过
    b 软件关联
    c Remote Source Inclusion
    d WebService
    e Administrative Console
    x 反向连接选项 (i.e., include all except specified)


    -timeout+ 请求超时时间 (默认 10 秒)
    -Userdbs Load only user databases, not the standard databases
    all Disable standard dbs and load only user dbs
    tests Disable only db_tests and load udb_tests
    -useragent Over-rides the default useragent
    -until Run until the specified time or duration
    -update 从 CIRT.net 更新 数据库 和 插件
    -useproxy 使用在 nikto.conf 定义的代理, 或者 使用参数 http://server:port
    -Version 打印插件和数据库版本
    -vhost+ 虚拟主机(用于主机头)
    + requires a value

  • 相关阅读:
    docker简单介绍----Dockerfile命令
    docker简单介绍----docker仓库的应用
    nginx实现https的配置文件
    docker简单介绍---网络端口管理
    mysql查看实时连接数
    linux 批量测试域名返回码脚本
    docker简单介绍----镜像和容器管理
    香冢
    GitHub 在使用命令行 git push 时报错:The requested URL returned error: 403
    守规矩应该被骂吗?
  • 原文地址:https://www.cnblogs.com/-wenli/p/9762690.html
Copyright © 2011-2022 走看看