Skip to content

Commit

Permalink
Cleanup and update
Browse files Browse the repository at this point in the history
  • Loading branch information
wisepythagoras committed Jan 26, 2023
1 parent d1251c4 commit fed2dac
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 265 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,7 @@ ENV/
# mypy
.mypy_cache/
*.pcap
classifier-nb.dmp
fingerprints.csv
*.html

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ Traffic is never "clean", as the assumption was - for simplicity - in this resea
1. Wang, T. and Goldberg, I. (2017). Website Fingerprinting. [online] Cse.ust.hk. Available at: https://www.cse.ust.hk/~taow/wf/.
2. Wang, T. and Goldberg, I. (2017). Improved Website Fingerprinting on Tor. Cheriton School of Computer Science. Available at: http://www.cypherpunks.ca/~iang/pubs/webfingerprint-wpes.pdf
3. Wang, T. (2015). Website Fingerprinting: Attacks and Defenses. University of Waterloo. Available at: https://uwspace.uwaterloo.ca/bitstream/handle/10012/10123/Wang_Tao.pdf

Binary file removed classifier-nb.dmp
Binary file not shown.
10 changes: 3 additions & 7 deletions config.json
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"
]
}
97 changes: 0 additions & 97 deletions defense.js

This file was deleted.

165 changes: 45 additions & 120 deletions example-fingerprints/fingerprints.csv

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions graph.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from plotly import offline
import plotly.plotly as py
import plotly.graph_objs as go
import chart_studio.plotly as py
import plotly.graph_objects as go
import plotly.io as pio
import numpy as np
import pandas as pd

Expand Down Expand Up @@ -36,5 +36,5 @@
layout = go.Layout(margin=dict(l=0, r=0, b=0, t=0))

fig = go.Figure(data=data, layout=layout)
offline.plot(fig, filename='graphs/graph.html', auto_open=False)
pio.write_html(fig, file='graphs/graph.html', auto_open=True)

Binary file modified graphs/graph-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 0 additions & 29 deletions mysources.json

This file was deleted.

17 changes: 9 additions & 8 deletions pcaps/capture.sh
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

1 change: 1 addition & 0 deletions predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@

# Print the results.
print(f"[{prediction[0]}] Prediction: {base_labels[prediction[0] - 1]}")

0 comments on commit fed2dac

Please sign in to comment.