Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests as req
- import string
- from itertools import chain, product
- import re
- #functions and regex
- no_signal = re.compile(r'\| NO SIGNAL \|')
- not_found = re.compile(r'Not Found')
- def bruteforce(charset, maxlength):
- return (''.join(candidate)
- for candidate in chain.from_iterable(product(charset, repeat=i)
- for i in range(1, maxlength + 1)))
- #settings
- alphanum = list(string.ascii_letters+string.digits)
- #alphanum = list("xyXY0123456789") #<-- uncomment to check current versioning scheme
- maxchars = 5
- #main programm
- url = 'http://asciicker.com/'
- for attempt in bruteforce(alphanum, maxchars):
- if len(no_signal.findall(req.get(url+attempt).text)) != 0 or len(not_found.findall(req.get(url+attempt).text)) != 0: #page with 404 or no signal
- print(attempt+",",end='',flush=True)
- else: #page without 404 or no signal
- print("\n"+url+attempt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement