Skip to content
Snippets Groups Projects
Commit 4285f9d0 authored by Recolic's avatar Recolic :house_with_garden:
Browse files

.

parent f323caf1
No related branches found
No related tags found
No related merge requests found
# use filter tcp.flags.syn == 1, export packet dissections as csv
import csv
def filter_unsynacks(input_csv):
syn_packets = []
synacks = set()
with open(input_csv, 'r') as infile:
reader = csv.reader(infile)
for row in reader:
description = row[-1]
if '[SYN' in description:
src_port = description.split('>')[0].strip().split()[-1]
dst_port = description.split('>')[1].strip().split()[0]
if 'ACK]' in description:
synacks.add((src_port, dst_port))
with open(input_csv, 'r') as infile:
reader = csv.reader(infile)
for row in reader:
description = row[-1]
if '[SYN' in description:
src_port = description.split('>')[0].strip().split()[-1]
dst_port = description.split('>')[1].strip().split()[0]
if (src_port, dst_port) not in synacks and (dst_port, src_port) not in synacks:
print(row)
# Example usage
input_csv = '3l2exp2.csv'
filter_unsynacks(input_csv)
...@@ -19,12 +19,12 @@ function curl_wrapped () { ...@@ -19,12 +19,12 @@ function curl_wrapped () {
} }
function show_mercy () { function show_mercy () {
# This is only valid after NEXT qBitTorrent restart # not valid if qbittorrent is already running
local conf_path="$USER/.config/qBittorrent/qBittorrent.conf" local conf_path="$HOME/.config/qBittorrent/qBittorrent.conf"
[[ -f "$conf_path" ]] && sed -i 's/^BannedIPs=[, ]*[0-9a-f].*$/BannedIPs=/' "$conf_path" [[ -f "$conf_path" ]] && sed -i 's/^BannedIPs=[, ]*[0-9a-f].*$/BannedIPs=/' "$conf_path"
} }
echo "Unban all banned client, because IP might be reused by legit users... (valid after NEXT qBitTorrent startup)" echo "Unban all banned client, because IP might be reused by legit users... (valid only if qbittorrent is not running)"
show_mercy show_mercy
echo "Checking all peers every 5 seconds..." echo "Checking all peers every 5 seconds..."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment