姊妹篇:[https][tls] 如何使用wireshark查看tls/https加密消息

一,编译,启用strongswan的save-keys plugin

./configure --prefix=/root/OUTPUT --exec-prefix=/root/OUTPUT --enable-save-keys  CFLAGS="-g -O0"

运行之前验证一下,是否加载了这个插件

[root@T9 OUTPUT]# ./sbin/swanctl --stat |grep save
loaded plugins: charon aes save-keys des rc2 sha2 sha1 md5 mgf1 random nonce x509 revocation constraints pubkey
pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem fips-prf gmp curve25519 xcbc cmac hmac attr kernel-netlink
resolve socket-default stroke vici updown xauth-generic counters

二,增加如下配置

charon {
load_modular = yes
plugins {
include strongswan.d/charon/*.conf
save-keys {
esp = yes
ike = yes
load = yes
wireshark_keys = /root/OUTPUT/etc/keys
}
}

详细的解释,可以查man手册

       charon.plugins.save-keys.esp [no]
Whether to save ESP keys.
charon.plugins.save-keys.ike [no]
Whether to save IKE keys.
charon.plugins.save-keys.load [no]
Whether to load the plugin.
charon.plugins.save-keys.wireshark_keys []
Directory where the keys are stored in the format supported by Wireshark. IKEv1 keys are stored in the ikev1_decryption_table file.
IKEv2 keys are stored in the ikev2_decryption_table file.
Keys for ESP CHILD_SAs are stored in the esp_sa file.

三,正常运行之后,这个目录下,就会存着key了,同时把包抓下来

./sbin/swanctl --load-all
./sbin/ipsec up net-net

查看保存的key

[root@T9 OUTPUT]# ll etc/keys/
total
-rw-r--r-- root root Dec : esp_sa
-rw-r--r-- root root Dec : ikev2_decryption_table

四,配置wireshark

IKE:

edit->preferences->protocols->ISAKMP->IKEv2 Decryption Table->Edit

如图,看见这后边有个蓝色的文件名。

用前边获得的那个文件覆盖它。

cp ikev2_decryption_table /home/tong/.config/wireshark/ikev2_decryption_table

ESP:

edit->preferences->protocols->ESP->Edit

然后点加号,编辑

或者。直接cp进去到配置目录

cp esp_sa /home/tong/.config/wireshark/

五。用wirshark再次打开之前抓到的pcap包。

好了。现在的IKEV2和ESP都是解密过的了。

[ipsec][strongswan] 使用wireshark查看strongswan ipsec esp ikev1 ikev2的加密内容的更多相关文章

  1. [https][tls] 如何使用wireshark查看tls/https加密消息--使用keylog

    姊妹篇: [ipsec][strongswan] 使用wireshark查看strongswan ipsec esp ikev1 ikev2的加密内容 [https][tls] 如何使用wiresha ...

  2. tcpdump抓包和scp导出以及wireshark查看

    [命令和工具] tcpdump scp wireshark  (1)tcpdump sudo tcpdump -i eth0 -w /home/tcpdump/1.pcap host 10.214.1 ...

  3. [https][tls] 如何使用wireshark查看tls/https加密消息--使用私钥

    之前总结了使用keylog进行https流量分析的方法: [https][tls] 如何使用wireshark查看tls/https加密消息--使用keylog 今天总结一下使用服务器端证书私钥进行h ...

  4. Wireshark 查看指定进程的网络包

    Wireshark 查看指定进程的网络包 打开任务管理器,右键筛选列,选中PID(进程标识符): 找到该进程对应的PID,如1200: 在cmd中执行netstat -ano|findstr 1200 ...

  5. SQL点点滴滴_查看所有存储过程或视图的位置及内容

    代码:select a.name,a.[type],b.[definition] from sys.all_objects a,sys.sql_modules b where a.is_ms_ship ...

  6. Visual Studio Code 帮助查看器,指定的用于安装帮助内容的位置无效,或者您无权访问该位置

    今天有个C# 类库文件里面的属性想要了解下,想到了Vs的帮助文档,其实也就是微软的MSDN:提示帮助查看器,指定的用于安装帮助内容的位置无效,或者您无权访问该位置: 最近两天vs也没有更新,并且也没有 ...

  7. 下面哪些命令可以查看file1文件的第300-500行的内容?

    下面哪些命令可以查看file1文件的第300-500行的内容? cat file1 | tail -n +300 | head -n 200 cat file1| head -n 500 | tail ...

  8. [ipsec] 特别硬核的ike/ipsec NAT穿越机制分析

    〇 前言 这怕是最后一篇关于IKE,IPSEC的文字了,因为不能没完没了. 所以,我一直在想这个标题该叫什么.总的来说可以将其概括为:IKE NAT穿越机制的分析. 但是,同时它也回答了以下问题: ( ...

  9. Wireshark查看https的通讯

    如果有服务端的证书,那我们可以分析web下https的通讯情况,在特别的场景下有一定的用处,如外部审计 如下是在wireshark或tshark中配置查看https的设置 wireshark验证 ts ...

随机推荐

  1. Python学习笔记-EXCEL操作

    环境Python3 创建EXCEL,覆盖性创建 #conding=utf-8 import xlwt def BuildExcel(ExcelName,SheetName,TitleList,Data ...

  2. Mac环境下的mongodb的安装

    1.安装MongoDB brew install mongodb 这个是默认安装最新版本的 mogodb,如果想安装指定版本可以先查看 mongodb 版本 brew search mongodb m ...

  3. L2-001 紧急救援 (25 分) (最短路+路径打印)

    链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805073643683840 题目: 作为一个城市的应急救援队伍的负 ...

  4. Hibernate查询返回自定义VO的两种方式

    说明:createQuery用的hql语句进行查询,createSQLQuery用sql语句查询: 前者以hibernate生成的Bean为对象装入list返回:后者则是以对象数组进行存储: 一.通过 ...

  5. Everything工具使用

    一.简介 Everything : Windows下的文件名搜索引擎 二.Everything工具下载 官方最新版本下载 Everything下载 三.Everything快捷搜索 Java*.doc ...

  6. pta编程总结3

    7-1 抓老鼠啊~亏了还是赚了? (20 分) 某地老鼠成灾,现悬赏抓老鼠,每抓到一只奖励10元,于是开始跟老鼠斗智斗勇:每天在墙角可选择以下三个操作:放置一个带有一块奶酪的捕鼠夹(T),或者放置一块 ...

  7. Java Spring Boot VS .NetCore (三)Ioc容器处理

    Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Jav ...

  8. C#生成唯一值的方法汇总

    生成唯一值的方法很多,下面就不同环境下生成的唯一标识方法一一介绍,作为工作中的一次总结,有兴趣的可以自行测试: https://www.cnblogs.com/xinweichen/p/4287640 ...

  9. Redis 数据结构之dict

    上篇文章<Redis数据结构概述>中,了解了常用数据结构.我们知道Redis以高效的方式实现了多种数据结构,因此把Redis看做为数据结构服务器也未尝不可.研究Redis的数据结构和正确. ...

  10. chromedriver与chrome版本映射表

    问题: 利用selenium调用谷歌浏览器时报错,后发现是由于浏览器与浏览器驱动不匹配造成的 C:\Users\\Desktop\selenium>python chrome.py[9956:6 ...