Padding Oracle Attack against PKCS7

December 3, 2018 ยท View on GitHub

From https://github.com/mpgn/Padding-oracle-attack

martial puygrenier

####################################

CUSTOM YOUR RESPONSE ORACLE HERE

#################################### ''' the function you want change to adapte the result to your problem ''' def test_validity(response, error):

# oracle repsonse with data in the DOM
data = response
if data.find(error) == -1:
    return 1
return 0

################################

CUSTOM YOUR ORACLE HTTP HERE

################################ import socket HOST = 'host.com' PORT = 50100 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) def call_oracle(up_cipher, s): s.send(up_cipher+"\n") data = s.recv(1024) return 1, data

comment the lines

  1. connection.close()
  2. print "[+] HTTP ", response.status, response.reason