Skip to content

Commit d687a89

Browse files
committed
Update README with sample invocations
1 parent 71f5faa commit d687a89

2 files changed

Lines changed: 70 additions & 2 deletions

File tree

README.md

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,73 @@ cargo test
1111

1212
## Usage
1313

14-
```text
15-
cargo run
14+
### PCAP Parser
15+
16+
To simply decrypt communication and print to terminal:
17+
18+
```sh
19+
$ cargo run --bin pcap_parser -- --srtp-key <SRTP KEY BASE64> <PATH TO PCAP>
20+
Using SRTP key: Some("<SRTP KEY>")
21+
PCAP Decrypt path: None
22+
STUN Packet: Binding request l=76 attrs=4 id=hvRAX7bbtFhz4GZP
23+
STUN Packet: Binding request l=76 attrs=4 id=Q/ZCmawz/1kmzU2P
24+
STUN Packet: Binding request l=76 attrs=4 id=nv5JP7xN12fgbyXu
25+
STUN Packet: Binding request l=76 attrs=4 id=hvRAX7bbtFhz4GZP
26+
STUN Packet: Binding request l=76 attrs=4 id=OuJFwaMs+G7QrfBu
27+
STUN Packet: Binding success response l=48 attrs=3 id=OuJFwaMs+G7QrfBu
28+
STUN Packet: Binding request l=80 attrs=5 id=cyFG476hFBbaeza+
29+
STUN Packet: Binding success response l=48 attrs=3 id=cyFG476hFBbaeza+
30+
ConnectionProbingPacket::Syn(DataLen=1434)
31+
ConnectionProbingPacket::Syn(DataLen=1434)
32+
ConnectionProbingPacket::Syn(DataLen=1418)
33+
ConnectionProbingPacket::Syn(DataLen=1402)
34+
ConnectionProbingPacket::Syn(DataLen=1386)
35+
ConnectionProbingPacket::Syn(DataLen=1370)
36+
ConnectionProbingPacket::Syn(DataLen=1354)
37+
STUN Packet: Binding request l=76 attrs=4 id=nv5JP7xN12fgbyXu
38+
STUN Packet: Binding request l=76 attrs=4 id=hvRAX7bbtFhz4GZP
39+
STUN Packet: Binding success response l=48 attrs=3 id=hvRAX7bbtFhz4GZP
40+
STUN Packet: Binding request l=76 attrs=4 id=BXVF8Y8k7Bex1R5Y
41+
STUN Packet: Binding success response l=48 attrs=3 id=BXVF8Y8k7Bex1R5Y
42+
ConnectionProbingPacket::Syn(DataLen=1334)
43+
ConnectionProbingPacket::Syn(DataLen=1318)
44+
ConnectionProbingPacket::Syn(DataLen=1302)
45+
ConnectionProbingPacket::Syn(DataLen=1286)
46+
ConnectionProbingPacket::Syn(DataLen=1270)
47+
ConnectionProbingPacket::Syn(DataLen=1254)
48+
ConnectionProbingPacket::Syn(DataLen=1434)
49+
ConnectionProbingPacket::Ack(AcceptedSize=1434, Appendix=0)
50+
ConnectionProbingPacket::Ack(AcceptedSize=1334, Appendix=0)
51+
RTP: UDPKeepAlive Seq: 2, ts: 0, ssrc: 0
52+
|00000000 09000000 64000000 00000000| ........d....... 00000000
53+
|401f0000 00000000 0a000000 58020000| @...........X... 00000010
54+
|88130000 00000000 0000| .......... 00000020
55+
...
56+
RTP: MuxDCTControl Seq: 5, ts: 0, ssrc: 1024
57+
|14c10af4 01640064 00020000 002e004d| .....d.d.......M 00000000
58+
|6963726f 736f6674 3a3a4261 7369783a| icrosoft::Basix: 00000010
59+
|3a446374 3a3a4368 616e6e65 6c3a3a43| :Dct::Channel::C 00000020
60+
|6c617373 3a3a436f 6e74726f 6c000000| lass::Control... 00000030
61+
|00020000 00020000 00|
62+
```
63+
64+
To decrypt into new PCAP file
65+
66+
```sh
67+
$ cargo run --bin pcap_parser -- --srtp-key <SRTP KEY BASE64> --decrypt-pcap <TARGET PLAINTEXT PCAP> <PATH TO PCAP>
68+
Using SRTP key: Some("<SRTP KEY>")
69+
PCAP Decrypt path: Some("plaintext.pcap")
70+
STUN Packet: Binding request l=76 attrs=4 id=hvRAX7bbtFhz4GZP
71+
STUN Packet: Binding request l=76 attrs=4 id=Q/ZCmawz/1kmzU2P
72+
STUN Packet: Binding request l=76 attrs=4 id=nv5JP7xN12fgbyXu
73+
STUN Packet: Binding request l=76 attrs=4 id=hvRAX7bbtFhz4GZP
74+
STUN Packet: Binding request l=76 attrs=4 id=OuJFwaMs+G7QrfBu
75+
STUN Packet: Binding success response l=48 attrs=3 id=OuJFwaMs+G7QrfBu
76+
STUN Packet: Binding request l=80 attrs=5 id=cyFG476hFBbaeza+
77+
STUN Packet: Binding success response l=48 attrs=3 id=cyFG476hFBbaeza+
78+
STUN Packet: Binding request l=76 attrs=4 id=nv5JP7xN12fgbyXu
79+
STUN Packet: Binding request l=76 attrs=4 id=hvRAX7bbtFhz4GZP
80+
STUN Packet: Binding success response l=48 attrs=3 id=hvRAX7bbtFhz4GZP
81+
STUN Packet: Binding request l=76 attrs=4 id=BXVF8Y8k7Bex1R5Y
82+
STUN Packet: Binding success response l=48 attrs=3 id=BXVF8Y8k7Bex1R5Y
1683
```

pcap_parser/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ fn main() {
203203
let opt = Opt::from_args();
204204

205205
println!("Using SRTP key: {:?}", opt.srtp_key);
206+
println!("PCAP Decrypt path: {:?}", opt.decrypt_pcap);
206207

207208
let mut cap = Capture::from_file(opt.input_file)
208209
.expect("Failed to open input file");

0 commit comments

Comments
 (0)