Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import json
- import requests
- from Crypto.Cipher import AES
- BLOCK_SIZE = 16
- def get(url):
- return requests.get(url, headers={'Content-Type': 'application/json', 'charset': 'utf-8'})
- def post(url, text):
- return requests.post(url, data = json.dumps(text), headers = {'Content-Type': 'application/json', 'charset':'utf-8'})
- def xor(a, b):
- return bytes([x ^ x1 for x, x1 in zip(bytes.fromhex(a), bytes.fromhex(b))])
- from base64 import b64encode, b64decode
- MIN_VALUE = 10**3
- MAX_VALUE = 10**5
- CHALLENGES_ID = 21
- URL = 'http://192.168.56.103/api/IvIsTime/Chumak/'
- cpin = get(URL + str(1) + "/encryptedpin")
- for chal in range(1, CHALLENGES_ID):
- valide = get(URL + str(chal) + "/validate")
- print('Validation pin: ', b64decode(valide.text))
- for numpin in range(MIN_VALUE, MAX_VALUE, 1):
- pin = str(b64encode(bytes(str(numpin), 'utf-8')))[2:-1]
- if numpin%100 == 0:
- cpin = get(URL + str(chal) + "/encryptedpin")
- encpin = post(URL + str(chal) + "/noentropy", pin)
- if cpin.text == encpin.text:
- print('Encryption pin: ', numpin)
- break
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement