Skip to content

Commit cf03527

Browse files
deploy: 1ed1da3
0 parents  commit cf03527

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5701
-0
lines changed

.buildinfo

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: 62067277e1d30a8c93d784005608bccd
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7

.doctrees/api.doctree

3.33 KB
Binary file not shown.

.doctrees/environment.pickle

38 KB
Binary file not shown.

.doctrees/index.doctree

3.34 KB
Binary file not shown.

.doctrees/readme_copy.doctree

13.7 KB
Binary file not shown.

.nojekyll

Whitespace-only changes.

_sources/api.md.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# API reference
2+
3+
This page is under development!
4+
## Helper Class
5+
6+
```{eval-rst}
7+
.. automodule:: Helper
8+
:members:
9+
:show-inheritance:
10+
```
11+
12+
## ICSFlowGenerator Class
13+
14+
```{eval-rst}
15+
.. autoclass:: ICSFlowGenerator.ICSFlowGenerator
16+
:imported-members:
17+
:members:
18+
:undoc-members:
19+
:show-inheritance:
20+
```

_sources/index.rst.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. Example documentation master file, created by
2+
sphinx-quickstart on Sat Sep 23 20:35:12 2023.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to ICSFLow's documentation!
7+
===================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
readme_copy.md
14+
api.md

