-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttpselfie.py
62 lines (56 loc) · 1.78 KB
/
httpselfie.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
# You must have selenium installed in
# your system with firefox webdriver
# by default. You can change the
# webdriver in line 26
from selenium import webdriver
import sys, os, re
from time import sleep
def banner():
print("""
|| || || || ||===|
|| || || || || /
|| || ||== ||== || /
||=====|| || || ||=/
|| || || || ||
|| || || || ||
|| || |=== |=== || SELFIE
""")
if __name__ == "__main__":
banner()
try:
driver = webdriver.Firefox()
except:
print("[!] It seems like *Firefox webdriver* is missing")
sys.exit()
try:
filename = sys.argv[1]
protocol = sys.argv[2]
if protocol != "url":
port = sys.argv[3]
except:
print("Usage: python3 httpselfie.py <path_to_subdomain_list> <protocol(http/https)> <port_no>\n OR\npython3 httpselfie.py <path_to_url_list> url")
driver.quit()
sys.exit()
with open(filename, 'r') as file:
for line in file:
line = line.replace("\n", '')
if sys.argv[2] == "url":
try:
driver.get(line)
sleep(4)
driver.get_screenshot_as_file((line.replace("/", ">") + ".png"))
print(line.replace("\n", ''))
except:
pass
else:
line = line.replace("\n", "")
url = protocol + "://" + line + ":" + port
try:
driver.get(url)
sleep(4)
driver.get_screenshot_as_file((line.replace("/", ">") + ".png"))
print(url)
except:
pass
driver.quit()
print("[*] Task accomplished!")