Exemplo n.º 1
0
                   'slowaes':'','requests-2.3.0':'7449ffdc8ec9ac37bbcd286003c80f00'}
for x, h in modules_to_load.iteritems():
    first_run_check(x, h)
    sys.path.append(join(data_dir, 'python', x))

import rsa
import pyasn1
import requests
from pyasn1.type import univ
from pyasn1.codec.der import encoder, decoder
from slowaes import AESModeOfOperation
import shared

oracle_ba_modulus = binascii.unhexlify(oracle_modulus)
oracle_int_modulus = shared.ba2int(oracle_ba_modulus)
shared.load_program_config()
if int(shared.config.get("General", "gzip_disabled")) == 1:
    global_use_gzip = False


def extract_audit_data(audit_filename):
    audit_data = {}
    with open(audit_filename, 'rb') as f:
        host_line = f.readline()
        if not host_line.startswith("host: "):
            return False, "Invalid file format host"
        print("hostline:", host_line, "end")
        audit_data['host'] = host_line[6:].strip(r'\r\n').replace("\r\n", "")
        print("host:", audit_data['host'], "end")
        html = ''
        response_prefix = f.readline()
Exemplo n.º 2
0
        tar.close()
        
if __name__ == "__main__":
    modules_to_load = {'rsa-3.1.4':'b6b1c80e1931d4eba8538fd5d4de1355',\
                           'pyasn1-0.1.7':'2cbd80fcd4c7b1c82180d3d76fee18c8',\
                           'slowaes':''}
    for x,h in modules_to_load.iteritems():
        first_run_check(x,h)
        sys.path.append(os.path.join(datadir, 'python', x))    
    import rsa
    import pyasn1
    from pyasn1.type import univ
    from pyasn1.codec.der import encoder, decoder
    from slowaes import AESModeOfOperation
    import shared
    shared.load_program_config()
    thread = shared.ThreadWithRetval(target= http_server)
    thread.daemon = True
    thread.start()
    #wait for minihttpd thread to indicate its status   
    bWasStarted = False
    for i in range(10):
        time.sleep(1)        
        if thread.retval == '': continue
        elif thread.retval[0] == 'failure': raise Exception('MINIHTTPD_FAILURE')
        elif thread.retval[0] == 'success':
            bWasStarted = True
            break
        else: raise Exception('MINIHTTPD_WRONG_RESPONSE')
    if bWasStarted == False: raise Exception('MINIHTTPD_START_TIMEOUT')
    FF_to_backend_port = thread.retval[1]