Burp 3.2.0 burp 命令行与运维实操
在 Burp 3.2.0 双机实测环境逐条验证 burp 命令行与运维操作:-a 动作族(b 备份/r 恢复/t 裁决/l 清单/d 比对/v 校验/e 估算/delete 删除)、-c 多身份切换、-o 覆写、-t 试跑与退出码表、-a S/s/m 监控三件套与原生 JSON 请求协议、burp_ca 证书签发/吊销/CRL 重建、日志文件族解读与错误速查排障实录(实测日期 2026-10-24)
Burp 3.2.0 burp 命令行与运维实操
目标:系统实操 burp 3.2.0(grke/burp,开源 C/S 架构网络备份恢复工具,注意与 PortSwigger 的 Burp Suite 同名异物)的命令行工具集:
burp -a动作族(备份/定时/恢复/清单/比对/校验/估算/删除)逐个给出真实回显,-c/-o/-t全局选项、burp_ca证书签发与吊销、-a S/-a s/-a m三种监控交互、服务端日志文件族与错误码速查全部实测沉淀。全部命令与输出均为 2026-10-24 在两台 Ubuntu 22.04 服务器(备份服务器 10.89.68.2、客户端服务器 10.89.68.3,burp 3.2.0 源码编译安装)上实测所得,逐行照抄。
一、环境信息
- 操作系统:Ubuntu 22.04.5 LTS,两台:备份服务器
10.89.68.2(burp 服务端 + 内置 CA)、客户端服务器10.89.68.3(burp 客户端,配置了 client1 与 client2 两个客户端身份) - 软件版本:burp 3.2.0(
burp -V实测输出burp-3.2.0);可执行文件/usr/sbin/burp、/usr/sbin/burp_ca - 客户端身份与备份池起点(本篇实测开始时 client1 已有备份):
0000006(deletable)、0000007(current);client2 已有0000001 - 端口:4971(数据)、4972(状态监控)
- 配置文件:服务端
/etc/burp/burp-server.conf与/etc/burp/clientconfdir/;客户端/etc/burp/burp.conf(client1)与/etc/burp/burp-client2.conf(client2) - 实测日期:2026-10-24;配置参数逐项解析见《Burp 3.2.0 配置参数详解》,安装与环境搭建见《Burp 3.2.0 安装与运行实测指南》
- 说明:本篇各命令的回显采集自同一套环境的实测过程,时间戳以回显原文为准(不同小节之间存在先后推进,备份编号以当次回显为准)
二、工具概览
burp 安装后提供两个命令行工具,分工明确:
| 工具 | 路径 | 职责 |
|---|---|---|
burp | /usr/sbin/burp | 主程序:mode = server 时为守护进程,mode = client 时执行 -a 动作族与监控 |
burp_ca | /usr/sbin/burp_ca | 证书操作脚本:CA 初始化、密钥/CSR 生成、签发、吊销、CRL、DH 参数 |
burp -h 全文实测(这是后续所有小节的参数总纲):
The configuration file specifies whether burp runs in server or client mode.
Server usage: burp [options]
Options:
-c <path> Path to conf file (default: /etc/burp/burp.conf).
-d <path> a single client in the status monitor.
-o <option> Override a given configuration option
(you can use this flag several times).
-F Stay in the foreground.
-g Generate initial CA certificates and exit.
-h|-? Print this text and exit.
-i Print index of symbols and exit.
-n Do not fork any children (implies '-F').
-Q Do not log to stdout
-t Dry-run to test config file syntax.
-v Log to stdout.
-V Print version and exit.
Options to use with '-a c':
-C <client> Run as if forked via a connection from this client.
Client usage: burp [options]
Options:
-a <action> The action can be one of the following.
b: backup
delete: delete
d: diff
e: estimate
l: list (this is the default when an action is not given)
L: long list
m: monitor interface
p: parseable list
r: restore
R: Restore (matching ordered paths on stdin)
s: status monitor (ncurses)
S: status monitor snapshot
t: timed backup
T: check backup timer, but do not actually backup
v: verify
V: Verify (matching ordered paths on stdin)
-b <number> Backup number (default: the most recent backup).
-c <path> Path to conf file (default: /etc/burp/burp.conf).
-d <directory> Directory to restore to, or directory to list.
-o <option> Override a given configuration option (you can use this flag several times).
-f Allow overwrite during restore.
-h|-? Print this text and exit.
-i Print index of symbols and exit.
-q <max secs> Randomised delay of starting a timed backup.
-Q Do not log to stdout
-r|-R <regex> Specify a regular expression (case sensitive or insensitive.
-s <number> Number of leading path components to strip during restore.
-t Dry-run to test config file syntax.
-V Print version and exit.
-v Log to stdout.
-x Strip Windows VSS data when restoring.
Options to use with '-a S':
-C <client> Show a particular client.
-b <number> Show listable files in a particular backup (requires -C).
-d <path> Show a particular path in a backup (requires -C and -b).
-l <path> Log file for the status monitor.
-z <file> Dump a particular log file in a backup (requires -C and -b).
See http://burp.grke.net/ or the man page ('man burp') for usage examples
and additional configuration options.
退出码速查(源码自带 systemd 客户端单元 burp-client.service 注释原文,配合 5.2/5.3 节实测):
| 退出码 | 含义 | 运维动作 |
|---|---|---|
| 0 | 成功(含 timer 裁决通过后的备份完成) | 无 |
| 1 | 出错(认证失败、证书校验失败、参数错误等) | 按报错行定位(见第九章速查表) |
| 2 | 恢复完成但有告警 | 核对恢复清单 |
| 3 | timer 条件不满足(-a t/-a T) | 正常现象,等待时间带 |
| 4 | 无法连接服务端 | 查服务端进程/端口/防火墙 |
| 5 | 并发备份已达上限(max_children) | 错峰或调大 max_children |
💡 技术拓展:
burp -a的"动词式"动作族与同类备份工具的 CLI 组织方式对比:
工具 CLI 形态 示例 burp 单命令 + -a动作 + 单字母选项burp -a r -b 3 -d /tmpBorgBackup 动词式子命令 borg extract repo::archrestic 动词式子命令 restic restore latest --target /tmpUrBackup 客户端 ctl 工具 + Web 端操作 urbackupclientctl restore-startburp 实际采用单命令动作族形态,所有动作共用同一份客户端配置与证书,切换动作只改
-a值。
三、前置条件
- 服务端守护进程运行、双端口监听(本篇沿用《Burp 3.2.0 配置参数详解》验证过的环境):
ss -lntp | grep -E '4971|4972'
实测回显:
LISTEN 0 5 0.0.0.0:4972 0.0.0.0:* users:(("burp",pid=9661,fd=4))
LISTEN 0 5 0.0.0.0:4971 0.0.0.0:* users:(("burp",pid=9661,fd=2))
- 客户端已配置并与服务端完成证书互信。验证(
-V与裸burp):
burp -V
burp
实测回显:
burp-3.2.0
Backup: 0000006 2026-10-24 08:19:17 +0000 (deletable)
Backup: 0000007 2026-10-24 10:17:54 +0000
2026-10-24 10:30:45 +0000: burp[3625] main socket 3: Peer closed SSL session
2026-10-24 10:30:45 +0000: burp[3625] List finished ok
注意裸 burp(不带任何参数)的输出:它用默认配置 /etc/burp/burp.conf 执行了默认动作 l(帮助文本明示 "l: list (this is the default when an action is not given)"),列出 client1 当前的两个备份。
四、全局选项详解
4.1 -c:指定配置文件(多客户端身份的关键)
-c 指定配置文件路径,默认 /etc/burp/burp.conf。实测环境在一台客户端机上配了两个客户端身份(client1 用默认 burp.conf,client2 用独立配置 cname = client2、独立证书与 ca_csr_dir),切换身份只换 -c:
burp -c /etc/burp/burp-client2.conf -a l
实测回显:
2026-10-24 10:30:45 +0000: burp[3628] auth ok
Backup: 0000001 2026-10-24 07:02:45 +0000 (deletable)
2026-10-24 10:30:45 +0000: burp[3628] List finished ok
同一台机器、同一份二进制,-c 指向不同 conf 即以 client2 身份列出 client2 的备份池。要点:每个身份的 cname/password/证书路径/ca_csr_dir 必须完全独立(多身份配置细节见《Burp 3.2.0 配置参数详解》第六章)。
4.2 -o:命令行覆写配置项
-o 键=值 临时覆写配置,可叠加多个,与 -a 动作组合即可"临时换个参数跑一次"。实测把备份范围临时换成 /etc 做估算:
burp -o include=/etc -a e
实测回显(节选):
Scanned
Grand total: 361
Bytes estimated: 438262 (427.99 KB)
对照默认范围(include = /home)的估算:
burp -a e
实测回显(节选):
Grand total: 9
Bytes estimated: 153712 (150.11 KB)
同一动作、不同 -o 范围,扫描对象从 9 项变成 361 项——覆写真实生效。注意语义:单值键 -o 是替换、可重复键(如 keep、include)是追加(实测证据见《Burp 3.2.0 配置参数详解》3.2 节)。
4.3 -t / -V / 服务端专属选项
-t:配置试跑,只解析配置并打印全部生效参数值,不启动服务(完整回显与用法见《Burp 3.2.0 配置参数详解》第三章);-V:打印版本(burp-3.2.0);-h|-?:打印帮助(第二章全文);- 服务端进程选项:
-F前台运行(systemd 托管时由单元文件使用,见 B1 篇 4.6 节)、-n不 fork 子进程(调试用,隐含-F)、-g生成初始 CA 证书后退出(首次启动前执行,实测无输出、退出码 0)、-Q不写 stdout、-v写 stdout(配合stdout配置项控制日志去向); -i:打印协议符号索引(协议排障时用,日常少用)。
五、备份与恢复动作族详解
5.1 -a b:手动备份(含差量验证)
-a b 立即执行一次备份(不走 timer 裁决;需服务端 client_can_force_backup = 1)。首次备份(客户端证书尚未生成时会自动走 CSR 签发,完整握手回显见《Burp 3.2.0 安装与运行实测指南》7.2 节):
burp -a b
实测回显(统计节选):
--------------------------------------------------------------------------------
Start time: 2026-10-24 06:51:37
End time: 2026-10-24 06:51:38
Time taken: 00:01
New Changed Duplicate Deleted Total | Scanned
------------------------------------------------------------
Files: 2 0 0 0 2 | 2
Meta data: 0 0 0 0 0 | 1
Directories: 0 0 0 0 0 | 2
Grand total: 2 0 0 0 2 | 5
------------------------------------------------------------
Messages: 0
Warnings: 1
Bytes estimated: 102414 (100.01 KB)
Bytes in backup: 102414 (100.01 KB)
Bytes received: 560
Bytes sent: 104053 (101.61 KB)
--------------------------------------------------------------------------------
2026-10-24 06:51:38 +0000: burp[2736] Phase 2 end (send file data)
2026-10-24 06:51:38 +0000: burp[2736] backup finished ok
改动文件后再次执行,差量效果:
New Changed Duplicate Deleted Total | Scanned
------------------------------------------------------------
Files: 0 2 0 0 2 | 2
Meta data: 0 0 0 0 0 | 1
Directories: 0 0 0 0 0 | 2
Grand total: 2 2 0 0 4 | 5
------------------------------------------------------------
Bytes estimated: 153630 (150.03 KB)
Bytes in backup: 153630 (150.03 KB)
Bytes received: 8695 (8.49 KB)
Bytes sent: 104065 (101.63 KB)
--------------------------------------------------------------------------------
2026-10-24 06:52:08 +0000: burp[2777] backup finished ok
解读:约 150KB 数据改动后网络仅收 8.49KB——librsync 只传变化块;统计表六列(New/Changed/Duplicate/Deleted/Total/Scanned)是判断每次备份"干了多少活"的第一入口;backup finished ok 为成功标志。
5.2 -a t / -a T:定时备份与裁决试探
生产节奏由"客户端定时来问、服务端 timer 裁决"驱动:-a t 请求定时备份(裁决通过当场备份),-a T 只裁决不备份。服务端当前规则 timer_arg = 0h + timer_arg = always 时:
burp -a T
实测回显与退出码:
2026-10-24 10:18:20 +0000: burp[3452] Timer conditions on the server were met
EXITCODE=0
服务端把最小间隔改成 timer_arg = 20h 后(距上次备份 1 分钟):
2026-10-24 10:18:19 +0000: burp[3444] Timer conditions on the server were not met
EXITCODE=3
-a t 在裁决通过后直接产出备份(统计节选):
Start time: 2026-10-24 08:16:54
End time: 2026-10-24 08:16:54
Time taken: 00:00
New Changed Duplicate Deleted Total | Scanned
------------------------------------------------------------
Files: 0 0 0 0 0 | 3
Meta data: 0 0 0 0 0 | 1
Directories: 0 0 0 0 0 | 3
Grand total: 0 0 0 0 0 | 7
------------------------------------------------------------
Bytes estimated: 153661 (150.06 KB)
Bytes in backup: 0
Bytes received: 370
Bytes sent: 1394 (1.36 KB)
--------------------------------------------------------------------------------
2026-10-24 08:16:54 +0000: burp[3153] backup finished ok
注意"零变化也生成新备份"(Grand total: 0、Bytes in backup: 0 但清单多了一条)——burp 的每次 -a t 通过都会落一个备份点。-q <秒> 可在客户端侧加随机延迟(如 burp -q 1200 -a t),与服务端 randomise 配置等效。定时托管的 cron/systemd 落地方式见 B1 篇 7.6 节。
5.3 -a r:恢复(-d 落点 / -f 覆盖 / -s 剥离 / -r 正则)
基本恢复(最近备份 → 指定目录):
burp -a r -d /root/restore_test
实测回显:
Attempted | Expected
------------------------------
Files: 3 | 3
Directories: 3 | 3
Grand total: 6 | 6
------------------------------
Messages: 0
Warnings: 0
Bytes estimated: 153661 (150.06 KB)
Bytes attempted: 0
Bytes received: 157377 (153.69 KB)
Bytes sent: 677
--------------------------------------------------------------------------------
2026-10-24 08:15:26 +0000: burp[3144] restore finished
核对恢复产物与一致性:
ls -lR /root/restore_test
md5sum /home/client1/hello.txt /root/restore_test/home/client1/hello.txt
实测回显(节选):
/root/restore_test/home/client1:
total 156
-rw-r--r-- 1 root root 153600 Oct 24 06:52 data.bin
-rw-r--r-- 1 root root 48 Oct 24 07:08 hello.txt
b2a4b24e948d8abf5a78fe908819abe9 /home/client1/hello.txt
b2a4b24e948d8abf5a78fe908819abe9 /root/restore_test/home/client1/hello.txt
重复恢复与 -f 覆盖对照实测:目录里已有同名文件时,不带 -f 再恢复一次:
burp -a r -d /root/restore_test
实测回显(节选):
2026-10-24 10:21:01 +0000: burp[3589] WARNING: Path exists: /root/restore_test/home/client1/data.bin
2026-10-24 10:21:01 +0000: burp[3589] WARNING: Path exists: /root/restore_test/home/client1/hello.txt
2026-10-24 10:21:01 +0000: burp[3589] WARNING: Path exists: /root/restore_test/home/client2/c2.txt
Files: 2 | 5
Directories: 3 | 3
2026-10-24 10:21:01 +0000: burp[3589] restore finished
已存在的文件逐个报 WARNING: Path exists 并跳过(Attempted 2/5,只恢复了新增文件)。加 -f 再恢复:
burp -a r -f -d /root/restore_test
实测回显(节选):
Files: 5 | 5
Directories: 3 | 3
2026-10-24 10:21:01 +0000: burp[3592] restore finished
5/5 全量覆盖恢复。
-s 剥离前缀路径实测:备份内路径为 /home/client1/hello.txt,剥离前 2 级路径组件(-s 2)恢复:
rm -rf /root/strip_test
burp -a r -d /root/strip_test -s 2 -r "hello.txt"
ls -lR /root/strip_test
实测回显:
Files: 1 | 1
2026-10-24 10:21:01 +0000: burp[3596] restore finished
/root/strip_test:
total 4
drwxr-xr-x 2 root root 4096 Oct 24 10:21 client1
/root/strip_test/client1:
total 4
-rw-r--r-- 1 root root 48 Oct 24 07:08 hello.txt
/home/client1/hello.txt 剥掉 home/ 两级后落为 /root/strip_test/client1/hello.txt。-r <regex> 限定只恢复匹配项(配合 -b <编号> 可恢复历史时点,如 burp -a r -b 6 -d /tmp/b6);Windows 客户端恢复时另有 -x 剥离 VSS 数据。
5.4 服务端发起恢复与跨客户端恢复
方式一:restore 指令文件(客户端下次连接时自动执行)。 服务端在 /var/spool/burp/client1/ 写一个名为 restore 的指令文件:
cat > /var/spool/burp/client1/restore <<'EOF'
backup = 6
regex = hello.txt
overwrite = 1
EOF
客户端下次连接(实测以 -a l 触发)即自动执行恢复,回显(节选):
Bytes estimated: 48
Bytes attempted: 0
Bytes received: 2642 (2.58 KB)
Bytes sent: 579
--------------------------------------------------------------------------------
2026-10-24 08:41:51 +0000: burp[3341] restore finished
指令文件随即被服务端消费删除(实测 ls /var/spool/burp/client1/ 中 restore 消失),恢复产物落在客户端 restoreprefix = /root/server_restore 下:
/root/server_restore/home/client1:
total 4
-rw-r--r-- 1 root root 48 Oct 24 07:08 hello.txt
---md5---
b2a4b24e948d8abf5a78fe908819abe9 /home/client1/hello.txt
b2a4b24e948d8abf5a78fe908819abe9 /root/server_restore/home/client1/hello.txt
方式二:服务端以 -a r -C <client> 主动发起(连状态口 4972)。在备份服务器上以 client1 的 super_client/restore 权限直接恢复 client2 的数据:
burp -c /etc/burp/burp-server.conf -a r -C client2 -r c2.txt
实测回显(节选):
2026-10-24 08:20:33 +0000: burp[9317] No backup specified. Using the most recent.
未指定 -b 时自动取最近备份。客户端侧以 super_client 身份跨客户端恢复的完整实测(含 client2 数据落到本机):
burp -a r -C client2 -d /root/restore_c2
实测回显(统计节选):
Files: 3 | 3
Directories: 3 | 3
Grand total: 6 | 6
2026-10-24 08:16:55 +0000: burp[3161] restore finished
跨客户端能力由服务端 super_client/server_can_restore/restoreprefix 三项参数管控(配置语义见《Burp 3.2.0 配置参数详解》5.6/6.4 节)。
5.5 -a delete:删除指定备份
burp -a delete -b 4
实测回显(节选):
2026-10-24 08:16:54 +0000: burp[3157] SSL is using cipher: TLS_AES_256_GCM_SHA384 TLSv1.3 Kx=any Au=any Enc=AESGCM(256) Mac=AEAD
2026-10-24 08:16:54 +0000: burp[3157] Deletion in progress
删除是异步的(Deletion in progress),随后 -a l 确认该编号消失:
Backup: 0000005 2026-10-24 08:16:54 +0000 (deletable)
要点:client_can_delete = 0 时该动作被服务端拒绝;-b 编号必须存在(否则见 9.4 节错误 e:0020);(deletable) 标记表示该备份当前可被保留策略或手动删除。
六、清单、比对与校验动作详解
6.1 -a l / -a L / -a p:三种清单形态
短清单(备份池级)与指定编号:
burp -a l
burp -a l -b 6
实测回显:
Backup: 0000006 2026-10-24 08:19:17 +0000 (deletable)
Backup: 0000007 2026-10-24 10:17:54 +0000
备份内目录清单(-b 编号 -d 路径):
burp -a l -b 6 -d /home/client1
实测回显:
Backup: 0000006 2026-10-24 08:19:17 +0000
Listing directory: /home/client1
.
data.bin
hello.txt
newfile.txt
长格式 -a L(带权限/属主/大小/时间):
burp -a L -b 6 -d /home/client1
实测回显:
Backup: 0000006 2026-10-24 08:19:17 +0000
Listing directory: /home/client1
drwxr-xr-x 2 0 0 4096 2026-10-24 08:19:17 .
-rw-r--r-- 1 0 0 153600 2026-10-24 06:52:07 data.bin
-rw-r--r-- 1 0 0 48 2026-10-24 07:08:32 hello.txt
-rw-r--r-- 1 0 0 22 2026-10-24 08:19:17 newfile.txt
可解析清单 -a p(首字母是类型码:f=文件、d=目录、m=元数据,后接十六进制序号,便于脚本处理):
burp -a p -b 6 -d /home/client1
实测回显:
f000D.
f0016data.bin
f0017hello.txt
f0019newfile.txt
三种形态怎么选:人工浏览用 l/L,脚本提取用 p(实测早期版本的整池输出样例):
f0005/home
f000D/home/client1
f0016/home/client1/data.bin
f0017/home/client1/hello.txt
f000D/home/client2
f0014/home/client2/c2.txt
6.2 -a d:两个备份间差量比对
-a d 必须给两个 -b 编号,输出 -/+/~ 行表示删除/新增/变更:
burp -a d -b 6 -b 5
实测回显:
Backup: 0000005 2026-10-24 08:16:54 +0000
- /home/client1
+ /home/client1
- /home/client1/newfile.txt
2026-10-24 08:19:18 +0000: burp[3195] main socket 3: Peer closed SSL session
2026-10-24 08:19:18 +0000: burp[3195] List finished ok
解读:以第一个 -b(6)为基准对第二个(5):- 行表示 6 里有而 5 里没有(newfile.txt 是 5 之后新增),目录条目的 -/+ 是对比期间的目录元数据差异。更早一次同型实测(改文件内容场景,-a d -b 2 -b 1):
Backup: 0000001 2026-10-24 06:51:37 +0000
Backup: 0000002 2026-10-24 06:52:08 +0000
- /home/client1/data.bin
+ /home/client1/data.bin
- /home/client1/hello.txt
+ /home/client1/hello.txt
2026-10-24 06:58:08 +0000: burp[2923] List finished ok
只给一个 -b 会报错(排障实录见 9.4 节)。
6.3 -a v / -a V:完整性校验
全量校验(默认最近备份):
burp -a v
实测回显:
Files: 3 | 3
Directories: 3 | 3
Grand total: 6 | 6
------------------------------
Messages: 0
Warnings: 0
Bytes estimated: 153661 (150.06 KB)
Bytes checked: 0
Bytes received: 3283 (3.21 KB)
Bytes sent: 676
--------------------------------------------------------------------------------
2026-10-24 08:14:46 +0000: burp[3126] verify finished
指定编号 + 正则的定点校验(-b 5 -r hello.txt):
Warnings: 0
Bytes estimated: 48
Bytes checked: 0
Bytes received: 2439 (2.38 KB)
Bytes sent: 707
--------------------------------------------------------------------------------
2026-10-24 08:18:40 +0000: burp[3185] verify finished
-a V(stdin 传入路径清单校验):从标准输入按行读路径,逐条校验(实测校验 /home/client1/hello.txt):
printf "/home/client1/hello.txt\n" | burp -a V -b 7
实测回显:
2026-10-24 10:19:20 +0000: burp[3511] Doing verify restore_list 7:
2026-10-24 10:19:20 +0000: burp[3511] Reading from: '/dev/stdin'
2026-10-24 10:19:20 +0000: burp[3511] Sent /dev/stdin
2026-10-24 10:19:20 +0000: burp[3511] Doing verify confirmed
Attempted | Expected
------------------------------
Directories: 1 | 1
Grand total: 1 | 1
------------------------------
Messages: 0
Warnings: 0
Bytes received: 2187 (2.14 KB)
Bytes sent: 751
--------------------------------------------------------------------------------
2026-10-24 10:19:20 +0000: burp[3511] verify finished
stdin 模式实测按路径父目录粒度确认(Directories: 1)。对应的 -a R 是 stdin 版恢复。校验动作受服务端 client_can_verify 管控;服务端 verifylog.gz/verify_stats 会记录每次校验(见 9.1 节)。
6.4 -a e:备份范围估算
不做备份、只扫描并估算体量,用于评估新 include 范围的容量影响(回显见 4.2 节对照实测:/home 9 项约 150KB、/etc 361 项约 428KB)。估算统计的六列结构与 -a b 相同,Bytes estimated 即预计传输量(首次全量口径)。
七、监控与状态交互详解
7.1 -a S:状态快照(脚本友好)
全局快照(所有客户端一行一个):
burp -a S
实测回显:
burp status 2026-10-24 08:14:48 +0000
client1 idle last backup: 0000004 2026-10-24 07:08:32 +0000
client2 idle last backup: 0000001 2026-10-24 07:02:45 +0000
单客户端视图(-C):
burp -a S -C client2
实测回显:
burp status 2026-10-24 08:14:53 +0000
Client: client2
Status: idle
Backup list: 0000001 2026-10-24 07:02:45 +0000 (current)
多备份时的编号列表(-C client1,实测于备份池含 6/7 时):
burp status 2026-10-24 08:19:20 +0000
Client: client1
Status: idle
Backup list: 0000006 2026-10-24 08:19:17 +0000 (current)
0000005 2026-10-24 08:16:54 +0000
-a S 不需要交互终端、输出稳定,官方文档建议的用法就是"脚本定期跑一遍、有异常就发邮件"。监控告警的完整闭环案例(巡检脚本 + 告警脚本)可参考《UrBackup 日常运维手册》的告警体系思路,在 burp 上用 -a S + cron 即可实现同类巡检。
7.2 -a s:ncurses 交互监控台
-a s 是全屏交互界面(方向键选客户端 → 回车进备份列表 → 可浏览文件、看日志、看实时统计)。前提有二:编译时启用 ncurses、在有 TERM 的真实终端里运行。在无终端的自动化环境实测会直接报错:
timeout 3 burp -a s
实测回显:
Error opening terminal: unknown.
EXITCODE=1
这不是故障:SSH 登录服务器后带终端执行即可。界面操作路径(官方 monitor 文档):光标移动用方向键,回车/右方向键进入所选客户端的备份列表,选择备份后可浏览备份内容、查看日志、查看实时统计。
7.3 -a m:JSON 监控流与原生请求协议
-a m 连接服务端状态口(客户端配置的 status_port),以 JSON 行流式输出,是 S/s 两种界面的底层通道。直接运行时输出日志流(实测节选):
{ "logline": "Connecting to 10.89.68.2:4972." }
{ "logline": "auth ok." }
{ "logline": "Server version: 3.2.0." }
{ "logline": "nocsr ok." }
{ "logline": "SSL is using cipher: TLS_AES_256_GCM_SHA384 TLSv1.3 Kx=any Au=any Enc=AESGCM(256) Mac=AEAD.." }
{ "logline": "extra_comms_begin ok:autoupgrade:incexc:orig_client:uname:failover:vss_restore:regex_icase:counters_json:msg:forceproto=1:rshash=blake2:seed:." }
它同时接受 stdin 上的原生请求协议(官方 request format),实测四种请求(注意:stdin 要保持打开,请求喂入后需留出响应时间,形如 (printf "c:client1\n"; sleep 4) | timeout 8 burp -a m 的写法):
请求 c:client1(该客户端备份列表):
(printf "c:client1\n"; sleep 4) | timeout 8 burp -a m
实测回显(节选):
{
"clients": [
{
"name": "client1",
"run_status": "idle",
"protocol": 1,
"backups": [
{
"number": 7,
"timestamp": 1792837074,
"flags": [
"current",
"manifest"
],
"logs": {
"list": [
"backup",
"verify",
"backup_stats",
"verify_stats"
]
}
},
{
"number": 6,
"timestamp": 1792829957,
"flags": [
"deletable",
"manifest"
],
"logs": {
"list": [
"backup",
"restore",
"backup_stats",
"restore_stats"
]
}
}
]
请求 c:client1:b:7:p:/home/client1(浏览备份内目录,返回每个条目的 inode/属主/大小/时间)实测节选:
"browse": {
"directory": "/home/client1",
"entries": [
{
"name": "data.bin",
"dev": 189,
"ino": 31988607,
"mode": 33188,
"nlink": 1,
"uid": 0,
"gid": 0,
"size": 153600,
"mtime": 1792824727
},
协议速查(官方文档原文整理,全部实测可用):
| 请求 | 含义 |
|---|---|
c: | 全部客户端摘要 |
c:<client> | 指定客户端的备份列表 |
c:<client>:b:<编号> | 指定备份详情 |
c:<client>:b:<编号>:p:<路径> | 浏览备份内目录 |
c:<client>:b:<编号>:l:<日志类型> | 取备份日志内容(可用类型见 backups[].logs.list) |
j:pretty-print-on / j:pretty-print-off | JSON 美化开关 |
这份 JSON 就是给 burp 配监控/看板(如 burp-ui 类工具)的数据接口,用 jq/python 解析即可做自研巡检。
7.4 -a S 的 -b/-d/-z 选项:3.2.0 实测现状
帮助文本为 -a S 列出了 -C/-b/-d/-l/-z 五个附加选项,其中 -C 实测工作正常(7.1 节);而 -b <编号>、-d <路径>、-z <日志文件> 三个选项在 3.2.0 实测中输出与不带时相同(例如 burp -a S -C client1 -b 7 -z backup 仍只打印备份列表,不追加日志内容):
burp status 2026-10-24 10:20:28 +0000
Client: client1
Status: idle
Backup list: 0000007 2026-10-24 10:17:54 +0000 (current)
0000006 2026-10-24 08:19:17 +0000
这与官方 monitor 文档把 -b/-z/-d 标注为 "WORK IN PROGRESS - These options are not yet working in burp-2" 一致。运维结论:要按备份浏览文件与取日志,用 7.3 节的 -a m 原生协议(实测可用),不要依赖 -a S 的这三个选项。
八、burp_ca 证书管理实操
8.1 burp_ca -h 帮助全文
burp_ca -h
实测回显:
/usr/sbin/burp_ca: Help:
-h|--help show help
-i|--init inititalize CA
-k|--key generate new key
-K|--keypath <path> path to new key
-r|--request generate certificate sign request
-R|--requestpath <path> path to certificate sign request
-s|--sign sign csr (use --ca <ca> and --name <name>)
--batch do not prompt for anything
--revoke <number> revoke certificate with serial number
--crl generate certificate revoke list
-d|--dir <dir> ca output dir (default: /etc/burp/CA)
-c|--config config file (default: /etc/burp/CA.cnf)
-n|--name name (default: burp-server)
-D|--days valid days for certificate (default in config file)
--ca_days valid days for CA certificate (default: 7300)
-S|--size key size (default: 2048)
-a|--ca ca name if different from name
-f|--dhfile <path> generate Diffie-Hellman file
-A|--altname subjectAltName
日常运维中客户端证书走"首连自动签发"(ca_burp_ca 自动化,见 B1 篇 7.2 节),burp_ca 手工操作主要用在三个场景:预签发证书(离线客户端)、吊销泄露证书、重建 CRL。以下实测在备份服务器(CA 所在机)执行。
8.2 手工签发一张证书(key + CSR + sign)
官方推荐把密钥与 CSR 的生成写在一条命令里(拆开执行时 --request 会退回默认名 burp-server,实测确实如此,故务必用单命令写法):
burp_ca --key --keypath /tmp/demo2.key --request --requestpath /tmp/demo2.csr --name demo2
openssl req -in /tmp/demo2.csr -noout -subject
实测回显:
generating key demo2: /tmp/demo2.key
generating request demo2
subject=CN = demo2
把 CSR 放进 CA 目录后签发:
cp /tmp/demo2.csr /etc/burp/CA/demo2.csr
burp_ca --sign --ca burpCA --name demo2 --batch
实测回显(节选):
Using configuration from /etc/burp/CA.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
Serial Number: 5 (0x5)
commonName = demo2
Certificate is to be certified until Oct 19 10:22:15 2046 GMT (7300 days)
Write out database with 1 new entries
Data Base Updated
签发产物核验:
openssl x509 -in /etc/burp/CA/demo2.crt -noout -subject -serial
实测回显:
subject=CN = demo2
serial=05
签发完成后把 demo2.crt 与 CA 根证书 CA_burpCA.crt 拷给目标客户端,分别放到其配置的 ssl_cert 与 ssl_cert_ca 路径、demo2.key 放 ssl_key(chmod 600 私钥),该客户端即免 CSR 直连。签发后服务端自身证书不受影响(实测 /etc/burp/ssl_cert-server.pem -> /etc/burp/CA/burpserver.crt 链接与 CN 均未变化,客户端连接回归验证 auth ok)。
8.3 吊销证书与重建 CRL
吊销一张已签发的证书(按序列号),随后重建吊销列表:
SERIAL=$(openssl x509 -in /etc/burp/CA/demo.crt -noout -serial | cut -d= -f2)
echo "SERIAL=$SERIAL"
burp_ca --revoke "$SERIAL" --ca burpCA
burp_ca --crl --ca burpCA
tail -3 /etc/burp/CA/index.txt
openssl crl -in /etc/burp/CA/CA_burpCA.crl -noout -text | grep -A2 "Serial Number"
实测回显:
SERIAL=04
Using configuration from /etc/burp/CA.cnf
Revoking Certificate 04.
Data Base Updated
Using configuration from /etc/burp/CA.cnf
---index.txt 尾部---
R 461019070240Z 261024070932Z 02 unknown /CN=client2
V 461019082716Z 03 unknown /CN=client2
R 461019102131Z 261024102131Z 04 unknown /CN=burp-server
---CRL 吊销序列---
Serial Number: 02
Revocation Date: Oct 24 07:09:32 2026 GMT
Serial Number: 04
Revocation Date: Oct 24 10:21:31 2026 GMT
Signature Algorithm: sha256WithRSAEncryption
CA 数据库 index.txt 中该序列号状态由 V(有效)变 R(吊销),CRL 文件随之包含其序列号与吊销时间。服务端 ca_crl_check = 1 时,被吊销的客户端下次握手即被拒绝——这就是"丢机/换机先吊销"的运维闭环。CA 目录与 CA.cnf 参数(default_days = 7300 等)详解见《Burp 3.2.0 配置参数详解》5.5 节。
8.4 其余子命令
burp_ca --init --ca <CA名>:初始化一个新 CA(生成根密钥/自签证书)——服务端-g已自动化,仅手工搭 CA 时用;burp_ca --dhfile /etc/burp/dhfile.pem:重建 Diffie-Hellman 参数文件(服务端ssl_dhfile指向它,首次初始化时自动生成);--days/--ca_days/--size/--altname:定制证书有效期(默认走CA.cnf的 7300 天)、密钥长度(默认 2048)与 subjectAltName。
九、日志与排障实操
9.1 服务端日志文件族:log.gz / restorelog.gz / backup_stats / .command
服务端把每次备份/恢复/校验的完整日志压缩存放在该客户端数据目录下(/var/spool/burp/<客户端>/当前备份目录/),实测目录内容:
backup_stats
data
incexc
log.gz
manifest.gz
restore_stats
restorelog.gz
timestamp
verify_stats
verifylog.gz
备份日志(zcat /var/spool/burp/client1/current/log.gz,实测头 10 行):
2026-10-24 10:17:54 +0000: burp[9585] Backup started
2026-10-24 10:17:54 +0000: burp[9585] Client version: 3.2.0
2026-10-24 10:17:54 +0000: burp[9585] Using librsync hash blake2
2026-10-24 10:17:54 +0000: burp[9585] Begin phase1 (file system scan)
2026-10-24 10:17:54 +0000: burp[9585] End phase1 (file system scan)
2026-10-24 10:17:54 +0000: burp[9585] Begin phase2 (receive file data)
2026-10-24 10:17:54 +0000: burp[9585] WARNING: No meta data after all: m:0005:/home
2026-10-24 10:17:54 +0000: burp[9585] End phase2 (receive file data)
2026-10-24 10:17:54 +0000: burp[9585] Backup ending - disconnect from client.
2026-10-24 10:17:54 +0000: burp[9585] Begin phase3 (merge manifests)
日志按 phase 推进:phase1 扫描 → phase2 收数据 → phase3 合并清单 → phase4 整理(反向差量/硬链接)。排障时先看 WARNING/ERROR 行落在哪个 phase。
恢复日志(zcat /var/spool/burp/client1/current/restorelog.gz,实测头 5 行):
2026-10-24 10:21:01 +0000: burp[9678] Restore settings:
2026-10-24 10:21:01 +0000: burp[9678] backup = '0'
2026-10-24 10:21:01 +0000: burp[9678] restore_list = false
2026-10-24 10:21:01 +0000: burp[9678] regex = 'hello.txt'
--------------------------------------------------------------------------------
结构化统计(cat /var/spool/burp/client1/current/backup_stats,JSON 格式,监控可直接解析):
{
"counters": [
{
"name": "grand_total",
"type": "Z",
"count": 1,
"changed": 1,
"same": 6,
"deleted": 0,
"scanned": 9
},
{
"name": "warnings",
"type": "w",
"count": 1
},
{
"name": "bytes_estimated",
"type": "G",
"count": 153712
},
{
"name": "bytes",
"type": "O",
"count": 153712
},
{
"name": "bytes_received",
"type": "P",
"count": 1780
},
{
"name": "bytes_sent",
"type": "Q",
"count": 484
},
{
"name": "time_start",
"type": "b",
"count": 1792837074
},
{
"name": "time_end",
"type": "E",
"count": 1792837074
}
]
}
(输出为完整 JSON,此处保留关键字段原文;files/meta_data/directories 三个分项计数器同样在内。)
服务端操作流水(/var/spool/burp/<客户端>/.command,按时间记录每个客户端连接做了什么,实测节选):
2026-10-24 06:51:37 +0000 10.89.68.3 client1 c:000C:backupphase1
2026-10-24 06:51:50 +0000 10.89.68.3 client1 c:0006:list :
2026-10-24 06:51:50 +0000 10.89.68.3 client1 c:0009:verify 0:
2026-10-24 06:52:54 +0000 10.89.68.3 client1 c:0016:backupphase1timedcheck
2026-10-24 06:52:54 +0000 10.89.68.3 client1 c:0011:backupphase1timed
2026-10-24 07:06:05 +0000 10.89.68.3 client1 c:0008:Delete 1
.command 是审计"谁在什么时候动了备份池"的第一现场(list/verify/timed 裁决/Delete/restore 一目了然)。
9.2 客户端侧输出要素
客户端每次动作的标准输出结构:握手行(Connecting → auth ok → nocsr ok → SSL 套件)→ 动作统计表 → 结束行(backup finished ok / restore finished / verify finished / List finished ok)。progress_counter = 1 时穿插进度计数行(实测样例 dmdff 5、ff 2)。Warnings 列非零时逐条列出 WARNING 行——最常见的非阻断告警即扫描目录元数据时的 WARNING: No meta data after all: m:0005:/home(实测历次备份均带此条且备份照常成功)。
9.3 错误速查表(全部实测)
| 现象/报错 | 实测退出码 | 根因 | 处理 |
|---|---|---|---|
Could not connect to 10.89.68.2:4971 | 4 | 服务端未监听该端口/进程未起/防火墙 | 查 ss -lntp、服务端进程;改过 listen 必须重启且客户端 server= 同步 |
unexpected command in authorise_client(): e:001D:unable to authorise on server | 1 | 口令不一致或 clientconfdir 缺同名文件 | 核对客户端 password 与服务端 clientconfdir/<cname> 的 password |
cert common name doesn't match configured ssl_peer_cn / 'burpserver'!='notburpserver' / check cert failed | 1 | 客户端 ssl_peer_cn 与服务端证书 CN 不符 | 改回 ssl_peer_cn = burpserver(即 ca_server_name 值) |
unexpected command in do_list_client(): e:0020:could not find specified backups | 1 | -b 指定的备份编号不存在(已删/已清) | 先 burp -a l 看现存编号 |
unexpected command in do_list_client(): e:001F:you need to specify two backups | 1 | -a d 只给了一个 -b | 补成 -b <新> -b <旧> 两个编号 |
Timer conditions on the server were not met | 3 | timer 裁决不允许 | 正常机制;立即备份改用 -a b |
Error opening terminal: unknown.(-a s) | 1 | 无 TERM 的自动化环境跑 ncurses 界面 | 到交互终端执行,或改用 -a S |
WARNING: Path exists: <路径>(恢复时) | 0 | 落点已有同名文件被跳过 | 确认后加 -f 覆盖恢复 |
9.4 排障实录两则
实录一:-b 编号不存在。 备份池只剩编号 4 时按旧编号 2 查询:
burp -a l -b 2
实测回显(节选):
2026-10-24 08:14:45 +0000: burp[3119] nocsr ok
2026-10-24 08:14:45 +0000: burp[3119] unexpected command in do_list_client(): e:0020:could not find specified backups
定位:服务端按保留策略(keep)清理或手动删除后编号不复存在。处理:以 -a l 当前清单为准重新选编号。
实录二:diff 单编号报错。 习惯性只带一个 -b 执行比对:
burp -a d -b 5
实测回显(节选):
2026-10-24 08:18:33 +0000: burp[3174] unexpected command in do_list_client(): e:001F:you need to specify two backups
处理:-a d 语义是"两两比对",必须 -b <编号A> -b <编号B>(正确用法与输出见 6.2 节)。
十、注意事项
- 动作权限受服务端管控:
client_can_delete/client_can_force_backup/client_can_restore/client_can_verify等置 0 后,客户端对应-a动作会被拒绝——客户端侧反复重试无意义,先核对服务端配置(《Burp 3.2.0 配置参数详解》5.6 节)。 -o对可重复键是追加:临时调参时keep/include这类多值键会与配置文件里的值并存,单值键才是替换(4.2 节实测)。-a t与-a b的语义差:-a t受 timer 裁决(可能退出码 3 且不备份),-a b强制立即备份;自动化脚本里判断退出码再告警,不要把 3 当失败。- 服务端发起恢复会消费指令文件:
/var/spool/burp/<客户端>/restore文件在客户端下次连接时被执行并删除,写完文件后要用-a l之类动作触发并核对落点(5.4 节实测)。 - 监控三件套怎么选:脚本巡检用
-a S(稳定文本),程序对接用-a mJSON 协议(功能最全),人工排障用-a s(交互);-a S的-b/-d/-z在 3.2.0 仍是 WIP,取备份文件清单和日志走-a m协议(7.3/7.4 节实测)。 - 同机多身份一切走
-c:多客户端身份共享一个二进制但配置、证书、CSR 目录完全独立,混用会以错误身份连服务器(4.1 节实测)。 - 证书吊销要配 CRL 检查:只吊销不重建 CRL 不生效于
ca_crl_check = 1的校验链,两步要连做(8.3 节实测)。
十一、常见问题(FAQ)
Q1:burp 不带参数执行了什么?
默认动作 l(列清单)+ 默认配置 /etc/burp/burp.conf(帮助文本明示)。裸敲 burp 是最快速的"配置+证书+服务端连通"三合一自检(第三章实测)。
Q2:怎么只恢复某个文件/某个时间点的数据?
组合参数:时间点用 -b <编号>(编号来自 -a l)、文件用 -r <regex>、落点用 -d <目录>、路径瘦身用 -s <n>、覆盖用 -f。例如 burp -a r -b 6 -d /tmp/b6 -r hello.txt(各参数实测见 5.3 节)。
Q3:备份统计里 Bytes received 很小而 Bytes in backup 很大,是不是丢了数据?
不是。Bytes in backup 是逻辑入库量,Bytes received 是服务端实际从网络收到的差量(librsync 只传变化块)。首次备份两者接近,差量备份时前者远大于后者(5.1 节实测:150.03KB 入库 vs 8.49KB 传输)。
Q4:-a m 连上了但没有 JSON 响应?
原生协议请求要从 stdin 送入且保持管道打开,立即 EOF 会让监控进程在读到请求前退出(实测 (printf "c:client1\n"; sleep 4) | timeout 8 burp -a m 可正常拿到响应,7.3 节)。
Q5:想批量核对所有客户端最近一次备份状态?
burp -a S 一屏输出全部客户端的 idle/running 状态与最近备份编号(7.1 节实测),配合 cron 即成最简巡检;更细的数据(备份 flags、日志类型、目录浏览)走 -a m 协议。
Q6:客户端证书到期了怎么换?
删除客户端 ssl_cert/ssl_key(保留 ssl_cert_ca),下次 -a b 会自动重新走 CSR 签发流程拿新证书(默认有效期 7300 天,由 CA.cnf 的 default_days 决定);服务端侧旧证书条目可用 8.3 节流程吊销。
十二、参考链接
- Burp 官网与文档:https://burp.grke.org/
- 官方命令手册(man page):https://burp.grke.org/docs/manpage.html
- 官方监控文档(monitor):https://burp.grke.org/docs/monitor.html
- 官方 CA 与证书文档:https://burp.grke.org/docs/burp_ca.html
- 官方恢复文档(restoring):https://burp.grke.org/docs/restoring.html
- 本专栏选型篇:《Burp 3.2.0 介绍与选型指南》
- 本专栏安装篇:《Burp 3.2.0 安装与运行实测指南》
- 本专栏配置篇:《Burp 3.2.0 配置参数详解》
- 本站同类组件命令篇:《Restic 常用 CLI 命令详解》、《BorgBackup 常用 CLI 命令详解》、《UrBackup 日常运维手册》