예제 #1
0
def decrypt(url, data):
    de = b64e(data)
    r = requests.get(f'{url}?post={de}',
                     proxies={'http': 'http://127.0.0.1:8080'},
                     allow_redirects=False)
    #r = requests.get(f'{url}?post={de}',  allow_redirects=False)
    return r.text
예제 #2
0
def decrypt(data: memoryview) -> bytes:
    global iv, url
    data_to_send = iv + bytes(data)
    de = b64e(data_to_send)
    r = requests.get(f'{url}?post={de}',
                     proxies={'http': 'http://127.0.0.1:8080'},
                     allow_redirects=False)
    #r = requests.get(f'{url}?post={de}',  allow_redirects=False)
    return r.text
예제 #3
0
def decrypt(data: memoryview) -> bytes:
    global iv
    data_to_send = iv + bytes(data)
    de = b64e(data_to_send)
    return main.process_request(de)
예제 #4
0
    for i in range(0, len(data), 16):
        bloques.append(data[i:i + 16])
    return bloques


if __name__ == '__main__':

    plaintext = pad(b'{"r":"asdasd","d":"sddsf"}')
    plains = obtener_bloques(plaintext)

    coded_hash = main.process_get()
    hashi_ = b64d(coded_hash)
    last_block = hashi_[-16:]

    c2 = last_block
    ces = None
    for i in range(len(plains) - 1, -1, -1):
        p2 = plains[i]
        ce = encrypt_padding_oracle(c2, p2, decrypt, check_padding_error)
        c2 = ce
        if not ces:
            ces = ce
        else:
            ces = ce + ces

    print(ces.hex())
    print(type(ces))

    encoded = b64e(ces)

    print(main.process_request(encoded))
예제 #5
0
            print(f'{bloque:02x}    {d[i:i+16]}')
        else:
            print(f'{bloque:02x}    {d.hex()[i:i+16]}')


print_blocks(new_hash_)
print_blocks(decrypted_to_work)

import requests
from padding_oracle.padding_oracle import calculate_new_iv
from u.common import b64e, b64d

key = 'x44oW3NXgfv1D8MYxZxlLQ~~'
print('KEY:')
print(b64d(key).hex())

url = 'http://34.74.105.127/71a7d1053f/'
new_iv = calculate_new_iv(iv, decrypted_to_work, caracteres)

data_to_send = new_iv + new_hash_

print('Enviando al servidor el nuevo hash calculado')
print(data_to_send.hex())

de = b64e(data_to_send)
r = requests.get(f'{url}?post={de}',
                 proxies={'http': 'http://127.0.0.1:8080'},
                 allow_redirects=False)
#r = requests.get(f'{url}?post={de}',  allow_redirects=False)
print(r.text)