<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>tools on SecDoc</title>
    <link>https://secdoc.jazor.net/tags/tools/</link>
    <description>Recent content in tools on SecDoc</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-cn</language>
    <copyright>© 2026 黑豆子</copyright>
    <lastBuildDate>Tue, 19 May 2026 00:06:56 +0800</lastBuildDate><atom:link href="https://secdoc.jazor.net/tags/tools/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>使用 SSLKEYLOGFILE 在 Wireshark 中解密 TLS 流量</title>
      <link>https://secdoc.jazor.net/posts/wireshark-tls-decryption-sslkeylogfile/</link>
      <pubDate>Tue, 19 May 2026 00:06:56 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/wireshark-tls-decryption-sslkeylogfile/</guid>
      <description>在排查 HTTPS 连接问题时，能够解密 TLS 流量是极其重要的技能。Wireshark 支持通过 SSLKEYLOGFILE 方式解密 TLS 流量，本文详细介绍其工作原理和实操步骤。
工作原理 TLS 加密通信的安全性来自密钥交换过程。如果能够获取客户端和服务端协商出的密钥（Master Secret 或 Traffic Keys），就能解密捕获的 TLS 流量。
SSLKEYLOGFILE 是 NSS 密码库引入的一个特性，被 Chrome、Firefox、curl 等支持。客户端在建立 TLS 连接时，会将密钥材料写入指定文件，Wireshark 读取该文件即可解密流量。
⚠️ 注意：本文仅用于调试自己的 TLS 连接。请勿用于窃听他人通信。
前置要求 Wireshark（支持 TLS 1.2 和 TLS 1.3 解密） 支持 SSLKEYLOGFILE 的客户端（如 Chrome、Firefox、curl、OpenSSL s_client） 环境准备 1. 创建 Keylog 文件 1 2 3 # 创建空文件用于存储密钥 touch ~/ssl-keylog.txt chmod 600 ~/ssl-keylog.txt 2. 配置环境变量 在 Linux/macOS 上：
1 export SSLKEYLOGFILE=~/ssl-keylog.txt 在 Windows 上（PowerShell）：</description>
    </item>
    
    <item>
      <title>国密 SSL/TLS 配置指南：SM2/SM3/SM4 在 Nginx 中的应用</title>
      <link>https://secdoc.jazor.net/posts/nginx-gmssl-tls-configuration/</link>
      <pubDate>Sun, 17 May 2026 00:09:53 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/nginx-gmssl-tls-configuration/</guid>
      <description>介绍国密 SSL/TLS 算法（SM2/SM3/SM4），讲解在 OpenSSL 和 Nginx 中配置国密加密的实战方法。</description>
    </item>
    
    <item>
      <title>OpenSSL s_time：SSL/TLS 性能测试工具详解</title>
      <link>https://secdoc.jazor.net/posts/openssl-s-time-performance-tool/</link>
      <pubDate>Sat, 16 May 2026 00:08:50 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-s-time-performance-tool/</guid>
      <description>openssl s_time 是 OpenSSL 官方提供的 SSL/TLS 性能基准测试工具。它通过模拟大量握手连接来测量服务器的每秒处理能力，是评估 TLS 性能的重要工具。
基本用法 1 openssl s_time -connect example.com:443 -new -time 10 参数说明：
-connect host:port — 目标服务器地址（默认端口 4433） -new — 测试新建连接（完整握手） -reuse — 测试连接重用（会话恢复） -time seconds — 测试持续时间（默认 30 秒） 实际测试示例 测试 TLS 1.3 新建连接 1 2 3 4 5 6 $ openssl s_time -connect localhost:443 -new -time 3 -tls1_3 Collecting connection statistics for 3 seconds ********************************************************************************************************************************************************************************************************************************** 1243 connections in 1.85s; 671.89 connections/user sec, 0 bytes read per connection 1243 connections in 4 real seconds 测试 TLS 1.</description>
    </item>
    
    <item>
      <title>OpenSSL verify 命令详解：证书链验证原理与实践</title>
      <link>https://secdoc.jazor.net/posts/openssl-verify-certificate-chain-validation/</link>
      <pubDate>Thu, 14 May 2026 00:08:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-verify-certificate-chain-validation/</guid>
      <description>详解 OpenSSL verify 命令的用法，包括证书链验证、CA 存储、partial_chain、trust 设置等核心参数，每个命令都经过实际验证。</description>
    </item>
    
    <item>
      <title>OpenSSL Engine 机制与硬件安全模块集成</title>
      <link>https://secdoc.jazor.net/posts/openssl-engine-hsm-integration/</link>
      <pubDate>Wed, 13 May 2026 00:06:58 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-engine-hsm-integration/</guid>
      <description>深入解析 OpenSSL Engine 架构，讲解如何通过 Engine 接口集成 HSM、PKCS#11 设备、云 KMS 等外部加密服务。</description>
    </item>
    
    <item>
      <title>SSH Agent 转发配置与安全指南</title>
      <link>https://secdoc.jazor.net/posts/ssh-agent-forwarding-guide/</link>
      <pubDate>Sun, 03 May 2026 00:05:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/ssh-agent-forwarding-guide/</guid>
      <description>在日常开发和运维工作中，我们经常需要通过多台跳板机 SSH 到内网服务器。每次都需要在每台机器上配置密钥或者输入密码，非常麻烦。SSH Agent 转发（Agent Forwarding）正是解决这一问题的利器。
什么是 SSH Agent SSH Agent 是一个后台运行的程序（守护进程），它负责管理用户的私钥。当你使用 SSH 连接服务器时，SSH Agent 会自动提供私钥进行认证，无需每次都输入密码或指定密钥文件。
核心组件 ssh-agent：后台守护进程，启动后会在环境变量中设置 SSH_AUTH_SOCK ssh-add：用于将私钥添加到 agent 管理列表 工作原理 1 2 [本地主机] ----SSH 隧道----&amp;gt; [跳板机] ----SSH----&amp;gt; [目标服务器] (持有私钥) (转发请求) (验证签名) 当启用 Agent Forwarding 后，跳板机会作为代理，将服务器的认证请求转发回本地主机，由本地的 SSH Agent 完成签名验证。
配置步骤 第一步：启动 SSH Agent 1 2 3 4 5 6 # 启动 ssh-agent $ ssh-agent -s # 输出示例： # SSH_AUTH_SOCK=/tmp/ssh-XXXX/agent.259996; export SSH_AUTH_SOCK; # SSH_AGENT_PID=260133; export SSH_AGENT_PID; 第二步：添加私钥 1 2 3 4 5 6 7 # 将私钥添加到 agent $ ssh-add ~/.</description>
    </item>
    
    <item>
      <title>TLS ALPN 协议协商：HTTP/2 如何与 HTTPS 握手同步完成</title>
      <link>https://secdoc.jazor.net/posts/tls-alpn-protocol-negotiation/</link>
      <pubDate>Wed, 22 Apr 2026 00:05:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/tls-alpn-protocol-negotiation/</guid>
      <description>什么是 ALPN ALPN（Application-Layer Protocol Negotiation，应用层协议协商）是 TLS 协议的一个扩展，定义于 RFC 7301。它允许客户端和服务器在 TLS 握手阶段就协商好使用哪个应用层协议，而无需额外的往返通信。
如果没有 ALPN，客户端只能先建立 TLS 连接，再通过 NPN（Next Protocol Negotiation，已废弃）或在 TLS 握手完成后通过额外协商来确定使用 HTTP/1.1 还是 HTTP/2。ALPN 将这个过程整合到 TLS 握手中，减少了延迟。
ALPN 的工作原理 在 TLS ClientHello 消息中，客户端通过 application_layer_protocol_negotiation 扩展发送自己支持的协议列表，按优先级排序。服务器从中选择一个双方都支持的协议，并在 ServerHello 中回显该选择。
整个协商过程在 TLS 握手内部完成，对应用层透明：
1 2 3 4 5 6 7 8 9 10 11 12 Client Server | | |-------- ClientHello ----------&amp;gt;| | + ALPN: [h2, http/1.1] | | | |&amp;lt;------- ServerHello -----------| | + ALPN: h2 | | | |-------- 后续 TLS 握手 --------&amp;gt;| | | |&amp;lt;===== TLS 加密通道建立 ========&amp;gt;| | 使用 HTTP/2 通信 | 常见的 ALPN 协议标识符 协议标识符 说明 h2 HTTP/2 over TLS http/1.</description>
    </item>
    
    <item>
      <title>OCSP 证书状态在线检查</title>
      <link>https://secdoc.jazor.net/posts/ocsp-certificate-status-check/</link>
      <pubDate>Thu, 16 Apr 2026 00:00:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/ocsp-certificate-status-check/</guid>
      <description>OCSP（Online Certificate Status Protocol）是用于实时检查证书是否被吊销的协议。相比 CRL，OCSP 无需下载完整吊销列表，查询效率更高。本文介绍 OCSP 原理及 OpenSSL 命令行操作。
什么是 OCSP？ 当浏览器验证 TLS 证书时，除了检查证书链和有效期，还需确认证书未被吊销。传统方式是下载 CRL（Certificate Revocation List），但列表会随时间增长。OCSP 允许客户端直接查询证书颁发机构，获取特定证书的实时状态。
OCSP 响应类型 状态 含义 good 证书有效，未被吊销 revoked 证书已被吊销 unknown 响应者不知道该证书 从证书提取 OCSP 信息 获取证书的 OCSP 响应者地址 1 openssl x509 -in certificate.crt -noout -ocsp_uri 输出示例：
1 http://ocsp.digicert.com 获取颁发者信息 OCSP 查询需要知道证书的颁发者（CA）：
1 2 3 4 5 # 获取证书颁发者 openssl x509 -in certificate.crt -noout -issuer # 获取颁发者证书 openssl x509 -in certificate.crt -noout -issuer_hash 实际 OCSP 查询示例 使用 OpenSSL 进行 OCSP 查询 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # 获取目标证书和颁发者证书 openssl s_client -connect google.</description>
    </item>
    
    <item>
      <title>ECDSA 数字签名算法详解</title>
      <link>https://secdoc.jazor.net/posts/ecdsa-digital-signature-algorithm/</link>
      <pubDate>Wed, 15 Apr 2026 00:00:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/ecdsa-digital-signature-algorithm/</guid>
      <description>ECDSA（Elliptic Curve Digital Signature Algorithm）是基于椭圆曲线密码学的数字签名算法，广泛应用于比特币、区块链以及 TLS 证书中。本文介绍其原理及 OpenSSL 命令行操作。
什么是 ECDSA？ ECDSA 是 DSA（Digital Signature Algorithm）的椭圆曲线版本，利用椭圆曲线离散对数问题的计算难度来保证签名安全性。相比传统 RSA，ECDSA 在相同安全强度下密钥更短，运算更快。
常见曲线 曲线 位数 应用场景 prime256v1 (P-256) 256 位 主流 TLS 证书、Web 应用 secp384r1 (P-384) 384 位 高安全场景、政府、金融 secp521r1 (P-521) 521 位 极高安全需求 生成 ECDSA 密钥对 生成私钥 1 2 3 openssl genpkey -algorithm EC \ -pkeyopt ec_paramgen_curve:prime256v1 \ -out ecdsa_private.pem 导出公钥 1 openssl pkey -in ecdsa_private.pem -pubout -out ecdsa_public.pem 查看密钥详情 1 openssl pkey -in ecdsa_private.</description>
    </item>
    
    <item>
      <title>OpenSSL passwd 命令：生成密码哈希</title>
      <link>https://secdoc.jazor.net/posts/openssl-passwd-password-hash/</link>
      <pubDate>Fri, 10 Apr 2026 00:00:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-passwd-password-hash/</guid>
      <description>OpenSSL passwd 命令用于生成 Unix 密码哈希，支持 SHA-512、SHA-256、MD5 等算法，适用于系统管理和脚本场景。</description>
    </item>
    
    <item>
      <title>OpenSSL rand 命令详解：随机数生成</title>
      <link>https://secdoc.jazor.net/posts/openssl-rand-random-generation/</link>
      <pubDate>Wed, 08 Apr 2026 00:00:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-rand-random-generation/</guid>
      <description>随机数是密码学的基石。密钥、IV、盐值、Session ID 等都需要高质量的随机数。OpenSSL 的 rand 命令是生成密码学安全随机数的实用工具。
基本语法 1 openssl rand [选项] 字节数 常用选项：
-hex：输出十六进制格式 -base64：输出 Base64 编码格式 -out &amp;lt;文件&amp;gt;：输出到文件 常用示例 生成十六进制随机数 1 2 # 生成 16 字节（128 位）的十六进制随机数 openssl rand -hex 16 输出示例：
1 5254ce50aaf9b31ae6c6ecf2ef75f4de 生成 Base64 随机数 1 2 # 生成 32 字节（256 位）的 Base64 随机数 openssl rand -base64 32 输出示例：
1 n8EZAZAQ4PL60cFHcP0KIeT8dlhsa8m1K8QP1dQVnlQ= 生成不同长度的随机数 1 2 3 4 5 6 7 8 9 10 # 8 字节（64 位） openssl rand -hex 8 # 输出：67194de56e50d52b # 32 字节（256 位） openssl rand -hex 32 # 输出：7be8420779779ecd1253f6be94e7d717b9a75e7aa5d0767c95414e8f811d6b29 # 64 字节（512 位） openssl rand -hex 64 实战场景 1.</description>
    </item>
    
    <item>
      <title>OpenSSL enc 文件加密实战</title>
      <link>https://secdoc.jazor.net/posts/openssl-enc-file-encryption/</link>
      <pubDate>Tue, 07 Apr 2026 00:00:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-enc-file-encryption/</guid>
      <description>使用 OpenSSL enc 命令进行文件对称加密，包括密码加密、密钥文件加密、Base64 编码等实战场景。</description>
    </item>
    
    <item>
      <title>SSH 配置文件详解</title>
      <link>https://secdoc.jazor.net/posts/ssh-config-file-guide/</link>
      <pubDate>Mon, 06 Apr 2026 00:00:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/ssh-config-file-guide/</guid>
      <description>每次 SSH 连接都要输入一长串参数？~/.ssh/config 配置文件可以简化连接命令，还能统一管理多个主机的配置。
配置文件位置 SSH 客户端配置按以下顺序读取（后读取的优先级更高）：
/etc/ssh/ssh_config — 系统全局配置 ~/.ssh/config — 用户个人配置 用户配置会覆盖全局配置中的同名选项。
基本语法 配置文件由多个 Host 块组成，每个块定义一组主机的配置：
1 2 3 4 5 6 Host 别名 选项1 值1 选项2 值2 Host 另一个别名 选项1 值1 注意：每行的缩进使用空格（通常 4 个空格或 1 个 Tab），不是必须但推荐。
常用配置选项 选项 说明 示例 HostName 实际主机名或 IP HostName 192.168.1.100 User 登录用户名 User admin Port SSH 端口 Port 2222 IdentityFile 指定私钥文件 IdentityFile ~/.ssh/id_ed25519 PreferredAuthentications 首选认证方式 PreferredAuthentications publickey ServerAliveInterval 心跳间隔秒数 ServerAliveInterval 60 ServerAliveCountMax 心跳失败次数上限 ServerAliveCountMax 3 ProxyJump 跳板机 ProxyJump bastion 实战示例 简化连接命令 不使用配置文件：</description>
    </item>
    
    <item>
      <title>OpenSSL s_client：SSL/TLS 连接调试工具</title>
      <link>https://secdoc.jazor.net/posts/openssl-s-client-ssl-tls-tool/</link>
      <pubDate>Sun, 05 Apr 2026 17:20:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-s-client-ssl-tls-tool/</guid>
      <description>openssl s_client 是调试 SSL/TLS 连接的利器。它可以建立到远程服务器的 SSL/TLS 连接，显示证书链、协议版本、加密套件等详细信息，是排查 HTTPS 问题的必备工具。
基本用法 连接 HTTPS 服务器 1 openssl s_client -connect example.com:443 执行后会显示完整的 SSL/TLS 握手信息，包括证书链、协议版本、加密套件等。
指定 SNI（Server Name Indication） 对于共享 IP 的虚拟主机，必须指定 SNI：
1 openssl s_client -connect example.com:443 -servername example.com 不指定 SNI 时，服务器可能返回默认证书，导致证书验证失败。
常用场景 1. 查看证书信息 提取服务器证书并查看详情：
1 2 3 4 5 # 获取证书 echo | openssl s_client -connect www.baidu.com:443 -servername www.baidu.com 2&amp;gt;/dev/null | openssl x509 -noout -text # 只看有效期 echo | openssl s_client -connect www.</description>
    </item>
    
    <item>
      <title>OpenSSL s_client 排查 HTTPS 连接问题</title>
      <link>https://secdoc.jazor.net/posts/openssl-s-client-troubleshoot-https/</link>
      <pubDate>Sun, 05 Apr 2026 00:00:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-s-client-troubleshoot-https/</guid>
      <description>使用 OpenSSL s_client 命令排查 HTTPS 连接问题，包括证书验证、握手过程、TLS 协议版本检测等实用技巧。</description>
    </item>
    
    <item>
      <title>OpenSSL 计算文件和字符串哈希值</title>
      <link>https://secdoc.jazor.net/posts/openssl-dgst-hash-calculation/</link>
      <pubDate>Sun, 05 Apr 2026 00:00:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-dgst-hash-calculation/</guid>
      <description>使用 OpenSSL dgst 命令计算文件的 SHA-256、SHA-512、MD5 等哈希值，用于文件完整性校验和密码存储。</description>
    </item>
    
    <item>
      <title>OpenSSL 常用命令速查</title>
      <link>https://secdoc.jazor.net/posts/openssl-common-commands/</link>
      <pubDate>Fri, 03 Apr 2026 00:00:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-common-commands/</guid>
      <description>整理 OpenSSL 最常用的命令，包括版本查看、证书生成、密钥操作、测试连接等，每个命令都经过实际验证。</description>
    </item>
    
    <item>
      <title>OpenSSL x509 命令详解：证书查看与解析</title>
      <link>https://secdoc.jazor.net/posts/openssl-x509-command-guide/</link>
      <pubDate>Fri, 27 Mar 2026 00:00:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-x509-command-guide/</guid>
      <description>openssl x509 是日常运维中最常用的证书查看工具。本文聚焦于查看和解析证书信息，不涉及证书生成。
基本语法 1 openssl x509 [options] -in &amp;lt;certificate file&amp;gt; 常用查看命令 查看证书完整信息 1 openssl x509 -in cert.pem -text -noout 输出包含：版本、序列号、签名算法、颁发者、有效期、主体、公钥、扩展信息。
只查看关键字段 1 2 3 4 5 6 7 8 9 10 11 # 查看主体（Subject） openssl x509 -in cert.pem -subject -noout # 查看颁发者（Issuer） openssl x509 -in cert.pem -issuer -noout # 查看有效期 openssl x509 -in cert.pem -dates -noout # 查看序列号 openssl x509 -in cert.pem -serial -noout 查看公钥信息 1 openssl x509 -in cert.</description>
    </item>
    
  </channel>
</rss>
