这里写自定义目录标题
一、HTTP协议
- 明文
- 无内建的机密性安全机制
嗅探或代理截断可查看全部明文信息
https只能提高传输层安全
- 无状态
每一次客户端和服务器端的通信都是独立的过程
WEB应用需要跟踪客户端会话(多步通信)
不使用cookie的应用,客户端每次请求都要重新身份验证(不现实).
Session用于在用户身份验证后跟踪用户行为轨迹
提高用户体验,但增加了攻击向量
- cycle
请求响应
- 重要header
- Set-Cookie:服务器发给客户端的SessionID (被窃取的风险)
- Content-Length:响应body部分的字节长度
- Location:重定向用户到另一个页面,可识别身份认证后允许访问的页面
- Cookie:客户端发回给服务器证明用户状态的信息(头:值成对出现)
- Referrer:发起新请求之前用户位于哪个页面,服务器基于此头的安全限制很容 易被修改绕过
- 响应包 状态码
- 100s :服务器响应的信息,通常表示服务器还有后续处理,很少出现
- 200s:请求被服务器成功接受并处理后返回的响应结果
- 300s :重定向,通常在身份认证成功后重定向到一个安全页面(301/302)
- 400s:表示客户端请求错误
• 401 :需要身份验证
• 403:拒绝访问
• 404:目标未发现- 500s:服务器内部错误 (503:服务不可用
二、实验环境
Metasploitable
直接下载靶机打开
• Dvwa
嘿嘿
三、扫描工具
• Nikto
• Vega
• Skipfish
• W3af
• Arachni
• Owasp-zap
HTTrack 爬取整站
爬取整站的网页,用于离线浏览,减少与目标系统交互
Nikto
• Perl语言开发的开源web安全扫描器
• 软件版本
• 搜索存在安全隐患的文件
• 服务器配置漏洞
• WEB Application层面的安全隐患
• 避免404误判
• 很多服务器不遵守RFC标准,对于不存在的对象返回200响应码
• 依据响应文件内容判断,不同扩展名的文件404响应内容不同
• 去除时间信息后的内容取MD5值
• -no404
1.安装并更新
git clone https://github.com/sullo/nikto.git Nikto2
# 之后,nikto.pl 将会在Nikto2/program/目录(也可以在文档目录中找到)。
# 保持Nikto更新只需转到您的仓库中的目录并键入:
git pull
2. 列出插件
• nikto -list-plugins
• nikto -update # 升级数据库、插件
• cirt.net
3. 基本扫描
# 使用本地设置的 VPN 代理
• nikto -host 192.168.1.1 -useproxy http://localhost:8087
• nikto -vhost 域名
• http://cirt.net/nikto/UPDATES
# url
• nikto -host http:// 1.1.1.1
# 指定主机和端口
• nikto -host 192.168.1.1 -ssl -port 443,8443,995
nikto -host www.baidu.com -port 443 -ssl
# 批量扫描
• nikto -host host.txt
# 将 nmap 发现的主机进行扫描
nmap -p80 192.168.98.0/24 -oG - | nikto -host -
┌──(kali-2㉿kali)-[~]
└─$ nmap -p80 192.168.98.0/24 -oG - | nikto -host - 1 ⨯
- Nikto v2.1.6
---------------------------------------------------------------------------
+ nmap Input Queued: 192.168.98.131:80
+ Target IP: 192.168.98.131
+ Target Hostname: 192.168.98.131
+ Target Port: 80
+ Start Time: 2021-11-29 05:02:14 (GMT-5)
---------------------------------------------------------------------------
+ Server: Microsoft-IIS/5.1
+ Cookie ASPSESSIONIDQATRSDAR created without the httponly flag
+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ Server banner has changed from 'Microsoft-IIS/5.1' to 'ARRAY(0x556b6197a130)' which may suggest a WAF, load balancer or proxy is in place
+ Retrieved dasl header: <DAV:sql>
+ Retrieved dav header: 1, 2
+ Retrieved ms-author-via header: DAV
+ Uncommon header 'ms-author-via' found, with contents: DAV
+ Allowed HTTP Methods: OPTIONS, TRACE, GET, HEAD, DELETE, PUT, POST, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH
4. 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
• a – auth display on/off
• q – quit
• N – next host
• P - Pause
5.配置文件 设置使用 cookie 自动登录扫描
• 配置文件
• /etc/nikto.conf
• STATIC-COOKIE=“cookie1”=“cookie value”;“cookie2”="cookie valu”
6. -evasion
使用LibWhisker中对IDS的躲避技术,可使用以下几种类型:
• 1 随机URL编码 (非UTF-8方式)
• 2 自选择路径 (/./)
• 3 过早结束的URL
• 4 优先考虑长随机字符串
• 5 参数欺骗
• 6 使用TAB作为命令的分隔符
• 7 使用变化的URL
• 8 使用Windows路径分隔符”\”