File tree Expand file tree Collapse file tree 1 file changed +0
-10
lines changed Expand file tree Collapse file tree 1 file changed +0
-10
lines changed Original file line number Diff line number Diff line change 3
3
from urllib .parse import urljoin
4
4
from colorama import Fore , init , Style
5
5
from progress .bar import ChargingBar
6
-
7
6
init (autoreset = True )
8
-
9
7
# Get all forms of the mentioned URL
10
8
def getAllForms (url ):
11
9
page = requests .get (url )
12
10
parser = BeautifulSoup (page .content , 'html.parser' )
13
11
return parser .find_all ('form' )
14
-
15
12
f = open ("payloads.txt" , "r" ).readlines ()
16
-
17
13
successful_payloads = []
18
-
19
14
def xss ():
20
15
forms = getAllForms (url )
21
16
for form in forms :
@@ -42,17 +37,12 @@ def xss():
42
37
content = requests .post (finalURL , data = randomData )
43
38
else :
44
39
content = requests .get (finalURL , params = randomData )
45
-
46
40
# Return True if Payload was successfully Injected
47
41
if payload in content .text :
48
42
successful_payloads .append (payload )
49
-
50
43
bar .finish ()
51
-
52
-
53
44
url = input (Fore .BLUE + "\n Enter the URL: " )
54
45
vulnerable = xss ()
55
-
56
46
if len (successful_payloads ):
57
47
print (Fore .GREEN + "\n Site is vulnerable to XSS Attack!\n " )
58
48
for i in successful_payloads :
You can’t perform that action at this time.
0 commit comments