-
Notifications
You must be signed in to change notification settings - Fork 1
/
CSRF.py
45 lines (30 loc) · 945 Bytes
/
CSRF.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
import os
BASE_DIR = os.getcwd()
print("Please Enter The URL : ")
def crawl():
try:
text = input(https://www.)
os.chdir('quotet')
os.system("del tokens.txt")
with open("url.txt", "w") as f:
f.write(text)
f.close()
os.chdir(BASE_DIR)
os.system(f"cd quotet && scrapy crawl GetCSRFtoken")
os.system(f"cd quotet && scrapy crawl GetCSRFtoken")
except:
pass
def checkVulnerable():
try:
os.chdir('quotet')
with open("tokens.txt", "r") as f:
tokens = f.readlines()
f.close()
if((tokens[0][:-1])==tokens[1]):
print(">>-----------------CSRF Vulnerable------------------<<")
else:
print(">>-----------------NOT CSRF Vulnerable------------------<<")
except:
pass
crawl()
checkVulnerable()