Python TLS握手嗅探器提取域名
项目描述
PyTLSSniff
PyTLSSniff - 用于提取域名的 Python TLS 握手嗅探器
入门
安装的先决条件
该项目使用 tshark ( pyshark ) 的 Python 包装器。因此有必要在使用 PyTLSSniff 之前安装 tshark。
Debian / Ubuntu / Mint
sudo apt install tshark
安装 PyTLSSniff
pip3 install PyTLSSniff
在 PyPi 上访问 PyTLSSniff:https ://pypi.org/project/PyTLSSniff
用法
命令行参数
pytlssniff [-h] [-d] [-s] [-a] [-c] [-i INTERFACE] [-r INPUT_FILE]
[-p PACKET_COUNT] [-b BPF_FILTER] [-Y DISPLAY_FILTER]
optional arguments:
-h, --help show this help message and exit
-d, --debug enable debug mode
-s, --sni sniff SNI values from TLS handshakes
-a, --san sniff domains from certificate SAN section
-c, --cn sniff Common Name from certificate CN section
-i INTERFACE, --interface INTERFACE
name or idx of interface (default: any)
-r INPUT_FILE, --input-file INPUT_FILE
set the filename to read from (- to read from stdin)
-p PACKET_COUNT, --packet-count PACKET_COUNT
stop after n packets (def: infinite)
-b BPF_FILTER, --bpf-filter BPF_FILTER
packet filter in Berkeley Packet Filter (BPF) syntax
(for live trace only)
-Y DISPLAY_FILTER, --display-filter DISPLAY_FILTER
packet displaY filter in Wireshark display filter
使用 Berkeley Packet Filter (BPF) 的实时跟踪示例
$ pytlssniff -s -i eth0 -p 5 -b "ip host 10.8.3.35"
client_hello(1) IPv4 10.8.3.35:60588 88.99.24.79:443 biot.com
client_hello(1) IPv4 10.8.3.35:53412 91.198.174.194:443 wikipedia.com
client_hello(1) IPv4 10.8.3.35:58990 91.198.174.192:443 www.wikipedia.org
client_hello(1) IPv4 10.8.3.35:55302 140.82.118.3:443 github.com
client_hello(1) IPv4 10.8.3.35:48082 185.199.110.154:443 github.githubassets.com
带有 Wireshark 显示过滤器的文件跟踪示例
$ pytlssniff -s -r "~/example/trace.pcap" -Y "ip.addr == 10.8.3.35"
client_hello(1) IPv4 10.8.3.35:56670 91.198.174.192:443 www.wikipedia.org
client_hello(1) IPv4 10.8.3.35:52000 91.198.174.208:443 upload.wikimedia.org
client_hello(1) IPv4 10.8.3.35:56674 91.198.174.192:443 de.wikipedia.org
client_hello(1) IPv4 10.8.3.35:52984 140.82.118.3:443 github.com
client_hello(1) IPv4 10.8.3.35:51770 151.101.12.133:443 avatars0.githubusercontent.com
项目详情
关
PyTLSSniff -0.1.3.tar.gz 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 7e23a6df0ada610366ad928ef41858ac3490b0521f889cce4d51ef81f54ced1c |
|
| MD5 | 4b33f484dc3ec8540952b41a15609ea6 |
|
| 布莱克2-256 | fab06f2fbd2ff75fbfe131422b6f11716cb84ef3adcc853248f65ed82fdf42ba |