安全测试从入门到精通 - 环境搭建与基础工具选择

文章目录

  • 第2章:环境搭建与基础工具箱
    • [2.1 搭建你的安全实验室](#2.1 搭建你的安全实验室)
      • [🧪 为什么需要实验室?](#🧪 为什么需要实验室?)
      • [🖥️ 你的实验环境架构](#🖥️ 你的实验环境架构)
      • [📋 环境清单](#📋 环境清单)
      • [🏗️ 方案A:最简方案(推荐新手)](#🏗️ 方案A:最简方案(推荐新手))
      • [🏗️ 方案B:完整虚拟机方案(推荐进阶)](#🏗️ 方案B:完整虚拟机方案(推荐进阶))
        • [📥 安装步骤](#📥 安装步骤)
    • [2.2 HTTP协议基础 --- 安全测试的"通用语言"](#2.2 HTTP协议基础 — 安全测试的"通用语言")
      • [🌐 当你访问一个网站,背后发生了什么?](#🌐 当你访问一个网站,背后发生了什么?)
      • [📦 HTTP请求的结构](#📦 HTTP请求的结构)
      • [🎯 HTTP方法 --- 动作指令](#🎯 HTTP方法 — 动作指令)
      • [🔢 HTTP状态码 --- 服务器的"心情"](#🔢 HTTP状态码 — 服务器的"心情")
      • [🍪 Cookie与Session --- 网站怎么"记住"你](#🍪 Cookie与Session — 网站怎么"记住"你)
    • [2.3 Burp Suite 入门 --- 安全测试的瑞士军刀](#2.3 Burp Suite 入门 — 安全测试的瑞士军刀)
      • [🧰 什么是Burp Suite?](#🧰 什么是Burp Suite?)
      • [⚙️ 安装与配置](#⚙️ 安装与配置)
        • [Step 1: 下载并启动](#Step 1: 下载并启动)
        • [Step 2: 配置浏览器代理](#Step 2: 配置浏览器代理)
        • [Step 3: 安装 CA 证书](#Step 3: 安装 CA 证书)
      • [🎮 Burp Suite 核心功能速览](#🎮 Burp Suite 核心功能速览)
      • [🔥 第一次抓包:5分钟上手](#🔥 第一次抓包:5分钟上手)
      • [🔄 Repeater 基础](#🔄 Repeater 基础)
    • [2.4 Chrome 开发者工具 --- 你的另外一把武器](#2.4 Chrome 开发者工具 — 你的另外一把武器)
      • [🛠️ 打开方式](#🛠️ 打开方式)
      • [📋 安全测试常用的4个面板](#📋 安全测试常用的4个面板)
      • [💡 实操场景](#💡 实操场景)
    • [2.5 初识常用命令行工具](#2.5 初识常用命令行工具)
      • [🖥️ 基础命令速查](#🖥️ 基础命令速查)
      • [🐍 Python 一行代码 = 一个工具](#🐍 Python 一行代码 = 一个工具)
    • [📝 本章小结](#📝 本章小结)
      • [✅ 你应该能做到了](#✅ 你应该能做到了)
      • [🧠 本章练习](#🧠 本章练习)

第2章:环境搭建与基础工具箱

本章目标:搭建你自己的"安全实验室",安装核心工具,学会用 Burp Suite 抓包------这是安全测试的第一步,也是最重要的一步。


2.1 搭建你的安全实验室

🧪 为什么需要实验室?

想象你要学做菜:你不能直接去五星级酒店的后厨实习------你得先在自己家里练习,切糊了也没事,烧焦了也没关系。

安全实验室就是你的"练习厨房":

  • 在里面随便搞破坏都没问题(都是你自己的虚拟机)
  • 特制的"漏洞靶场"------故意制造了很多漏洞的应用,让你练习
  • 可以大胆尝试各种攻击手法

🖥️ 你的实验环境架构

#mermaid-svg-BHbBm2bZIrPKyFCK{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-BHbBm2bZIrPKyFCK .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-BHbBm2bZIrPKyFCK .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-BHbBm2bZIrPKyFCK .error-icon{fill:#552222;}#mermaid-svg-BHbBm2bZIrPKyFCK .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-BHbBm2bZIrPKyFCK .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-BHbBm2bZIrPKyFCK .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-BHbBm2bZIrPKyFCK .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-BHbBm2bZIrPKyFCK .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-BHbBm2bZIrPKyFCK .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-BHbBm2bZIrPKyFCK .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-BHbBm2bZIrPKyFCK .marker{fill:#333333;stroke:#333333;}#mermaid-svg-BHbBm2bZIrPKyFCK .marker.cross{stroke:#333333;}#mermaid-svg-BHbBm2bZIrPKyFCK svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-BHbBm2bZIrPKyFCK p{margin:0;}#mermaid-svg-BHbBm2bZIrPKyFCK .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-BHbBm2bZIrPKyFCK .cluster-label text{fill:#333;}#mermaid-svg-BHbBm2bZIrPKyFCK .cluster-label span{color:#333;}#mermaid-svg-BHbBm2bZIrPKyFCK .cluster-label span p{background-color:transparent;}#mermaid-svg-BHbBm2bZIrPKyFCK .label text,#mermaid-svg-BHbBm2bZIrPKyFCK span{fill:#333;color:#333;}#mermaid-svg-BHbBm2bZIrPKyFCK .node rect,#mermaid-svg-BHbBm2bZIrPKyFCK .node circle,#mermaid-svg-BHbBm2bZIrPKyFCK .node ellipse,#mermaid-svg-BHbBm2bZIrPKyFCK .node polygon,#mermaid-svg-BHbBm2bZIrPKyFCK .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-BHbBm2bZIrPKyFCK .rough-node .label text,#mermaid-svg-BHbBm2bZIrPKyFCK .node .label text,#mermaid-svg-BHbBm2bZIrPKyFCK .image-shape .label,#mermaid-svg-BHbBm2bZIrPKyFCK .icon-shape .label{text-anchor:middle;}#mermaid-svg-BHbBm2bZIrPKyFCK .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-BHbBm2bZIrPKyFCK .rough-node .label,#mermaid-svg-BHbBm2bZIrPKyFCK .node .label,#mermaid-svg-BHbBm2bZIrPKyFCK .image-shape .label,#mermaid-svg-BHbBm2bZIrPKyFCK .icon-shape .label{text-align:center;}#mermaid-svg-BHbBm2bZIrPKyFCK .node.clickable{cursor:pointer;}#mermaid-svg-BHbBm2bZIrPKyFCK .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-BHbBm2bZIrPKyFCK .arrowheadPath{fill:#333333;}#mermaid-svg-BHbBm2bZIrPKyFCK .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-BHbBm2bZIrPKyFCK .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-BHbBm2bZIrPKyFCK .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-BHbBm2bZIrPKyFCK .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-BHbBm2bZIrPKyFCK .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-BHbBm2bZIrPKyFCK .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-BHbBm2bZIrPKyFCK .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-BHbBm2bZIrPKyFCK .cluster text{fill:#333;}#mermaid-svg-BHbBm2bZIrPKyFCK .cluster span{color:#333;}#mermaid-svg-BHbBm2bZIrPKyFCK 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-BHbBm2bZIrPKyFCK .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-BHbBm2bZIrPKyFCK rect.text{fill:none;stroke-width:0;}#mermaid-svg-BHbBm2bZIrPKyFCK .icon-shape,#mermaid-svg-BHbBm2bZIrPKyFCK .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-BHbBm2bZIrPKyFCK .icon-shape p,#mermaid-svg-BHbBm2bZIrPKyFCK .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-BHbBm2bZIrPKyFCK .icon-shape .label rect,#mermaid-svg-BHbBm2bZIrPKyFCK .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-BHbBm2bZIrPKyFCK .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-BHbBm2bZIrPKyFCK .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-BHbBm2bZIrPKyFCK :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 你的物理机 Host
攻击网络
虚拟机1: Kali Linux

攻击机
虚拟机2: Metasploitable

或 DVWA

目标靶机
工具集

Burp Suite / SQLMap / Nmap

📋 环境清单

组件 推荐选择 用途 获取方式
🖥️ 虚拟机软件 VMware Fusion / VirtualBox 运行虚拟系统 官网下载
🎯 攻击机 Kali Linux 预装200+安全工具 kali.org
🎯 攻击机(轻量) Parrot OS Kali替代品 parrotsec.org
🛡️ 靶机:Web漏洞 DVWA (Damn Vulnerable Web App) Web安全练习 GitHub
🛡️ 靶机:综合 Metasploitable 2 综合漏洞练习 官网下载
🛡️ 靶机:在线 HackTheBox / TryHackMe 在线练习平台 官网注册
🛡️ 靶机:浏览器 WebGoat Java Web漏洞 OWASP项目
🛡️ 靶场:练手 PortSwigger Web Security Academy 图文教程+练习 官网免费

💡 新手建议:先在本机装 Chrome 浏览器,用在线靶场(PortSwigger Academy 或 WebGoat)练手,不需要装虚拟机就可以开始学习!


🏗️ 方案A:最简方案(推荐新手)

不需要虚拟机,直接在线练习:
#mermaid-svg-lReKUDyp4ukOkMjT{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-lReKUDyp4ukOkMjT .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-lReKUDyp4ukOkMjT .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-lReKUDyp4ukOkMjT .error-icon{fill:#552222;}#mermaid-svg-lReKUDyp4ukOkMjT .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-lReKUDyp4ukOkMjT .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-lReKUDyp4ukOkMjT .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-lReKUDyp4ukOkMjT .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-lReKUDyp4ukOkMjT .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-lReKUDyp4ukOkMjT .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-lReKUDyp4ukOkMjT .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-lReKUDyp4ukOkMjT .marker{fill:#333333;stroke:#333333;}#mermaid-svg-lReKUDyp4ukOkMjT .marker.cross{stroke:#333333;}#mermaid-svg-lReKUDyp4ukOkMjT svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-lReKUDyp4ukOkMjT p{margin:0;}#mermaid-svg-lReKUDyp4ukOkMjT .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-lReKUDyp4ukOkMjT .cluster-label text{fill:#333;}#mermaid-svg-lReKUDyp4ukOkMjT .cluster-label span{color:#333;}#mermaid-svg-lReKUDyp4ukOkMjT .cluster-label span p{background-color:transparent;}#mermaid-svg-lReKUDyp4ukOkMjT .label text,#mermaid-svg-lReKUDyp4ukOkMjT span{fill:#333;color:#333;}#mermaid-svg-lReKUDyp4ukOkMjT .node rect,#mermaid-svg-lReKUDyp4ukOkMjT .node circle,#mermaid-svg-lReKUDyp4ukOkMjT .node ellipse,#mermaid-svg-lReKUDyp4ukOkMjT .node polygon,#mermaid-svg-lReKUDyp4ukOkMjT .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-lReKUDyp4ukOkMjT .rough-node .label text,#mermaid-svg-lReKUDyp4ukOkMjT .node .label text,#mermaid-svg-lReKUDyp4ukOkMjT .image-shape .label,#mermaid-svg-lReKUDyp4ukOkMjT .icon-shape .label{text-anchor:middle;}#mermaid-svg-lReKUDyp4ukOkMjT .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-lReKUDyp4ukOkMjT .rough-node .label,#mermaid-svg-lReKUDyp4ukOkMjT .node .label,#mermaid-svg-lReKUDyp4ukOkMjT .image-shape .label,#mermaid-svg-lReKUDyp4ukOkMjT .icon-shape .label{text-align:center;}#mermaid-svg-lReKUDyp4ukOkMjT .node.clickable{cursor:pointer;}#mermaid-svg-lReKUDyp4ukOkMjT .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-lReKUDyp4ukOkMjT .arrowheadPath{fill:#333333;}#mermaid-svg-lReKUDyp4ukOkMjT .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-lReKUDyp4ukOkMjT .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-lReKUDyp4ukOkMjT .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-lReKUDyp4ukOkMjT .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-lReKUDyp4ukOkMjT .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-lReKUDyp4ukOkMjT .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-lReKUDyp4ukOkMjT .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-lReKUDyp4ukOkMjT .cluster text{fill:#333;}#mermaid-svg-lReKUDyp4ukOkMjT .cluster span{color:#333;}#mermaid-svg-lReKUDyp4ukOkMjT 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-lReKUDyp4ukOkMjT .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-lReKUDyp4ukOkMjT rect.text{fill:none;stroke-width:0;}#mermaid-svg-lReKUDyp4ukOkMjT .icon-shape,#mermaid-svg-lReKUDyp4ukOkMjT .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-lReKUDyp4ukOkMjT .icon-shape p,#mermaid-svg-lReKUDyp4ukOkMjT .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-lReKUDyp4ukOkMjT .icon-shape .label rect,#mermaid-svg-lReKUDyp4ukOkMjT .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-lReKUDyp4ukOkMjT .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-lReKUDyp4ukOkMjT .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-lReKUDyp4ukOkMjT :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 你的电脑

安装Chrome
安装插件

Proxy SwitchyOmega
安装Burp Suite

Community版免费
配置代理
在线靶场练习
PortSwigger Academy

https://portswigger.net/web-security
TryHackMe

https://tryhackme.com
HackTheBox Academy

https://academy.hackthebox.com

🏗️ 方案B:完整虚拟机方案(推荐进阶)

复制代码
┌─────────────────────────────────────────┐
│           你的宿主机 (Mac/Windows)        │
│  ┌─────────────────┐  ┌───────────────┐  │
│  │  Kali Linux VM   │  │ 靶机 VM       │  │
│  │  - 攻击工具集    │  │  - DVWA       │  │
│  │  - Burp Suite    │──│  - Metasploit │  │
│  │  - Nmap          │  │  - VulnHub   │  │
│  │  - SQLMap        │  │               │  │
│  └─────────────────┘  └───────────────┘  │
└─────────────────────────────────────────┘
📥 安装步骤

Step 1: 安装 VMware Fusion(Mac)或 VirtualBox(Win/Linux)

bash 复制代码
# Mac用户推荐:
brew install --cask vmware-fusion

# 或者免费方案:
brew install --cask virtualbox

Step 2: 下载并安装 Kali Linux

bash 复制代码
# 从 https://www.kali.org/get-kali/#kali-virtual-machines
# 下载 Kali Linux VMware/VirtualBox 镜像
# 直接导入即可使用,省去安装过程

Step 3: 下载靶机

bash 复制代码
# DVWA (PHP + MySQL)
git clone https://github.com/digininja/DVWA.git
# 或者用 Docker 一键启动
docker run --rm -it -p 80:80 vulnerables/web-dvwa

# WebGoat (Java)
docker run --rm -it -p 8080:8080 webgoat/goatandwolf

# Metasploitable 2 (需要下载虚拟机镜像)
# https://sourceforge.net/projects/metasploitable/

2.2 HTTP协议基础 --- 安全测试的"通用语言"

安全测试中绝大部分工作都是和HTTP打交道。不理解HTTP,就像翻译不懂语法一样寸步难行。

🌐 当你访问一个网站,背后发生了什么?

目标服务器 DNS服务器 你(浏览器) 目标服务器 DNS服务器 你(浏览器) #mermaid-svg-dah2anxrZWZz2JT7{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-dah2anxrZWZz2JT7 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-dah2anxrZWZz2JT7 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-dah2anxrZWZz2JT7 .error-icon{fill:#552222;}#mermaid-svg-dah2anxrZWZz2JT7 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-dah2anxrZWZz2JT7 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-dah2anxrZWZz2JT7 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-dah2anxrZWZz2JT7 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-dah2anxrZWZz2JT7 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-dah2anxrZWZz2JT7 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-dah2anxrZWZz2JT7 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-dah2anxrZWZz2JT7 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-dah2anxrZWZz2JT7 .marker.cross{stroke:#333333;}#mermaid-svg-dah2anxrZWZz2JT7 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-dah2anxrZWZz2JT7 p{margin:0;}#mermaid-svg-dah2anxrZWZz2JT7 .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-dah2anxrZWZz2JT7 text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-dah2anxrZWZz2JT7 .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-dah2anxrZWZz2JT7 .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-dah2anxrZWZz2JT7 .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-dah2anxrZWZz2JT7 .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-dah2anxrZWZz2JT7 #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-dah2anxrZWZz2JT7 .sequenceNumber{fill:white;}#mermaid-svg-dah2anxrZWZz2JT7 #sequencenumber{fill:#333;}#mermaid-svg-dah2anxrZWZz2JT7 #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-dah2anxrZWZz2JT7 .messageText{fill:#333;stroke:none;}#mermaid-svg-dah2anxrZWZz2JT7 .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-dah2anxrZWZz2JT7 .labelText,#mermaid-svg-dah2anxrZWZz2JT7 .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-dah2anxrZWZz2JT7 .loopText,#mermaid-svg-dah2anxrZWZz2JT7 .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-dah2anxrZWZz2JT7 .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-dah2anxrZWZz2JT7 .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-dah2anxrZWZz2JT7 .noteText,#mermaid-svg-dah2anxrZWZz2JT7 .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-dah2anxrZWZz2JT7 .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-dah2anxrZWZz2JT7 .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-dah2anxrZWZz2JT7 .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-dah2anxrZWZz2JT7 .actorPopupMenu{position:absolute;}#mermaid-svg-dah2anxrZWZz2JT7 .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-dah2anxrZWZz2JT7 .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-dah2anxrZWZz2JT7 .actor-man circle,#mermaid-svg-dah2anxrZWZz2JT7 line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-dah2anxrZWZz2JT7 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} www.example.com在哪里? IP地址是 93.184.216.34 GET /index.html HTTP/1.1 HTTP/1.1 200 OK Content-Type: text/html <html>...</html> 渲染页面并显示

📦 HTTP请求的结构

一个HTTP请求就像一封"信",分三部分:

复制代码
┌──────────────────────────────────────────────────────┐
│ 📮 请求行 (Request Line)                              │
│  GET /login.php?user=admin HTTP/1.1                   │
│  ^^^   ^^^^^^^^^^^^^^^^^^   ^^^^^^^^                  │
│  方法         URL          协议版本                   │
├──────────────────────────────────────────────────────┤
│ 📋 请求头 (Headers) --- 信的"信封"信息                   │
│  Host: www.example.com                                │
│  User-Agent: Chrome/120...                            │
│  Cookie: session_id=abc123                            │
│  Content-Type: application/x-www-form-urlencoded      │
├──────────────────────────────────────────────────────┤
│ 📄 请求体 (Body) --- 信的"内容"                          │
│  username=admin&password=123456                       │
└──────────────────────────────────────────────────────┘

🎯 HTTP方法 --- 动作指令

方法 含义 举个🌰 安全关注
GET 获取资源 查看网页、搜索 参数在URL中可见
POST 提交数据 登录、注册、下单 参数在请求体中
PUT 更新资源 修改个人信息 能否越权修改别人信息
DELETE 删除资源 删除文章 能否删除别人数据
OPTIONS 查看支持的方法 探测服务器 是否暴露了不该暴露的方法

🗣️ 作者说:在安全测试中,90%的情况下你只需要关注 GET 和 POST。但有经验的测试人员一定会检查 OPTIONS------因为有时候服务器会"不小心"开启了 PUT 或 DELETE 方法,这就等于给攻击者敞开了大门。

🔢 HTTP状态码 --- 服务器的"心情"

#mermaid-svg-Od5pzPnSdyNBnLq6{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-Od5pzPnSdyNBnLq6 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-Od5pzPnSdyNBnLq6 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-Od5pzPnSdyNBnLq6 .error-icon{fill:#552222;}#mermaid-svg-Od5pzPnSdyNBnLq6 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-Od5pzPnSdyNBnLq6 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-Od5pzPnSdyNBnLq6 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-Od5pzPnSdyNBnLq6 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-Od5pzPnSdyNBnLq6 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-Od5pzPnSdyNBnLq6 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-Od5pzPnSdyNBnLq6 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-Od5pzPnSdyNBnLq6 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-Od5pzPnSdyNBnLq6 .marker.cross{stroke:#333333;}#mermaid-svg-Od5pzPnSdyNBnLq6 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-Od5pzPnSdyNBnLq6 p{margin:0;}#mermaid-svg-Od5pzPnSdyNBnLq6 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-Od5pzPnSdyNBnLq6 .cluster-label text{fill:#333;}#mermaid-svg-Od5pzPnSdyNBnLq6 .cluster-label span{color:#333;}#mermaid-svg-Od5pzPnSdyNBnLq6 .cluster-label span p{background-color:transparent;}#mermaid-svg-Od5pzPnSdyNBnLq6 .label text,#mermaid-svg-Od5pzPnSdyNBnLq6 span{fill:#333;color:#333;}#mermaid-svg-Od5pzPnSdyNBnLq6 .node rect,#mermaid-svg-Od5pzPnSdyNBnLq6 .node circle,#mermaid-svg-Od5pzPnSdyNBnLq6 .node ellipse,#mermaid-svg-Od5pzPnSdyNBnLq6 .node polygon,#mermaid-svg-Od5pzPnSdyNBnLq6 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-Od5pzPnSdyNBnLq6 .rough-node .label text,#mermaid-svg-Od5pzPnSdyNBnLq6 .node .label text,#mermaid-svg-Od5pzPnSdyNBnLq6 .image-shape .label,#mermaid-svg-Od5pzPnSdyNBnLq6 .icon-shape .label{text-anchor:middle;}#mermaid-svg-Od5pzPnSdyNBnLq6 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-Od5pzPnSdyNBnLq6 .rough-node .label,#mermaid-svg-Od5pzPnSdyNBnLq6 .node .label,#mermaid-svg-Od5pzPnSdyNBnLq6 .image-shape .label,#mermaid-svg-Od5pzPnSdyNBnLq6 .icon-shape .label{text-align:center;}#mermaid-svg-Od5pzPnSdyNBnLq6 .node.clickable{cursor:pointer;}#mermaid-svg-Od5pzPnSdyNBnLq6 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-Od5pzPnSdyNBnLq6 .arrowheadPath{fill:#333333;}#mermaid-svg-Od5pzPnSdyNBnLq6 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-Od5pzPnSdyNBnLq6 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-Od5pzPnSdyNBnLq6 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-Od5pzPnSdyNBnLq6 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-Od5pzPnSdyNBnLq6 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-Od5pzPnSdyNBnLq6 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-Od5pzPnSdyNBnLq6 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-Od5pzPnSdyNBnLq6 .cluster text{fill:#333;}#mermaid-svg-Od5pzPnSdyNBnLq6 .cluster span{color:#333;}#mermaid-svg-Od5pzPnSdyNBnLq6 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-Od5pzPnSdyNBnLq6 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-Od5pzPnSdyNBnLq6 rect.text{fill:none;stroke-width:0;}#mermaid-svg-Od5pzPnSdyNBnLq6 .icon-shape,#mermaid-svg-Od5pzPnSdyNBnLq6 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-Od5pzPnSdyNBnLq6 .icon-shape p,#mermaid-svg-Od5pzPnSdyNBnLq6 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-Od5pzPnSdyNBnLq6 .icon-shape .label rect,#mermaid-svg-Od5pzPnSdyNBnLq6 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-Od5pzPnSdyNBnLq6 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-Od5pzPnSdyNBnLq6 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-Od5pzPnSdyNBnLq6 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 1xx
2xx
3xx
4xx
5xx
服务器收到请求
返回什么状态码?
信息

100 Continue
成功

200 OK / 201 Created
重定向

301 / 302 Found
客户端错误

400 Bad Request

401 Unauthorized

403 Forbidden

404 Not Found
服务端错误

500 Internal Server Error

502 Bad Gateway

安全测试要特别"警惕"的状态码

状态码 含义 安全测试人员的"雷达"
200 成功 如果是本不该访问的资源,说明有越权问题
301/302 重定向 是否可能被用来做开放重定向攻击?
401 未认证 验证是否真的没权限,还是认证可绕过?
403 禁止访问 尝试不同的URL路径绕过
404 未找到 尝试路径穿越看隐藏文件
500 服务器错误 高能警报!可能触发了SQL注入或缓冲区溢出

🍪 Cookie与Session --- 网站怎么"记住"你

类比 :网站的发型是像酒吧的"手环"------你进门时(登录),服务员给你戴上手环(Session),每次去吧台点酒(请求),只需要亮出手环即可,不用再出示身份证了。

复制代码
关键概念:

Session(会话): 你这次来访的身份ID
Cookie(饼干): 浏览器保存这个ID的地方

流程:
1. 你登录 → 用户名密码正确
2. 服务器创建 Session ID → "你是用户 #12345"
3. 服务器把 Session ID 放进 Cookie 返回给浏览器
4. 每次请求,浏览器自动带上 Cookie
5. 服务器看到 Cookie 就知道"哦,用户 #12345 来了"

安全测试关注点

  • Session ID 是否可预测(比如简单的数字递增 user1, user2, user3
  • Cookie 是否设置了 HttpOnly(防止JS读取)
  • Cookie 是否设置了 Secure(只通过HTTPS传输)
  • Session 是否会在登出后失效

2.3 Burp Suite 入门 --- 安全测试的瑞士军刀

🧰 什么是Burp Suite?

Burp Suite 是安全测试领域最流行的工具,没有之一。它是一个拦截代理------坐在你的浏览器和目标网站之间,让你能看到、修改所有的请求和响应。
#mermaid-svg-ZHSz9HO2uJyY2vYW{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-ZHSz9HO2uJyY2vYW .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-ZHSz9HO2uJyY2vYW .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-ZHSz9HO2uJyY2vYW .error-icon{fill:#552222;}#mermaid-svg-ZHSz9HO2uJyY2vYW .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-ZHSz9HO2uJyY2vYW .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-ZHSz9HO2uJyY2vYW .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-ZHSz9HO2uJyY2vYW .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-ZHSz9HO2uJyY2vYW .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-ZHSz9HO2uJyY2vYW .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-ZHSz9HO2uJyY2vYW .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-ZHSz9HO2uJyY2vYW .marker{fill:#333333;stroke:#333333;}#mermaid-svg-ZHSz9HO2uJyY2vYW .marker.cross{stroke:#333333;}#mermaid-svg-ZHSz9HO2uJyY2vYW svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-ZHSz9HO2uJyY2vYW p{margin:0;}#mermaid-svg-ZHSz9HO2uJyY2vYW .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-ZHSz9HO2uJyY2vYW .cluster-label text{fill:#333;}#mermaid-svg-ZHSz9HO2uJyY2vYW .cluster-label span{color:#333;}#mermaid-svg-ZHSz9HO2uJyY2vYW .cluster-label span p{background-color:transparent;}#mermaid-svg-ZHSz9HO2uJyY2vYW .label text,#mermaid-svg-ZHSz9HO2uJyY2vYW span{fill:#333;color:#333;}#mermaid-svg-ZHSz9HO2uJyY2vYW .node rect,#mermaid-svg-ZHSz9HO2uJyY2vYW .node circle,#mermaid-svg-ZHSz9HO2uJyY2vYW .node ellipse,#mermaid-svg-ZHSz9HO2uJyY2vYW .node polygon,#mermaid-svg-ZHSz9HO2uJyY2vYW .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-ZHSz9HO2uJyY2vYW .rough-node .label text,#mermaid-svg-ZHSz9HO2uJyY2vYW .node .label text,#mermaid-svg-ZHSz9HO2uJyY2vYW .image-shape .label,#mermaid-svg-ZHSz9HO2uJyY2vYW .icon-shape .label{text-anchor:middle;}#mermaid-svg-ZHSz9HO2uJyY2vYW .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-ZHSz9HO2uJyY2vYW .rough-node .label,#mermaid-svg-ZHSz9HO2uJyY2vYW .node .label,#mermaid-svg-ZHSz9HO2uJyY2vYW .image-shape .label,#mermaid-svg-ZHSz9HO2uJyY2vYW .icon-shape .label{text-align:center;}#mermaid-svg-ZHSz9HO2uJyY2vYW .node.clickable{cursor:pointer;}#mermaid-svg-ZHSz9HO2uJyY2vYW .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-ZHSz9HO2uJyY2vYW .arrowheadPath{fill:#333333;}#mermaid-svg-ZHSz9HO2uJyY2vYW .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-ZHSz9HO2uJyY2vYW .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-ZHSz9HO2uJyY2vYW .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-ZHSz9HO2uJyY2vYW .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-ZHSz9HO2uJyY2vYW .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-ZHSz9HO2uJyY2vYW .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-ZHSz9HO2uJyY2vYW .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-ZHSz9HO2uJyY2vYW .cluster text{fill:#333;}#mermaid-svg-ZHSz9HO2uJyY2vYW .cluster span{color:#333;}#mermaid-svg-ZHSz9HO2uJyY2vYW 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-ZHSz9HO2uJyY2vYW .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-ZHSz9HO2uJyY2vYW rect.text{fill:none;stroke-width:0;}#mermaid-svg-ZHSz9HO2uJyY2vYW .icon-shape,#mermaid-svg-ZHSz9HO2uJyY2vYW .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-ZHSz9HO2uJyY2vYW .icon-shape p,#mermaid-svg-ZHSz9HO2uJyY2vYW .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-ZHSz9HO2uJyY2vYW .icon-shape .label rect,#mermaid-svg-ZHSz9HO2uJyY2vYW .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-ZHSz9HO2uJyY2vYW .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-ZHSz9HO2uJyY2vYW .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-ZHSz9HO2uJyY2vYW :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 使用Burp Suite
请求走代理
你可以修改后再发
响应
你可以查看/修改
浏览器
🛑 Burp Suite

拦截代理
服务器
正常访问
直接请求
浏览器
服务器

⚙️ 安装与配置

Step 1: 下载并启动
bash 复制代码
# Mac 用户
brew install --cask burp-suite

# 或从官网下载社区版(免费)
# https://portswigger.net/burp/communitydownload
Step 2: 配置浏览器代理

Burp Suite 默认监听在 127.0.0.1:8080,你需要让浏览器的流量走这个端口:

方法一:使用 FoxyProxy 插件(推荐)

复制代码
1. 安装 Chrome 插件: Proxy SwitchyOmega
2. 新建一个代理情景模式:
   - 代理协议: HTTP
   - 服务器: 127.0.0.1
   - 端口: 8080
3. 点击启用

方法二:手动设置

复制代码
Chrome 设置 → 高级 → 系统 → 打开代理设置
HTTP代理: 127.0.0.1  端口: 8080
Step 3: 安装 CA 证书

为什么要装证书?因为HTTPS流量是加密的,Burp Suite 需要"假装"成目标网站来解密流量。

复制代码
1. 浏览器访问 http://burpsuite
2. 下载 CA Certificate
3. 导入到浏览器: 设置 → 隐私与安全 → 证书管理
4. 选择"受信任的根证书颁发机构",导入下载的证书

🎮 Burp Suite 核心功能速览

#mermaid-svg-Gw7BJBuFY1D80fd9{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-Gw7BJBuFY1D80fd9 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-Gw7BJBuFY1D80fd9 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-Gw7BJBuFY1D80fd9 .error-icon{fill:#552222;}#mermaid-svg-Gw7BJBuFY1D80fd9 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-Gw7BJBuFY1D80fd9 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-Gw7BJBuFY1D80fd9 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-Gw7BJBuFY1D80fd9 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-Gw7BJBuFY1D80fd9 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-Gw7BJBuFY1D80fd9 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-Gw7BJBuFY1D80fd9 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-Gw7BJBuFY1D80fd9 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-Gw7BJBuFY1D80fd9 .marker.cross{stroke:#333333;}#mermaid-svg-Gw7BJBuFY1D80fd9 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-Gw7BJBuFY1D80fd9 p{margin:0;}#mermaid-svg-Gw7BJBuFY1D80fd9 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-Gw7BJBuFY1D80fd9 .cluster-label text{fill:#333;}#mermaid-svg-Gw7BJBuFY1D80fd9 .cluster-label span{color:#333;}#mermaid-svg-Gw7BJBuFY1D80fd9 .cluster-label span p{background-color:transparent;}#mermaid-svg-Gw7BJBuFY1D80fd9 .label text,#mermaid-svg-Gw7BJBuFY1D80fd9 span{fill:#333;color:#333;}#mermaid-svg-Gw7BJBuFY1D80fd9 .node rect,#mermaid-svg-Gw7BJBuFY1D80fd9 .node circle,#mermaid-svg-Gw7BJBuFY1D80fd9 .node ellipse,#mermaid-svg-Gw7BJBuFY1D80fd9 .node polygon,#mermaid-svg-Gw7BJBuFY1D80fd9 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-Gw7BJBuFY1D80fd9 .rough-node .label text,#mermaid-svg-Gw7BJBuFY1D80fd9 .node .label text,#mermaid-svg-Gw7BJBuFY1D80fd9 .image-shape .label,#mermaid-svg-Gw7BJBuFY1D80fd9 .icon-shape .label{text-anchor:middle;}#mermaid-svg-Gw7BJBuFY1D80fd9 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-Gw7BJBuFY1D80fd9 .rough-node .label,#mermaid-svg-Gw7BJBuFY1D80fd9 .node .label,#mermaid-svg-Gw7BJBuFY1D80fd9 .image-shape .label,#mermaid-svg-Gw7BJBuFY1D80fd9 .icon-shape .label{text-align:center;}#mermaid-svg-Gw7BJBuFY1D80fd9 .node.clickable{cursor:pointer;}#mermaid-svg-Gw7BJBuFY1D80fd9 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-Gw7BJBuFY1D80fd9 .arrowheadPath{fill:#333333;}#mermaid-svg-Gw7BJBuFY1D80fd9 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-Gw7BJBuFY1D80fd9 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-Gw7BJBuFY1D80fd9 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-Gw7BJBuFY1D80fd9 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-Gw7BJBuFY1D80fd9 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-Gw7BJBuFY1D80fd9 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-Gw7BJBuFY1D80fd9 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-Gw7BJBuFY1D80fd9 .cluster text{fill:#333;}#mermaid-svg-Gw7BJBuFY1D80fd9 .cluster span{color:#333;}#mermaid-svg-Gw7BJBuFY1D80fd9 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-Gw7BJBuFY1D80fd9 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-Gw7BJBuFY1D80fd9 rect.text{fill:none;stroke-width:0;}#mermaid-svg-Gw7BJBuFY1D80fd9 .icon-shape,#mermaid-svg-Gw7BJBuFY1D80fd9 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-Gw7BJBuFY1D80fd9 .icon-shape p,#mermaid-svg-Gw7BJBuFY1D80fd9 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-Gw7BJBuFY1D80fd9 .icon-shape .label rect,#mermaid-svg-Gw7BJBuFY1D80fd9 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-Gw7BJBuFY1D80fd9 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-Gw7BJBuFY1D80fd9 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-Gw7BJBuFY1D80fd9 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Burp Suite 启动
功能标签页
🔴 Proxy

拦截和修改请求
🎯 Target

站点地图
💥 Intruder

自动化攻击
🔄 Repeater

手动重发请求
🔐 Decoder

编码解码
🔍 Scanner

自动扫描
Intercept: 开启/关闭拦截
HTTP History: 查看所有请求记录
WebSockets: 监控WebSocket
Sniper: 单参数爆破
Battering ram: 多参数同值
Pitchfork: 多参数不同值
Cluster bomb: 组合爆破

🔥 第一次抓包:5分钟上手

让我们做一个小实验,体验一下 Burp Suite 的魔法:
浏览器 www.example.com Burp Suite 你 浏览器 www.example.com Burp Suite 你 #mermaid-svg-8B6JbOcwlliLke4X{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-8B6JbOcwlliLke4X .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-8B6JbOcwlliLke4X .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-8B6JbOcwlliLke4X .error-icon{fill:#552222;}#mermaid-svg-8B6JbOcwlliLke4X .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-8B6JbOcwlliLke4X .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-8B6JbOcwlliLke4X .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-8B6JbOcwlliLke4X .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-8B6JbOcwlliLke4X .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-8B6JbOcwlliLke4X .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-8B6JbOcwlliLke4X .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-8B6JbOcwlliLke4X .marker{fill:#333333;stroke:#333333;}#mermaid-svg-8B6JbOcwlliLke4X .marker.cross{stroke:#333333;}#mermaid-svg-8B6JbOcwlliLke4X svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-8B6JbOcwlliLke4X p{margin:0;}#mermaid-svg-8B6JbOcwlliLke4X .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-8B6JbOcwlliLke4X text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-8B6JbOcwlliLke4X .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-8B6JbOcwlliLke4X .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-8B6JbOcwlliLke4X .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-8B6JbOcwlliLke4X .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-8B6JbOcwlliLke4X #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-8B6JbOcwlliLke4X .sequenceNumber{fill:white;}#mermaid-svg-8B6JbOcwlliLke4X #sequencenumber{fill:#333;}#mermaid-svg-8B6JbOcwlliLke4X #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-8B6JbOcwlliLke4X .messageText{fill:#333;stroke:none;}#mermaid-svg-8B6JbOcwlliLke4X .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-8B6JbOcwlliLke4X .labelText,#mermaid-svg-8B6JbOcwlliLke4X .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-8B6JbOcwlliLke4X .loopText,#mermaid-svg-8B6JbOcwlliLke4X .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-8B6JbOcwlliLke4X .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-8B6JbOcwlliLke4X .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-8B6JbOcwlliLke4X .noteText,#mermaid-svg-8B6JbOcwlliLke4X .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-8B6JbOcwlliLke4X .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-8B6JbOcwlliLke4X .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-8B6JbOcwlliLke4X .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-8B6JbOcwlliLke4X .actorPopupMenu{position:absolute;}#mermaid-svg-8B6JbOcwlliLke4X .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-8B6JbOcwlliLke4X .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-8B6JbOcwlliLke4X .actor-man circle,#mermaid-svg-8B6JbOcwlliLke4X line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-8B6JbOcwlliLke4X :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 1. 开启拦截 (Intercept is on) 2. 在地址栏输入 www.example.com 3. 请求被拦截 ✋ 4. 在Proxy Intercept看到请求包 5. 点击 Forward 放行 6. 请求被发送到网站 7. 返回响应 8. 响应也被拦截! 9. Forward 放行 10. 页面显示出来了!

尝试修改请求

复制代码
在步骤 4-5 之间:
1. 找到请求行: GET / HTTP/1.1
2. 修改为: GET /admin HTTP/1.1 (试试看)
3. 点击 Forward → 看看返回什么
4. 你可能会看到 403(禁止访问)或 404(未找到)

🔬 实验说明 :这个简单的修改操作,就是一种最基本的安全测试------目录遍历探测。高端的攻击往往源于最基础的尝试!

🔄 Repeater 基础

当你发现一个感兴趣的请求,可以把它发送到 Repeater,反复修改和重放:

复制代码
操作步骤:
1. 在 Proxy → HTTP History 中找到一个请求
2. 右键 → Send to Repeater (快捷键 Ctrl+R)
3. 转到 Repeater 标签页
4. 修改请求(比如加一个参数、改一个值)
5. 点击 Send(快捷键 Ctrl+Enter)
6. 查看右侧的响应结果

2.4 Chrome 开发者工具 --- 你的另外一把武器

Burp Suite 拦截网络流量,开发者工具帮你分析页面内部。两者配合使用效果更佳。

🛠️ 打开方式

复制代码
Mac:  Cmd + Option + I
Win:  Ctrl + Shift + I
或者: 右键 → 检查

📋 安全测试常用的4个面板

面板 快捷键 用途
Elements Cmd+Shift+C 查看页面HTML,找到表单字段的隐藏值
Console Cmd+Shift+J 执行JS代码,查看错误信息
Network Cmd+Shift+E 查看所有网络请求的详情
Sources Cmd+Shift+S 查看JS源码,找API密钥等

💡 实操场景

场景:你想看看登录按钮点了之后,后台到底发送了什么请求
服务器 浏览器 你 服务器 浏览器 你 #mermaid-svg-PrmPQgJfUa5x0o59{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-PrmPQgJfUa5x0o59 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-PrmPQgJfUa5x0o59 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-PrmPQgJfUa5x0o59 .error-icon{fill:#552222;}#mermaid-svg-PrmPQgJfUa5x0o59 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-PrmPQgJfUa5x0o59 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-PrmPQgJfUa5x0o59 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-PrmPQgJfUa5x0o59 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-PrmPQgJfUa5x0o59 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-PrmPQgJfUa5x0o59 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-PrmPQgJfUa5x0o59 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-PrmPQgJfUa5x0o59 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-PrmPQgJfUa5x0o59 .marker.cross{stroke:#333333;}#mermaid-svg-PrmPQgJfUa5x0o59 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-PrmPQgJfUa5x0o59 p{margin:0;}#mermaid-svg-PrmPQgJfUa5x0o59 .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-PrmPQgJfUa5x0o59 text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-PrmPQgJfUa5x0o59 .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-PrmPQgJfUa5x0o59 .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-PrmPQgJfUa5x0o59 .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-PrmPQgJfUa5x0o59 .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-PrmPQgJfUa5x0o59 #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-PrmPQgJfUa5x0o59 .sequenceNumber{fill:white;}#mermaid-svg-PrmPQgJfUa5x0o59 #sequencenumber{fill:#333;}#mermaid-svg-PrmPQgJfUa5x0o59 #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-PrmPQgJfUa5x0o59 .messageText{fill:#333;stroke:none;}#mermaid-svg-PrmPQgJfUa5x0o59 .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-PrmPQgJfUa5x0o59 .labelText,#mermaid-svg-PrmPQgJfUa5x0o59 .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-PrmPQgJfUa5x0o59 .loopText,#mermaid-svg-PrmPQgJfUa5x0o59 .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-PrmPQgJfUa5x0o59 .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-PrmPQgJfUa5x0o59 .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-PrmPQgJfUa5x0o59 .noteText,#mermaid-svg-PrmPQgJfUa5x0o59 .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-PrmPQgJfUa5x0o59 .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-PrmPQgJfUa5x0o59 .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-PrmPQgJfUa5x0o59 .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-PrmPQgJfUa5x0o59 .actorPopupMenu{position:absolute;}#mermaid-svg-PrmPQgJfUa5x0o59 .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-PrmPQgJfUa5x0o59 .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-PrmPQgJfUa5x0o59 .actor-man circle,#mermaid-svg-PrmPQgJfUa5x0o59 line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-PrmPQgJfUa5x0o59 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 打开开发者工具 → Network 勾选"Preserve log" 在登录页面输入账号密码,点击登录 POST /login HTTP/1.1 (Network面板记录下这个请求) 200 OK, Set-Cookie: session=xxx 在Network面板看到完整请求详情 查看请求头、请求体、响应体 发现密码是明文传输的!⚠️

🗣️ 作者说:很多安全漏洞在 Chrome 开发者工具中就能发现------明文传输密码、隐藏的API接口、注释中的敏感信息、前端的验证逻辑...这些都逃不过 Network 面板的"火眼金睛"。


2.5 初识常用命令行工具

作为一个安全测试人员,命令行是你的良配。你可能不常用它,但在某些场景下(比如没有图形界面、需要批量操作),命令行是最快的。

🖥️ 基础命令速查

bash 复制代码
# 网络相关
ping target.com              # 测试目标是否可达
curl -v http://target.com    # 发送HTTP请求,显示详细信息
wget http://target.com/file  # 下载文件
nc -v target.com 80          # Netcat - "TCP/IP的瑞士军刀"

# 信息收集
nslookup target.com          # DNS查询
whois target.com             # 域名信息查询

# 系统命令
ifconfig / ipconfig          # 查看IP配置
netstat -an                  # 查看端口监听状态

🐍 Python 一行代码 = 一个工具

python 复制代码
# 启动一个简单的HTTP服务器(在本地分享文件)
python3 -m http.server 8888

# 发送一个HTTP请求
python3 -c "import requests; print(requests.get('http://target.com').text)"

📝 本章小结

#mermaid-svg-YJhsxVG35R5BQ1Wn{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-YJhsxVG35R5BQ1Wn .error-icon{fill:#552222;}#mermaid-svg-YJhsxVG35R5BQ1Wn .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-YJhsxVG35R5BQ1Wn .marker{fill:#333333;stroke:#333333;}#mermaid-svg-YJhsxVG35R5BQ1Wn .marker.cross{stroke:#333333;}#mermaid-svg-YJhsxVG35R5BQ1Wn svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-YJhsxVG35R5BQ1Wn p{margin:0;}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge{stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section--1 rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section--1 path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section--1 circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section--1 polygon,#mermaid-svg-YJhsxVG35R5BQ1Wn .section--1 path{fill:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section--1 text{fill:#ffffff;}#mermaid-svg-YJhsxVG35R5BQ1Wn .node-icon--1{font-size:40px;color:#ffffff;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-edge--1{stroke:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-depth--1{stroke-width:17;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section--1 line{stroke:hsl(60, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:lightgray;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:#efefef;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-0 rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-0 path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-0 circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-0 polygon,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-0 path{fill:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-0 text{fill:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .node-icon-0{font-size:40px;color:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-edge-0{stroke:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-depth-0{stroke-width:14;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-0 line{stroke:hsl(240, 100%, 83.5294117647%);stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:lightgray;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:#efefef;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-1 rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-1 path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-1 circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-1 polygon,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-1 path{fill:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-1 text{fill:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .node-icon-1{font-size:40px;color:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-edge-1{stroke:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-depth-1{stroke-width:11;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-1 line{stroke:hsl(260, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:lightgray;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:#efefef;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-2 rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-2 path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-2 circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-2 polygon,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-2 path{fill:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-2 text{fill:#ffffff;}#mermaid-svg-YJhsxVG35R5BQ1Wn .node-icon-2{font-size:40px;color:#ffffff;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-edge-2{stroke:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-depth-2{stroke-width:8;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-2 line{stroke:hsl(90, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:lightgray;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:#efefef;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-3 rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-3 path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-3 circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-3 polygon,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-3 path{fill:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-3 text{fill:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .node-icon-3{font-size:40px;color:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-edge-3{stroke:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-depth-3{stroke-width:5;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-3 line{stroke:hsl(120, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:lightgray;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:#efefef;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-4 rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-4 path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-4 circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-4 polygon,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-4 path{fill:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-4 text{fill:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .node-icon-4{font-size:40px;color:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-edge-4{stroke:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-depth-4{stroke-width:2;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-4 line{stroke:hsl(150, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:lightgray;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:#efefef;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-5 rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-5 path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-5 circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-5 polygon,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-5 path{fill:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-5 text{fill:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .node-icon-5{font-size:40px;color:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-edge-5{stroke:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-depth-5{stroke-width:-1;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-5 line{stroke:hsl(180, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:lightgray;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:#efefef;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-6 rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-6 path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-6 circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-6 polygon,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-6 path{fill:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-6 text{fill:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .node-icon-6{font-size:40px;color:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-edge-6{stroke:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-depth-6{stroke-width:-4;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-6 line{stroke:hsl(210, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:lightgray;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:#efefef;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-7 rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-7 path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-7 circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-7 polygon,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-7 path{fill:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-7 text{fill:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .node-icon-7{font-size:40px;color:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-edge-7{stroke:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-depth-7{stroke-width:-7;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-7 line{stroke:hsl(270, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:lightgray;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:#efefef;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-8 rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-8 path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-8 circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-8 polygon,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-8 path{fill:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-8 text{fill:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .node-icon-8{font-size:40px;color:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-edge-8{stroke:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-depth-8{stroke-width:-10;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-8 line{stroke:hsl(330, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:lightgray;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:#efefef;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-9 rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-9 path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-9 circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-9 polygon,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-9 path{fill:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-9 text{fill:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .node-icon-9{font-size:40px;color:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-edge-9{stroke:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-depth-9{stroke-width:-13;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-9 line{stroke:hsl(0, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:lightgray;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:#efefef;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-10 rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-10 path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-10 circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-10 polygon,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-10 path{fill:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-10 text{fill:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .node-icon-10{font-size:40px;color:black;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-edge-10{stroke:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge-depth-10{stroke-width:-16;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-10 line{stroke:hsl(30, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:lightgray;}#mermaid-svg-YJhsxVG35R5BQ1Wn .disabled text{fill:#efefef;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-root rect,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-root path,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-root circle,#mermaid-svg-YJhsxVG35R5BQ1Wn .section-root polygon{fill:hsl(240, 100%, 46.2745098039%);}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-root text{fill:#ffffff;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-root span{color:#ffffff;}#mermaid-svg-YJhsxVG35R5BQ1Wn .section-2 span{color:#ffffff;}#mermaid-svg-YJhsxVG35R5BQ1Wn .icon-container{height:100%;display:flex;justify-content:center;align-items:center;}#mermaid-svg-YJhsxVG35R5BQ1Wn .edge{fill:none;}#mermaid-svg-YJhsxVG35R5BQ1Wn .mindmap-node-label{dy:1em;alignment-baseline:middle;text-anchor:middle;dominant-baseline:middle;text-align:center;}#mermaid-svg-YJhsxVG35R5BQ1Wn :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 环境与工具
HTTP基础
请求结构
方法与状态码
Cookie与Session
Burp Suite
拦截代理-抓包改包
Repeater-重放请求
Intruder-自动化攻击
配置浏览器代理
Chrome DevTools
Network面板-抓请求
Elements-改页面
Console-执行脚本
实验室搭建
Kali Linux-攻击机
DVWA-靶机
WebGoat-在线练习

✅ 你应该能做到了

  • 理解HTTP请求/响应的结构
  • 配置 Burp Suite 并成功抓包
  • 使用 Repeater 修改和重放请求
  • 使用 Chrome 开发者工具查看网络请求
  • 知道几种搭建靶场的途径

🧠 本章练习

练习1:第一次抓包

  1. 打开 Burp Suite,配置代理

  2. 访问 http://example.com

  3. 在 Proxy → HTTP History 中找到这个请求

  4. 把请求发送到 Repeater

  5. 修改 User-Agent 为 "Hacker/1.0"

  6. 发送并观察响应
    练习2:用开发者工具发现敏感信息

  7. 打开任意常用网站(比如百度)

  8. 打开开发者工具 → Network

  9. 刷新页面,观察所有请求

  10. 有没有看到"token"、"key"、"secret"这类关键词?

  11. 查看 Cookie 中有没有 HttpOnly 和 Secure 标记


继续下一章 → OWASP Top 10 详解(上):注入类漏洞


📎 相关链接

相关推荐
Joker时代3 小时前
重塑Web3安全防线:Vkey验证器正式登陆安卓与iOS平台,开启数字资产防护新纪元
安全·web3
科技发布3 小时前
有没有安全正规的广告交易平台?推荐传播易APP
安全
JL153 小时前
Agent工程-为什么Agent必须有观测和Tracing
服务器·网络·人工智能·安全
GoFly开发者5 小时前
Go语言开发框架GoFlyGen新增 网站安全助手 插件,帮助开发者提供应用安全防护,保障平台系统数据安全。
网络·安全
笺落彼岸5 小时前
SpringBoot3 JDK17集成proguard实现混淆打包
安全·https
甄同学6 小时前
第十七篇:Bash Executor命令执行器,安全运行Shell命令
开发语言·安全·bash
h3guang Official6 小时前
K8s安全实战:从漏洞靶场到红蓝对抗
安全·容器·kubernetes
星释8 小时前
鸿蒙智能体开发实战:29.智能体安全与成本优化
服务器·安全·华为·harmonyos·鸿蒙·智能体
数据知道8 小时前
DNS 安全攻防:缓存投毒、DNS 隧道与检测实战
安全·网络安全·缓存·缓存投毒