diff --git a/BIGIP_decode_cookie.py b/BIGIP_decode_cookie.py index 19b5e23..7364b7d 100644 --- a/BIGIP_decode_cookie.py +++ b/BIGIP_decode_cookie.py @@ -1,28 +1,47 @@ -#!/usr/bin/python +#!/usr/bin/python3 -# example string: BIGip110536896.20480.0000 +# example string: BIGipServer=110536896.20480.0000 import struct import sys import re if len(sys.argv) != 2: - print "Usage: %s cookie" % sys.argv[0] - exit(1) + print(f"Usage: {sys.argv[0]} cookie") + sys.exit(1) cookie = sys.argv[1] -print "\n[*] Cookie to decode: %s\n" % cookie - -(cookie_name, cookie_value) = cookie.split('=') - -pool = re.search('^BIGipServer([.\w\.]*)', cookie_name) - -(host, port, end) = cookie_value.split('.') - -(a, b, c, d) = [ord(i) for i in struct.pack("