Offensive Lua

February 2, 2026 ยท View on GitHub

Offensive Lua is a comprehensive collection of offensive security and red team scripts written in Lua with FFI (Foreign Function Interface). These scripts leverage the power and flexibility of LuaJIT on Microsoft Windows to perform advanced penetration testing and red teaming operations.

Key Capabilities

  • Execution & Deployment: Download, execute, and deploy payloads
  • Privilege Escalation: UAC bypass techniques and privilege escalation
  • System Interaction: Files, memory manipulation, networking, and registry operations
  • Remote Access: Bind shells and reverse connections
  • Reconnaissance: System enumeration and information gathering alternatives
  • Surveillance: Audio/video capture, keylogging, and screenshot capabilities
  • Credential Harvesting: Password vault dumping and credential extraction

Why Lua for Offensive Security?

Lua is an exceptional choice for post-exploitation and offensive security scripting due to several strategic advantages:

  • Stealth & Evasion: Lesser-known language with minimal security product signatures
  • Lightweight Footprint: Extremely small runtime with minimal system impact
  • Memory Execution: Runs interpreted or as bytecode directly from memory
  • Native Integration: FFI enables direct interaction with Windows APIs and system libraries
  • Rapid Development: Simple syntax allows for quick script adaptation and customization
  • Obfuscation Ready: Trivial to obfuscate and modify for evasion purposes
  • JIT Performance: Just-in-time compilation provides near-native execution speed
  • Embedding Flexibility: Easy to embed within other applications or frameworks
FilenameDescription
bin2hex.luaConvert a binary to hex for binrun.lua
binrun.luaWrites a hex of EXE to a random location and exec's
bindshell.luabind a shell on TCP port 5000
ComputerDefaultsUACBypass.luaBypass UAC restrictions via ms-settings
console.luaConsole App Example
downloadexec.luaDownload & Exec over HTTP
downloadexec_UACbypass.luaDownload & BypassUAC & Exec over HTTP
efspotato.luaIncomplete efspotato
eventcode.luaExample of Windows Event handler
filewrite.luaWrite a file
howami.luaAlways whoami.exe never howami.lua
keyboard_capture.luaCapture keyboard input and keystrokes
listprocess.luaList running processes
memorysearch.luasearches memory for passwords
memorysearch_stringdump.luaDump strings from process memory
messagebox.luaMessageBox Example
microphone_capture.luaCapture microphone audio
OffensiveLuaEmbedded.exeEmbedded LuaJIT interpreter with debugging features
regread.luaRead from Registry
regwrite.luaWrite to Registry
regwritedel.luaWrite and Delete from Registry
rickroll.luaOpen a browser on URL
runcmd.luaRun a command popen
runcmd2.luaRun a command os.execute
runswhide.luaRun a command via CreateProcess with SW_HIDE
screenshot.luaCapture desktop screenshot
screenshot_withhiddenwindows.luaCapture screenshot including hidden windows
uac_bypass_bluetooth_win10.luaBypass UAC via Bluetooth on Windows10
vaultdump.luaDump Windows Credential Manager and Password Vault
webcam_picture_directshow.luaCapture webcam picture using DirectShow
webcam_picture_simple.luaCapture webcam picture using simple method
webcam_video_directshow.luaRecord webcam video using DirectShow
webcam_video_simple.luaRecord webcam video using simple method

Usage

The OffensiveLuaEmbedded.exe interpreter provides advanced debugging and execution capabilities essential for red team operations and offensive security development. These features enable operators to analyze script behavior, optimize performance, troubleshoot issues in hostile environments, and develop evasion techniques:

Why Use Advanced Debugging?

  • Single-step execution: Step through scripts line-by-line to understand API interactions and identify detection points
  • Memory analysis: Monitor memory usage patterns to minimize forensic footprints and optimize stealth
  • Bytecode inspection: Analyze compiled bytecode for obfuscation effectiveness and anti-analysis techniques
  • Trace analysis: Review script execution flow to identify bottlenecks or suspicious behavior patterns
  • Interactive debugging: Test script modifications in real-time during engagements without recompilation
  • Performance profiling: Optimize scripts for speed and resource efficiency in target environments
Offensive LuaJIT Debugger
Usage: OffensiveLuaEmbedded.exe [options] <script.lua> [args...]

Options:
  --interactive, -i      Enable interactive debugging mode.
  --dump-bytecode, -d    Create .lbin bytecode file with hexdump.
  --trace, -t            Trace every executed line.
  --count, -c            Track instruction samples.
  --memory, -m           Print memory summary after execution.
  --vm, -v               Instrument VM with timing and diagnostics.
  --version              Show version information.
  --help, -h             Show this help message.

Example Usage

For instance, to read all the credentials from your current execution context in Microsoft Password Vault, run:

.\OffensiveLuaEmbedded.exe vaultdump.lua

This demonstrates the power of Offensive Lua - with a single command, you can dump the Windows credential store and extract stored passwords, tokens, and authentication data. The script leverages Windows APIs through FFI to access the Password Vault that applications use to securely store user credentials.

OffensiveLuaEmbedded

An example Visual Studio 2022 project that can be used to embed LuaJIT into a binary for the purposes of running scripts. You will need to checkout the git submodules to get the latest LuaJIT branch.

Important: Read the comments throughout the source code to understand embedding nuances and pitfalls to avoid. The comments contain critical implementation details and best practices for successful LuaJIT embedding.

More

You can learn more about Hacker House and Offensive Lua at our website:

License

These files are available under the 3-clause BSD license.