Skip to content

Commit 9dcc7e9

Browse files
committed
Updated-XSS-Scanner
1 parent d98cfc5 commit 9dcc7e9

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

Python/XSS-Check/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ A Python Script to exploit XSS Vulnerability of a URL.
99

1010
## Example
1111

12+
![image](images/xss-check.png)

Python/XSS-Check/XSS-Check.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from bs4 import BeautifulSoup
33
from urllib.parse import urljoin
44
from colorama import Fore, init, Style
5+
from progress.bar import ChargingBar
56

67
init(autoreset=True)
78

@@ -19,7 +20,9 @@ def xss():
1920
forms = getAllForms(url)
2021
for form in forms:
2122
# Getting Payload Scripts for Payloads file
23+
bar = ChargingBar(Fore.GREEN + 'Injecting Scripts and finding XSS Vulnerability', max=36)
2224
for payload in f:
25+
bar.next()
2326
# Getting the URL where the form data will be sent
2427
action = form.attrs.get('action').lower()
2528
finalURL = urljoin(url, action)
@@ -43,13 +46,16 @@ def xss():
4346
# Return True if Payload was successfully Injected
4447
if payload in content.text:
4548
successful_payloads.append(payload)
46-
print(Fore.CYAN + "\nPayload Injected Successfully --> " + Fore.YELLOW + payload)
49+
50+
bar.finish()
4751

4852

4953
url = input(Fore.BLUE + "\nEnter the URL: ")
5054
vulnerable = xss()
5155

5256
if len(successful_payloads):
53-
print(Fore.GREEN + "\nSite is vulnerable to XSS Attack!")
57+
print(Fore.GREEN + "\nSite is vulnerable to XSS Attack!\n")
58+
for i in successful_payloads:
59+
print(Fore.CYAN + "Payload Injected Successfully --> " + Fore.YELLOW + i)
5460
else:
5561
print(Fore.RED + Style.BRIGHT + "\nXSS Vulnerability not Present!")

Python/XSS-Check/images/xss-check.png

25.8 KB
Loading

Python/XSS-Check/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
bs4==0.0.1
22
colorama==0.4.3
3+
progress==1.5
34
requests==2.24.0

0 commit comments

Comments
 (0)