You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Produce some sample flows, e.g. surf the web and refresh your mail client.
17
-
3. Save the pcap file to disk.
18
-
4. Run tcpdump/Wireshark again on an interface.
19
-
4. Run softflowd with the `-r <pcap_file>` flag. softflowd reads the captured traffic, produces the flows and exports them. Use the interface you are capturing packets on to send the exports.
20
-
5. Examine the captured traffic. Use Wireshark and set the `CFLOW` "decode as" dissector on the export packets (e.g. based on the port). The `data` fields should then be shown correctly as Netflow payload.
21
-
6. Extract this payload as hex stream. Anonymize the IP addresses with a hex editor if necessary. A recommended hex editor is [bless](https://github.com/afrantzis/bless).
10
+
Licensed under MIT License. See LICENSE.
22
11
23
-
The collector is run in a background thread. The difference in transmission speed from the exporting client can lead to different results, possibly caused by race conditions during the usage of the JSON output file.
24
12
25
13
## Using the collector and analyzer
26
14
In this repo you also find `main.py` and `analyze_json.py`.
@@ -54,3 +42,17 @@ nice graphs or calculate broader statistics.
54
42
I have specifically written this script in combination with NetFlow exports from
55
43
[softflowd](https://github.com/djmdjm/softflowd) v0.9.9 - it should work with every
56
44
correct NetFlow v9 implementation though.
45
+
46
+
### Running tests
47
+
The file `tests.py` contains some tests based on real softflowd export packets.
48
+
To create the test packets try the following:
49
+
50
+
1. Run tcpdump/Wireshark on your interface
51
+
2. Produce some sample flows, e.g. surf the web and refresh your mail client.
52
+
3. Save the pcap file to disk.
53
+
4. Run tcpdump/Wireshark again on an interface.
54
+
4. Run softflowd with the `-r <pcap_file>` flag. softflowd reads the captured traffic, produces the flows and exports them. Use the interface you are capturing packets on to send the exports.
55
+
5. Examine the captured traffic. Use Wireshark and set the `CFLOW` "decode as" dissector on the export packets (e.g. based on the port). The `data` fields should then be shown correctly as Netflow payload.
56
+
6. Extract this payload as hex stream. Anonymize the IP addresses with a hex editor if necessary. A recommended hex editor is [bless](https://github.com/afrantzis/bless).
57
+
58
+
The collector is run in a background thread. The difference in transmission speed from the exporting client can lead to different results, possibly caused by race conditions during the usage of the JSON output file.
0 commit comments