Advertisement
Guest User

asciicker_links_checker

a guest
Oct 2nd, 2019
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.90 KB | None | 0 0
  1. import requests as req
  2. import string
  3. from itertools import chain, product
  4. import re
  5.  
  6. #functions and regex
  7. no_signal = re.compile(r'\| NO SIGNAL \|')
  8. not_found = re.compile(r'Not Found')
  9. def bruteforce(charset, maxlength):
  10.     return (''.join(candidate)
  11.         for candidate in chain.from_iterable(product(charset, repeat=i)
  12.         for i in range(1, maxlength + 1)))    
  13.  
  14. #settings
  15. alphanum = list(string.ascii_letters+string.digits)
  16. #alphanum = list("xyXY0123456789") #<-- uncomment to check current versioning scheme
  17. maxchars = 5
  18.  
  19.  
  20. #main programm
  21. url = 'http://asciicker.com/'
  22. for attempt in bruteforce(alphanum, maxchars):
  23.     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
  24.         print(attempt+",",end='',flush=True)
  25.     else: #page without 404 or no signal
  26.         print("\n"+url+attempt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement