Last active
March 20, 2024 23:52
-
-
Save mpgn/fce3c3f2aaa2eeb8fac5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Padding Oracle Attack against PKCS7 | |
# 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 |
You also fixed the error message so error message arg must not be required.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And also change useless arg for raw TCP socket: