Extracts the internal IP address and port coded into a BIGip WAF cookie
If we use as example this cookie 'Set-Cookie: BIGipServerpool_z_domain=i557539594.40570.0000; path=/; Httponly;y Secure; SameSite=lax'
Then we know that the IP is next to domain= and next is the port, so we need decode it
We can do this manually in shell this way:
β― printf "%#x\n" 557539594
0x213b610a
β― echo $((0x0a)).$((0x61)).$((0x3b)).$((0x21))
10.97.59.33
β― printf "%#x\n" 40570
0x9e7a
β― echo $((0x7a9e))
31390
Then understanding the general functionallity, it's possible make it automatic using the full cookie to parse and convert only the values we want
β― python bigip-cookie-decoder.py 'Set-Cookie: BIGipServerpool_z_domain=557539594.40570.0000; path=/; Httponly; Secure; SameSite=lax'
ββ BIGipServerpool cookie value:
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β BIGipServerpool_z_domain=557539594.40570.0000 β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
ββ Decimal values:
βββββββββββββββββββ
β IP: 557539594 β
β Port: 40570 β
βββββββββββββββββββ
ββ Hexadecimal (Little Endian):
ββββββββββββββββββββ
β IP: 0x213b610a β
β Port: 0x9e7a β
ββββββββββββββββββββ
ββ IP Address:
βββββββββββββββββ
β 10.97.59.33 β
βββββββββββββββββ
ββ Port:
βββββββββββ
β 31390 β
βββββββββββ