Skip to content

Commit de9dd30

Browse files
authored
Merge pull request #6 from genonullfree/add-commands
Add commands
2 parents e85d89a + 5fa20b2 commit de9dd30

4 files changed

Lines changed: 339 additions & 23 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stream-extractor"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
edition = "2021"
55
authors = ["geno nullfree <nullfree.geno@gmail.com>"]
66
license = "BSD-3-Clause"

README.md

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,71 @@ The TCP Stream Extractor is a small utility that can read in a PCAP file, search
55
## Usage
66

77
```bash
8-
Usage: stream-extractor [OPTIONS] --input <INPUT>
8+
Usage: stream-extractor <COMMAND>
9+
10+
Commands:
11+
extract Extract TCP streams from a PCAP
12+
scan Scan the PCAP and search for an IP or Port
13+
list List all of the PCAP communication info
14+
help Print this message or the help of the given subcommand(s)
15+
16+
Options:
17+
-h, --help Print help
18+
-V, --version Print version
19+
```
20+
21+
### Extract
22+
23+
```bash
24+
Usage: stream-extractor extract [OPTIONS] --input <INPUT>
925

1026
Options:
11-
-i, --input <INPUT> Input pcap file to split
27+
-i, --input <INPUT> Input pcap file to extract TCP streams from
1228
-o, --output <OUTPUT> Output name template [default: output_]
1329
-p, --port <PORT> Filter output files to ones that contain the specified port number
1430
--ip <IP> Filter output files to ones that contain the specified IP address
1531
-v, --verbose Enable verbose mode to print TCP stream info for each output PCAP file
1632
-h, --help Print help
1733
```
1834

35+
### Scan
36+
37+
```bash
38+
Usage: stream-extractor scan [OPTIONS] --input <INPUT>
39+
40+
Options:
41+
-i, --input <INPUT> Input pcap file to scan
42+
-p, --port <PORT> Search PCAP to see if this port number is present
43+
--ip <IP> Search PCAP to see if this IP address is present
44+
-m, --mac <MAC> Search PCAP to see if this MAC address is present
45+
-c, --count Count how many times the search terms are present
46+
-v, --verbose Enable to print verbose connection info
47+
-h, --help Print help
48+
```
49+
50+
### List
51+
52+
```bash
53+
Usage: stream-extractor list [OPTIONS] --input <INPUT>
54+
55+
Options:
56+
-i, --input <INPUT> Input pcap file to list
57+
-c, --count Count how many communications are present
58+
-p, --ports List the port numbers present
59+
--ip List the IP addresses present
60+
-m, --mac List the MAC addresses present
61+
-v, --verbose Print all connection statistics
62+
-h, --help Print help
63+
```
64+
1965
## Filter Options
2066
21-
The filter options `--port` and `--ip` are available to allow you to only write out the detected TCP streams that match the filter values. This can help simplify
67+
The filter options `--port`, `--ip`, and `--mac` are available to allow you to only write out the detected TCP streams that match the filter values. This can help simplify
2268
the research step of identifying exactly which streams you may be interested in.
2369
2470
Example:
2571
```bash
26-
stream-extractor --ip 192.168.110.10 -p 80 -i sample/test.pcap
72+
stream-extractor extract --ip 192.168.110.10 -p 80 -i sample/test.pcap
2773
Packets processed: 21933, Streams detected: 662
2874
Filtering streams by communications including port: 80
2975
+ Found 3 matching streams

0 commit comments

Comments
 (0)