Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- from http.client import HTTPConnection
- from ipaddress import IPv4Address
- from random import randrange as _rr
- from threading import Event, Lock, Thread
- HEADERS = {'User-Agent': 'Mozilla/5.0'}
- print_lock = Lock()
- run_event = Event()
- def bust():
- while run_event.is_set():
- ip_address = IPv4Address(_rr(0x1000000, 0xE0000000))
- if ip_address.is_global:
- try:
- c = HTTPConnection(str(ip_address), timeout=1)
- c.request('GET', '/%08x' % _rr(16**8), headers=HEADERS)
- r = c.getresponse()
- if 200 <= r.status < 300:
- continue
- r.read()
- print('not SPA')
- c.request('GET', '/wp-content/uploads/', headers=HEADERS)
- r = c.getresponse()
- if not 200 <= r.status < 300:
- continue
- text = r.read().decode(errors='ignore')
- with print_lock:
- print(ip_address, text, sep='\n', end='\n---\n')
- except KeyboardInterrupt:
- run_event.clear()
- raise
- except:
- continue
- if __name__ == '__main__':
- threads = []
- run_event.set()
- print('run')
- for _ in range(32):
- t = Thread(target=bust)
- threads.append(t)
- t.start()
- try:
- for t in threads:
- t.join()
- except KeyboardInterrupt:
- run_event.clear()
- print('\rInterrupt')
- exit(130)
- print('stop')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement