Skip to content

Instantly share code, notes, and snippets.

View kmille's full-sized avatar

kmille kmille

View GitHub Profile
@rectalogic
rectalogic / ipsec2wireshark.py
Last active June 3, 2021 05:12
Parse spis and keys from "ip xfrm state" output and generate a Wireshark ESP decryption config that can decrypt an ESP capture.
#!/usr/bin/env python
"""
Runs "ip xfrm state" and outputs lines to be added to ~/.wireshark/esp_sa
This process must be run using sudo.
This allows Wireshark to decrypt ipsec traffic captured with 'sudo tcpdump -vni any -U -w /tmp/esp.pcap "ip proto 50"'
"""
import sys
import subprocess