-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb_vuln_scanner.py
More file actions
32 lines (27 loc) · 986 Bytes
/
web_vuln_scanner.py
File metadata and controls
32 lines (27 loc) · 986 Bytes
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
import requests
from bs4 import BeautifulSoup
def check_sql_injection(url):
payload = "' OR '1'='1"
response = requests.get(url + payload)
if "error" in response.text.lower() or "sql" in response.text.lower():
return False
return True
def check_xss(url):
payload = "<script>alert('XSS')</script>"
response = requests.get(url + payload)
if payload in response.text:
return True
return False
def scan_website(url):
print(f"Scanning {url} for vulnerabilities...")
if check_sql_injection(url):
print("Potential SQL Injection vulnerability found!")
else:
print("No SQL Injection vulnerability detected.")
if check_xss(url):
print("Potential XSS vulnerability found!")
else:
print("No XSS vulnerability detected.")
if __name__ == "__main__":
target_url = input("Enter the URL to scan (e.g., http://example.com/page.php): ")
scan_website(target_url)