_sources/readme_copy.md.txt

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
2+
# ICSFLowGenerator in Docs
3+
4+
This is tool for offline and online processing of network packets and creating network flows.
5+
6+
7+
8+
## Capabilities
9+
Reading packets could be done in two modes
10+
* offline from PCAP file
11+
* online sniffing of LAN
12+
13+
We can annotate data using True labels or predicted labels
14+
* Ture Labels: proving attack history log files, it can detect which flows are malicious
15+
* Predicated Labels: We could also try to analyze network flows with pretrained model and predict its anomality.
16+
17+
18+
## Arguments
19+
positional arguments: <action:sniff|convert>
20+
Choose online sniffing of a LAN or offline converting
21+
PCAP file
22+
23+
options:
24+
-h, --help show this help message and exit
25+
--source <source file or LAN name>>
26+
In online sniffing provide <LAN name> and in offline
27+
converting provide <PCAP file>
28+
--interval interval in seconds
29+
interval to compute flows
30+
--attacks attack log csv file address
31+
attack file address for finding true flows' label
32+
--predictor model address of pre trained ml model to classify incoming
33+
flows
34+
--target_stream <Stream address>
35+
Target server address to stream out network flows
36+
--target_file <csv file name>
37+
csv file to output
38+
39+
40+
## Sample runtime arguments
41+
1) sniffing from Wi-Fi lan without annotation and writing flows to file:
42+
```
43+
sniff --source Wi-Fi --interval 0.5 --target_file output/sniffed.csv
44+
```
45+
46+
47+
2) offline generating of network flows from PCAP file with True label annotation and writing flows to file::
48+
```
49+
Convert
50+
--source input/traffic.pcap
51+
--interval 0.5
52+
--attacks input/attacker_machine_summary.csv
53+
--target_file output/sniffed.csv
54+
```
55+
56+
3) offline generating of network flows from PCAP file with True label annotation and prediction and writing flows to file:
57+
```
58+
Convert
59+
--source input/traffic.pcap
60+
--interval 0.5
61+
--attacks input/attacker_machine_summary.csv
62+
--predictor input/predict_model.joblib
63+
--target_file output/sniffed.csv
64+
```
65+
or
66+
```
67+
Convert --source input/traffic.pcap --interval 0.5 --attacks input/attacker_machine_summary.csv --target_file output/sniffed.csv
68+
```
69+
70+
4) offline generating of network flows from PCAP file with True label annotation and prediction and sending them to both target file and MQTT server with credential:
71+
```
72+
Convert
73+
--source input/traffic.pcap
74+
--interval 0.5
75+
--attacks input/attacker_machine_summary.csv
76+
--predictor input/predict_model.joblib
77+
--target_file output/sniffed.csv
78+
--target_connection sample_connection.txt
79+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/* Compatability shim for jQuery and underscores.js.
2+
*
3+
* Copyright Sphinx contributors
4+
* Released under the two clause BSD licence
5+
*/
6+
7+
/**
8+
* small helper function to urldecode strings
9+
*
10+
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
11+
*/
12+
jQuery.urldecode = function(x) {
13+
if (!x) {
14+
return x
15+
}
16+
return decodeURIComponent(x.replace(/\+/g, ' '));
17+
};
18+
19+
/**
20+
* small helper function to urlencode strings
21+
*/
22+
jQuery.urlencode = encodeURIComponent;
23+
24+
/**
25+
* This function returns the parsed url parameters of the
26+
* current request. Multiple values per key are supported,
27+
* it will always return arrays of strings for the value parts.
28+
*/
29+
jQuery.getQueryParameters = function(s) {
30+
if (typeof s === 'undefined')
31+
s = document.location.search;
32+
var parts = s.substr(s.indexOf('?') + 1).split('&');
33+
var result = {};
34+
for (var i = 0; i < parts.length; i++) {
35+
var tmp = parts[i].split('=', 2);
36+
var key = jQuery.urldecode(tmp[0]);
37+
var value = jQuery.urldecode(tmp[1]);
38+
if (key in result)
39+
result[key].push(value);
40+
else
41+
result[key] = [value];
42+
}
43+
return result;
44+
};
45+
46+
/**
47+
* highlight a given string on a jquery object by wrapping it in
48+
* span elements with the given class name.
49+
*/
50+
jQuery.fn.highlightText = function(text, className) {
51+
function highlight(node, addItems) {
52+
if (node.nodeType === 3) {
53+
var val = node.nodeValue;
54+
var pos = val.toLowerCase().indexOf(text);
55+
if (pos >= 0 &&
56+
!jQuery(node.parentNode).hasClass(className) &&
57+
!jQuery(node.parentNode).hasClass("nohighlight")) {
58+
var span;
59+
var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
60+
if (isInSVG) {
61+
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
62+
} else {
63+
span = document.createElement("span");
64+
span.className = className;
65+
}
66+
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
67+
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
68+
document.createTextNode(val.substr(pos + text.length)),
69+
node.nextSibling));
70+
node.nodeValue = val.substr(0, pos);
71+
if (isInSVG) {
72+
var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
73+
var bbox = node.parentElement.getBBox();
74+
rect.x.baseVal.value = bbox.x;
75+
rect.y.baseVal.value = bbox.y;
76+
rect.width.baseVal.value = bbox.width;
77+
rect.height.baseVal.value = bbox.height;
78+
rect.setAttribute('class', className);
79+
addItems.push({
80+
"parent": node.parentNode,
81+
"target": rect});
82+
}
83+
}
84+
}
85+
else if (!jQuery(node).is("button, select, textarea")) {
86+
jQuery.each(node.childNodes, function() {
87+
highlight(this, addItems);
88+
});
89+
}
90+
}
91+
var addItems = [];
92+
var result = this.each(function() {
93+
highlight(this, addItems);
94+
});
95+
for (var i = 0; i < addItems.length; ++i) {
96+
jQuery(addItems[i].parent).before(addItems[i].target);
97+
}
98+
return result;
99+
};
100+
101+
/*
102+
* backward compatibility for jQuery.browser
103+
* This will be supported until firefox bug is fixed.
104+
*/
105+
if (!jQuery.browser) {
106+
jQuery.uaMatch = function(ua) {
107+
ua = ua.toLowerCase();
108+
109+
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
110+
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
111+
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
112+
/(msie) ([\w.]+)/.exec(ua) ||
113+
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
114+
[];
115+
116+
return {
117+
browser: match[ 1 ] || "",
118+
version: match[ 2 ] || "0"
119+
};
120+
};
121+
jQuery.browser = {};
122+
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
123+
}

0 commit comments

Comments
 (0)