From 7409718dd498ea1fad7ce8f84c18a1041aee9455 Mon Sep 17 00:00:00 2001 From: Jan Vales Date: Fri, 11 Nov 2016 21:30:01 +0100 Subject: [PATCH] Ra sein GAMEBOT Fingerprinting + iptable modifying script. --- ra_fingerprinting_update_ts.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ra_fingerprinting_update_ts.py diff --git a/ra_fingerprinting_update_ts.py b/ra_fingerprinting_update_ts.py new file mode 100644 index 0000000..1fab9db --- /dev/null +++ b/ra_fingerprinting_update_ts.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +from dateutil.parser import parse +from datetime import datetime +from subprocess import call +from os import geteuid +from sys import exit + + +START_DATE = 'Thu Nov 10 01:45:06 CET 2016' +START_TS = 175684430 +FREQUENCY = 250 +EPSILON = 120 +EXPLOITABLEVM = '192.168.1.20' + + +if geteuid() != 0: + exit("Need to run as root.") + +time_diff = datetime.now() - parse(START_DATE).replace(tzinfo=None) +time_diff = time_diff.total_seconds() + +begin = int(round(START_TS + (time_diff - EPSILON) * FREQUENCY)) +end = int(round(START_TS + (time_diff + EPSILON) * FREQUENCY)) + +retcode = call("iptables -t nat -I GAMEBOT 1 -m bpf --bytecode '15,48 0 0 0,84 0 0 240,21 0 11 64,48 0 0 9,21 0 9 6,40 0 0 6,69 7 0 8191,177 0 0 0,64 0 0 20,21 0 3 16844810,64 0 0 24,53 0 1 %d,37 0 1 %d,6 0 0 65535,6 0 0 0' -j DNAT --to-destination %s" % (begin, end, EXPLOITABLEVM), shell=True) +assert(retcode == 0), 'ERROR: iptables command failed.' + +retcode = call("iptables -t nat -D GAMEBOT 2", shell=True) +assert(retcode == 0), 'ERROR: iptables command failed.' -- 2.43.0