forked from gokulapap/Reconator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclickjacking
executable file
·67 lines (46 loc) · 1.7 KB
/
clickjacking
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
# tests for clickjacking
from urllib.request import urlopen
from sys import argv, exit
__author__ = 'Gokul'
def check(url):
''' check given URL is vulnerable or not '''
try:
if "http" not in url: url = "http://" + url
data = urlopen(url)
headers = data.info()
if not "X-Frame-Options" in headers: return True
except: return False
def main():
try: site = argv[1]
except: print("[*] Usage: python3 clickjacking.py <domain>"); exit(0)
f = open("/app/results/{}-output.txt".format(site), "a")
f.write("2) CLICKJACKING \n")
print("\n[+] Checking " + site)
f.write("\n[+] Checking " + site + " for Clickjacking")
status = check(site)
if status:
print("[+] Website is vulnerable to clickjacking !")
f.write("\n[+] Website is vulnerable to clickjacking !")
code = """
<html>
<head><title>Clickjack test page</title></head>
<body>
<p>Website is vulnerable to clickjacking!</p>
<iframe src="{}" width="500" height="500"></iframe>
</body>
</html>""".format(site)
print("\nCLICKJACKING POC:\n", code)
print("\n")
f.write("\n\nCLICKJACKING POC:\n")
f.write(code)
f.write("\n")
elif not status:
print("\n[-] Website is not vulnerable to clickjacking !")
f.write("\n[-] Website is not vulnerable to clickjacking")
else:
print('some error occured ! try again\n')
f.write("\nsome error occured ! try again\n")
f.write("\n\n\n##########################################################################################\n##########################################################################################\n\n\n")
f.close()
if __name__ == '__main__':
main()