-
Notifications
You must be signed in to change notification settings - Fork 73
/
screentaker.py
81 lines (62 loc) · 1.57 KB
/
screentaker.py
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
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/python
blue = "\033[94m"
red = "\033[91m"
bold = "\033[1m"
end = "\033[0m"
print(blue+bold+"""
____ _____ _
/ ___| __|_ _|_ _| | _____ _ __
\___ \ / __|| |/ _` | |/ / _ \ '__|
___) | (__ | | (_| | < __/ |
|____/ \___||_|\__,_|_|\_\___|_|
Coded by: Bingo
---------------
"""+end)
from selenium import webdriver
import sys, time, requests
f = open('/dev/null', 'w')
sys.stderr = f
try:
driver = webdriver.PhantomJS()
except:
pass
def printer(url):
sys.stdout.write("[+] "+url+" \r")
sys.stdout.flush()
return True
def takescreen(link):
printer(link)
driver.get(link)
name = link.split('/')[2]
#time.sleep(2)
if link.startswith('https'):
driver.save_screenshot('https-'+name+'.png')
else:
driver.save_screenshot('http-'+name+'.png')
return True
def check(url):
try:
req = requests.get(url, timeout=10)
scode = str(req.status_code)
#print("status code: "+scode)
if scode.startswith("2") or scode.startswith("3") or scode.startswith("4"):
takescreen(url)
return True
else:
return False
except:
return False
try:
urlsfile = sys.argv[1]#raw_input("[subdomains list]> ")
except Exception:
print("#Usage:\n\tpython subchecker.py <subdomains list>\n")
driver.close()
exit(0)
urls = open(urlsfile, 'r')
protocols = ['http://','https://']
for url in urls:
for protocol in protocols:
url = url.strip('\n')
link = protocol + url
check(link)
driver.close()