Exploit database

GH-14fb583d3d1bd2da10251bb1a37b93d6

gitchw/ghostlock-cve-2026-43499

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-43499

170 sources

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

Repository files354
gitchw/ghostlock-cve-2026-43499Revision 96acd93156f6
Next files →

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

workspace/qemu/serial_drive.py

Python · 2,527 bytes
#!/usr/bin/env python3
"""Minimal driver for QEMU serial telnet console."""
import socket, sys, time, re

IAC = 255; DONT=254; DO=253; WONT=252; WILL=251; SB=250; SE=240

class Console:
    def __init__(self, host='127.0.0.1', port=5556):
        self.s = socket.create_connection((host, port), timeout=5)
        self.buf = b''
    def _strip(self, data):
        out = b''; i = 0
        while i < len(data):
            b = data[i]
            if b == IAC:
                if i+1 < len(data) and data[i+1] == IAC:
                    out += b'\xff'; i += 2; continue
                if i+2 < len(data) and data[i+1] in (DO, DONT, WILL, WONT):
                    i += 3; continue
                if i+1 < len(data) and data[i+1] == SB:
                    j = data.find(bytes([SE]), i+2)
                    i = j+1 if j >= 0 else len(data); continue
                i += 2; continue
            out += bytes([b]); i += 1
        return out
    def read_some(self, timeout=2.0):
        self.s.settimeout(timeout); data = b''
        try:
            while True:
                chunk = self.s.recv(4096)
                if not chunk: break
                data += chunk
                if len(data) > 200000: break
        except socket.timeout:
            pass
        data = self._strip(data)
        self.buf += data
        return data.decode('utf-8', 'replace')
    def wait_for(self, pat, timeout=30.0):
        rx = re.compile(pat, re.S)
        end = time.time()+timeout
        while time.time() < end:
            m = rx.search(self.buf.decode('utf-8','replace'))
            if m: return m
            self.read_some(min(2.0, end-time.time()))
        return None
    def send(self, cmd):
        # refuse telnet options first
        for opt in (1,3,34):
            self.s.sendall(bytes([IAC, WONT, opt, IAC, DONT, opt]))
        self.s.sendall(cmd.encode() + b'\n')
    def run(self, cmd, marker='__RC_%d__', timeout=30.0):
        token = 'RC%06d' % (int(time.time()*1000)%1000000)
        self.buf = b''
        self.send(cmd + '; echo ' + token + '=$?')
        m = self.wait_for(token + r'=(\d+)', timeout)
        out = self.buf.decode('utf-8','replace')
        if not m:
            return None, out
        return int(m.group(1)), out

if __name__ == '__main__':
    c = Console()
    time.sleep(1)
    c.send('')
    c.wait_for(r'[/#]', 40)
    for cmd in sys.argv[1:]:
        rc, out = c.run(cmd, timeout=60)
        print('### CMD:', cmd)
        print(out[-3000:])
        print('### RC =', rc)