文章目录
-
- 1. 章节定位
- 2. 测试原理
- 3. 测试方法
-
- 3.1 手动检测(BurpSuite演示)
- 3.2 自动化工具
- 4. 修复建议
-
- 4.1 开发层面
- 4.2 运维层面
- 4.3 持续维护
- 5. 进阶资源
1. 章节定位
对应OWASP TOP 10:A05:2021-安全配置错误 本测试属于信息收集阶段,通过识别服务器类型/版本(如Apache 2.4.41、Nginx 1.17.3),暴露未修复的已知漏洞(如CVE-2021-41773)。据统计,32%的Web攻击利用服务器版本漏洞,2023年曝光的CVE-2023-25690(Apache HTTP Server漏洞)即依赖此信息。
2. 测试原理
#mermaid-svg-1Eg1GK9o9MUob03K {font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-1Eg1GK9o9MUob03K .error-icon{fill:#552222;}#mermaid-svg-1Eg1GK9o9MUob03K .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-1Eg1GK9o9MUob03K .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-1Eg1GK9o9MUob03K .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-1Eg1GK9o9MUob03K .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-1Eg1GK9o9MUob03K .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-1Eg1GK9o9MUob03K .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-1Eg1GK9o9MUob03K .marker{fill:#333333;stroke:#333333;}#mermaid-svg-1Eg1GK9o9MUob03K .marker.cross{stroke:#333333;}#mermaid-svg-1Eg1GK9o9MUob03K svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-1Eg1GK9o9MUob03K .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-1Eg1GK9o9MUob03K .cluster-label text{fill:#333;}#mermaid-svg-1Eg1GK9o9MUob03K .cluster-label span{color:#333;}#mermaid-svg-1Eg1GK9o9MUob03K .label text,#mermaid-svg-1Eg1GK9o9MUob03K span{fill:#333;color:#333;}#mermaid-svg-1Eg1GK9o9MUob03K .node rect,#mermaid-svg-1Eg1GK9o9MUob03K .node circle,#mermaid-svg-1Eg1GK9o9MUob03K .node ellipse,#mermaid-svg-1Eg1GK9o9MUob03K .node polygon,#mermaid-svg-1Eg1GK9o9MUob03K .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-1Eg1GK9o9MUob03K .node .label{text-align:center;}#mermaid-svg-1Eg1GK9o9MUob03K .node.clickable{cursor:pointer;}#mermaid-svg-1Eg1GK9o9MUob03K .arrowheadPath{fill:#333333;}#mermaid-svg-1Eg1GK9o9MUob03K .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-1Eg1GK9o9MUob03K .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-1Eg1GK9o9MUob03K .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-1Eg1GK9o9MUob03K .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-1Eg1GK9o9MUob03K .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-1Eg1GK9o9MUob03K .cluster text{fill:#333;}#mermaid-svg-1Eg1GK9o9MUob03K .cluster span{color:#333;}#mermaid-svg-1Eg1GK9o9MUob03K div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-1Eg1GK9o9MUob03K :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}
发送探测请求
服务器响应分析
响应头字段顺序
错误页面特征
协议行为差异
匹配指纹数据库
识别服务器类型/版本
- 被动识别:分析正常响应的Server头、X-Powered-By字段
- 主动探测:通过畸形请求(如GET / HTTP/3.0)触发默认错误页
- 协议特性:不同服务器对OPTIONS、TRACE等方法的支持差异
3. 测试方法
3.1 手动检测(BurpSuite演示)
基础旗标抓取:
curl -I https://target.com
![BurpSuite响应头截图位置:Proxy->HTTP history->Response headers] 重点检查Server、X-Powered-By字段
畸形请求触发: 在Burp Repeater中发送:
GET / ?param=<> HTTP/1.1
Host: target.com
*观察错误页HTML结构(如Nginx的<center>标签)
3.2 自动化工具
Nmap | nmap -p 443 –script http-server-fingerprint target.com | 匹配SSL/TLS栈特征 |
Nikto | nikto -h target.com | 识别Server头与已知漏洞关联 |
WhatWeb | whatweb -v target.com | 分析Cookie命名规则等200+特征 |
4. 修复建议
4.1 开发层面
# Apache 配置示例 (httpd.conf)
ServerTokens Prod # 仅显示"Apache"
ServerSignature Off
Header unset X-Powered-By
4.2 运维层面
-
反向代理配置(Nginx示例):
server {
proxy_hide_header Server;
add_header Server "Corporate_Web";
} -
WAF规则:在ModSecurity中启用SecServerSignature "Custom"
4.3 持续维护
-
建立补丁日历监控:
# Ubuntu自动更新检查
apt list –upgradable | grep 'apache2\\|nginx'
5. 进阶资源
CVE-2022-31813 Apache HTTP Server路径遍历漏洞(影响2.4.53前版本),通过Server头识别易受攻击主机
CVE-2023-25690 Apache mod_proxy HTTP代理模块(需确认版本≤2.4.55),漏洞分析
CVE-2023-38646 Nginx内存泄露漏洞(影响1.25.1前版本),PoC代码
评论前必须登录!
注册