Skip to content

Commit aa38f80

Browse files
authored
web screenshot taker
1 parent a3c89d6 commit aa38f80

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

screentaker.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/usr/bin/python
2+
3+
blue = "\033[94m"
4+
red = "\033[91m"
5+
bold = "\033[1m"
6+
end = "\033[0m"
7+
8+
print(blue+bold+"""
9+
____ _____ _
10+
/ ___| __|_ _|_ _| | _____ _ __
11+
\___ \ / __|| |/ _` | |/ / _ \ '__|
12+
___) | (__ | | (_| | < __/ |
13+
|____/ \___||_|\__,_|_|\_\___|_|
14+
15+
Coded by: Bingo
16+
---------------
17+
18+
"""+end)
19+
20+
21+
22+
from selenium import webdriver
23+
import sys, time, requests
24+
25+
f = open('/dev/null', 'w')
26+
sys.stderr = f
27+
28+
try:
29+
driver = webdriver.PhantomJS()
30+
except:
31+
pass
32+
33+
34+
def printer(url):
35+
sys.stdout.write("[+] "+url+" \r")
36+
sys.stdout.flush()
37+
return True
38+
39+
40+
def takescreen(link):
41+
printer(link)
42+
driver.get(link)
43+
name = link.split('/')[2]
44+
#time.sleep(2)
45+
if link.startswith('https'):
46+
driver.save_screenshot('https-'+name+'.png')
47+
else:
48+
driver.save_screenshot('http-'+name+'.png')
49+
50+
return True
51+
52+
53+
def check(url):
54+
try:
55+
req = requests.get(url, timeout=10)
56+
scode = str(req.status_code)
57+
#print("status code: "+scode)
58+
if scode.startswith("2") or scode.startswith("3") or scode.startswith("4"):
59+
takescreen(url)
60+
return True
61+
else:
62+
return False
63+
except:
64+
return False
65+
66+
try:
67+
urlsfile = sys.argv[1]#raw_input("[subdomains list]> ")
68+
except Exception:
69+
print("#Usage:\n\tpython subchecker.py <subdomains list>\n")
70+
driver.close()
71+
exit(0)
72+
urls = open(urlsfile, 'r')
73+
74+
protocols = ['http://','https://']
75+
76+
for url in urls:
77+
for protocol in protocols:
78+
url = url.strip('\n')
79+
link = protocol + url
80+
check(link)
81+
driver.close()

0 commit comments

Comments
 (0)