-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpastebin_scraper.py
More file actions
72 lines (43 loc) · 1.69 KB
/
pastebin_scraper.py
File metadata and controls
72 lines (43 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
"""
Basic Pastebin scraper that hits the public archives and identifies anything that looks like a password
Main file.
"""
import time
import sys
import json
import uuid
from presets.pastebin import PastebinScraper
from settings import ROOT_DIR
from networking.export import CatServerExporter
if __name__ == "__main__":
# print('Executing...')
reload(sys)
sys.setdefaultencoding('utf8')
max_iterations = 1000
curr_iteration = 0
wait_time_s = 200 # seconds
main_start_time = time.time()
# already_seen = {}
pastebin_scraper = PastebinScraper(fast=False, ultra_verbose=True, save_filtered=True)
filepath = ROOT_DIR + '/formatted_output'
identifier = uuid.uuid4()
exporter = CatServerExporter()
while curr_iteration < max_iterations:
cur_start_time = time.time()
print('Executing Iteration %s of %s...' % (curr_iteration, max_iterations))
# pastebin_scraper = PastebinScraper(fast=False, ultra_verbose=True, save_filtered=True)
password_matches = pastebin_scraper.analyze()
pastebin_scraper.clear_passwords()
print('Potential Passwords:')
filename = '%s/%s.json' % (filepath, identifier)
with open(filename, 'a') as f:
for pwm in password_matches:
print pwm
jsn = json.dumps(pwm)
f.write('%s\n' % jsn)
exporter.export(pwm)
print('Execution Time: %s seconds.' % (time.time() - cur_start_time))
print('Waiting %s seconds...' % wait_time_s)
time.sleep(wait_time_s)
curr_iteration += 1
print('Total System Execution Time: %s seconds' % (time.time() - main_start_time))