Skip to content

Renef v0.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 26 Nov 11:44

Renef v0.4.0

Dynamic Instrumentation Toolkit for Android ARM64

What's New

  • Hook output on its own channel: what hooks and the syscall tracer print no longer ends up in front of the next command's reply. The server holds it until watch or events asks; every other command prints only its own result. hooks shows a hits= counter per hook.

  • Framed requests: replies end exactly where they end. Large scripts are delivered intact (the 64 KB limit is gone), late replies are no longer mixed up, and exec / rpc take --timeout.

  • Native hook engine reworked: one-instruction patch, correct relocation of PC-relative instructions, execute-only code, 128 hooks per session, and hooks on functions the agent itself uses (malloc, write, ...).

  • Java hooks rebuilt (Android 12+): a hooked method that throws, or a garbage collection at the wrong moment, no longer crashes the app. float/double and stack arguments work, Java hooks are listed in hooks and removable with unhook.

  • Python client rewritten: pure Python, talks to renef_server directly, no native library, works on macOS and Linux.

  • New Lua APIs: Interceptor.replace / Interceptor.revert, NativeFunction with float/double, async hooks, send(table) events, Module.disassemble, Process.enumerateRanges / enumerateThreads, Java.enumerateLoadedClasses, hooks on libraries that are not loaded yet.

  • New commands: rpc, events, exec --json, memdump (read a process without injecting), mcp, plugin / format, --headless and --timeout for pipelines.

  • Injection through a code cave: only one instruction of malloc() changes while the agent loads.

  • Plugins and recipes: new plugin types with JSON results, and ready-to-run scripts in scripts/recipes/ (SSL pinning, root / Frida / emulator detection, taint filter, engine capture, reflection dump).

  • Fixed: hookn, ms on devices with Mali GPUs, watch under continuous output, hooks with many hooks installed, Syscall.trace("openat"), commands containing //.

Full release notes and known limitations: https://renef.io (Release Notes, v0.4.0).

Commits

  • Fix missing include and portable format specifiers in cmd_hookgen.cpp (3ea5171)
  • Fix Java hook engine crash on hash-style=gnu-only libraries, add onLeave String replace (2b4151e)
  • frida_labs: challenge_0xA uses NativeFunction (0.4.0); re-verified on 0.4.0 (fa5e320)
  • examples: Renef Lua solutions for all 11 Frida_Labs challenges (dd40490)
  • Release 0.4.0 (88728d2)
  • Add pentest recipes, example plugins and test scripts (e92ac3d)
  • Rewrite the Python client in pure Python (dfc2713)
  • Rework the native hook engine, rebuild Java hooks, harden injection (cc52a88)
  • Add framed requests, a separate channel for hook output and new commands (87ec335)
  • List apps command fix (a99298b)
  • Version bump (cdce38b)
  • Memory allocation API added (alloc, allocStr, protect, free) (16df0e2)
  • README updated (cffcd5f)
  • Fixes (ea2748e)
  • Macos and Android 11 fixes (23b3a2e)
  • Android 11 fix (888b4ba)
  • Pause mode changed with ptrace (cbca69e)

Downloads

Platform-specific releases:

  • renef-v0.4.0-linux-x64.tar.gz - Linux x64 client + scripts
  • renef-v0.4.0-macos-x64.tar.gz - macOS Intel client + scripts
  • renef-v0.4.0-macos-arm64.tar.gz - macOS Silicon client + scripts
  • renef-v0.4.0-android-arm64.tar.gz - Android server + payload

All-in-one release:

  • renef-v0.4.0-all-platforms.tar.gz - All platforms + scripts

Verification

Verify downloads using SHA256 checksums in SHA256SUMS.txt

Quick Start

tar xzf renef-v0.4.0-linux-x64.tar.gz
cd renef-linux-x64

adb push ../renef-android-arm64/renef_server /data/local/tmp/
adb push ../renef-android-arm64/libagent.so /data/local/tmp/.r
adb shell chmod +x /data/local/tmp/renef_server

adb forward tcp:1907 localabstract:com.android.internal.os.RuntimeInit
adb shell /data/local/tmp/renef_server &
./renef

Documentation

System Requirements

Client:

  • Linux (x64) or macOS (Intel/Silicon)
  • libreadline (Linux/macOS)

Target Device:

  • Android 5.0+ (API 21+)
  • ARM64 architecture
  • Root access (for injection)

Dependencies

Built with:

  • Capstone 5.0.3
  • Lua 5.4.7
  • ASIO 1-30-2
  • Android NDK r26b