Skip to content

Instantly share code, notes, and snippets.

View neomafo88's full-sized avatar
🏠
Remote

Neoma Fong neomafo88

🏠
Remote
View GitHub Profile
@Blevene
Blevene / Ssh_Musl_password_bypass.md
Last active November 8, 2026 17:32
reproduction and detection: SSH x Musl Password Bypass

Validating the OpenSSH × musl password-authentication bypass: one correction to the public disclosure, one bound confirmed, and what detection actually looks like

This report is self-contained: a reader with no access to our systems can understand the bug, the one correction we validated against the public disclosure, the claim of theirs we confirmed, and every detection claim, with all decisive evidence quoted verbatim in Appendix A and the detection tools reproduced verbatim in Appendix B. Scope boundary: this is a validation and detection report, not an exploitation report — we claim no evidence of this bug being used in the wild, and nothing here was tested against a production fleet. Raw logs are retained by us and available on request.

Terms used in this report: musl is a lightweight C library used as the system libc on Alpine Linux, OpenWrt, and Buildroot images. An arm (noun) is one lab test configuration — a specific sshd build plus an account layout plus a password policy (distinct

"""Recover Hikari AArch64 indirect control flow with PREOPT microcode.
Patch one-way BRs to B, model two-way BRs as synthetic switches, expand function ranges until the CFG reaches a fixed point, then restore conditional branches through the F5 hook.
Requires IDA Pro 9.4+, Hex-Rays, and keystone-engine; load the script and choose "deobfuscate it" or call recover_current_function(), with changes saved only to the IDB and reversible through rollback_function().
Thanks to Hex-Rays for sponsoring the r3kapig team!
"""
from __future__ import annotations
@struppigel
struppigel / hook.js
Created September 6, 2026 05:49
JS hook script stub
module.paths.unshift(
"modulepathes"
);
const originalLog = console.log.bind(console)
function log(message){
originalLog(message);
}
@struppigel
struppigel / hook_minimal.js
Last active September 16, 2026 18:12
JS hook script with reflection (LLM generated)
// minimal_generic_hook.js — generic-hooking analysis harness (v3, pluggable loader)
// Run: set ELECTRON_RUN_AS_NODE=1 && launcher.exe minimal_generic_hook.js
//
// Spies every module the sample itself requires (auto-wrapping all functions/constructors)
// and PASSES THROUGH the real modules. Only child_process is neutralized (so it can't spawn an
// uninstrumented next stage). Real modules execute — run on an isolated VM with no Internet.
// ===== per-sample CONFIG (the only part you edit between samples) =====
const CONFIG = {
payload: "-put path to .jsc here-", // .jsc bytecode OR a .js entry
@drego85
drego85 / mirax_extract_pipeline.py
Created April 15, 2026 14:58
Automated Mirax dropper unpacker that derives RESOURCE_KEY and extracts embedded payload APKs from StreamTV-like samples.
#!/usr/bin/env python3
"""
Mirax extraction pipeline for StreamTV-like droppers.
Threat intelligence recap (based on the analyzed streamtv_* samples):
- The visible APK is usually a dropper stage.
- A bootstrap Application class loads a deeply hidden asset from assets/.
- That hidden blob is RC4-encrypted; the RC4 key is hardcoded in the bootstrap class.
- After RC4 decryption, the blob becomes a stage-1 ZIP containing classes*.dex.
- Stage-1 code embeds the RESOURCE_KEY (64-hex), used for storage/payload decryption.
#!/usr/bin/env bash
set -euo pipefail
# patch-claude-code.sh — Rebalance Claude Code prompts to fix corner-cutting behavior
#
# What this does:
# Patches the npm-installed @anthropic-ai/claude-code cli.js to rebalance
# system prompt instructions that cause the model to cut corners, simplify
# excessively, and defer complicated work.
#
@karpathy
karpathy / microgpt.py
Last active December 2, 2026 04:50
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@allenyllee
allenyllee / medium.user.js
Last active August 9, 2026 15:50 — forked from mathix420/medium.user.js
Bypass Medium Paywall - Working at Jan 2026 - Greasy Fork, Violentmonkey, Tampermonkey - Click the RAW button to install
// ==UserScript==
// @name Medium Paywall Bypass (Manual Button + Badge + Fallback + Offline)
// @namespace Violentmonkey Scripts
// @run-at document-start
// @match *://*.medium.com/*
// @match *://medium.com/*
// @match *://*/*
// @grant none
// @version 3.5
// @inject-into content

• Investigation Log

  • Connected to IDA session, captured module hashes, enumerated exports (DllEntryPoint, Crash) to frame analysis scope.
  • Decompiled Crash → LaunchConfiguredIec104Sessions:0x100014e0, observed config parsing call and thread fan-out via CreateThread (0x10001547), then traced worker entry StartAddress to identify IEC‑104 workflow.
  • Analyzed ParseIec104ConfigFile:0x10001610; confirmed _wfopen (0x10001674) and _fgets usage, mapped keywords target_ip, target_port, sequence, stop_comm_service, command_type, operation, shift, range, uselog at refs 0x100017B0–0x10002004 to per-session structure fields.
  • Inspected RunIec104SessionWorker:0x10002FE0; documented service-kill logic (OpenProcess 0x1000303D / TerminateProcess 0x10003046), IEC-104 connect (Iec104Connect 0x10003079), handshake (SendStartupSequence 0x1000309D), sequence dispatch (range 0x1000315D, shift 0x100031AE) and command emission (IssueSingleCommand calls at 0x1000331A/0x1000335E/0x100034E6/0x10003507).
  • Reverse engineere
  • Step 1: Reviewed DriverEntry (0x140001000) to record the device pair \Device\KApcHelper1 / \DosDevices\KApcHelperLink1, blanket dispatch table, and registration of ProcessCreateNotifyHandler plus a dummy thread notify hook.
  • Step 2: Traced the init path into ResolveKernelApis (0x140001244) and LocateThreadFlagSetterPattern (0x1400014B0) to understand which kernel services and hidden thread helpers the driver depends on.
  • Step 3: Decompiled DeviceControlDispatcher (0x140001B70) to map IOCTLs, uncover the handshake scheme, and note how every command is obfuscated by the HandshakeSeed.
  • Step 4: Followed the command flow into HandleHandshakeSeed (0x140001124) to confirm token generation/validation and the use of HandshakeValidated as a global gate.