-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1251c4
commit fed2dac
Showing
11 changed files
with
66 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,4 +100,7 @@ ENV/ | |
# mypy | ||
.mypy_cache/ | ||
*.pcap | ||
classifier-nb.dmp | ||
fingerprints.csv | ||
*.html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
{ | ||
"pcaps": [ | ||
"duckduckgo.com", | ||
"github.com", | ||
"jjay.cuny.edu", | ||
"telegram.org", | ||
"reddit.com", | ||
"torproject.org", | ||
"perdu.com" | ||
"example.com", | ||
"google.com", | ||
"duckduckgo.com" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
#!/bin/bash | ||
|
||
if [[ $# -eq 0 ]]; then | ||
echo "Usage: script.sh <domain> <?source>" | ||
echo "Example: script.sh jjay.cuny.edu lynx" | ||
echo "Usage: script.sh <device> <domain> <?source>" | ||
echo "Example: script.sh <device> example.com lynx" | ||
exit 1 | ||
fi | ||
|
||
# Create the directory if it does not already exist. | ||
[ -d ./pcaps/$1 ] || mkdir -pv ./pcaps/$1 | ||
[ -d ./pcaps/$2 ] || mkdir -pv ./pcaps/$2 | ||
|
||
# Create the file name. | ||
fname="$1-$(date +'%m-%d-%y_%T')" | ||
fname="$2-$(date +'%m-%d-%y_%T')" | ||
|
||
if [ ! -z "$2" ]; then | ||
fname="$fname-$2" | ||
echo "PCAPs in ./pcaps/$1: " $(ls -ltr ./pcaps/$1/ | grep "$2.pcap$" | wc -l) | ||
fname="$fname-$3" | ||
echo "PCAPs in ./pcaps/$2: " $(ls -ltr ./pcaps/$2/ | grep "$2.pcap$" | wc -l) | ||
else | ||
echo "PCAPs in ./pcaps/$1: " $(ls -ltr ./pcaps/$1/ | grep ".pcap$" | wc -l) | ||
echo "PCAPs in ./pcaps/$2: " $(ls -ltr ./pcaps/$2/ | grep ".pcap$" | wc -l) | ||
fi | ||
|
||
sudo tcpdump -vv -x -X -i eth0 -A tcp and port not 22 -w ./pcaps/$1/$fname.pcap | ||
sudo tcpdump -vv -x -X -i $1 -A tcp and port not 22 -w ./pcaps/$2/$fname.pcap | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,3 +61,4 @@ | |
|
||
# Print the results. | ||
print(f"[{prediction[0]}] Prediction: {base_labels[prediction[0] - 1]}") | ||
|