A modern, modular, and feature-rich shellcode framework for security research and red team operations.
- Advanced plugin system with dynamic loading
- Microservices architecture with message passing
- Plugin dependency management and sandboxing
- Support for COFF/BOF style object files
- Name-based and ordinal-based API resolution
- Intelligent caching system for improved performance
- Forwarded export resolution support
- Fallback mechanisms for robustness
- Anti-analysis and anti-debugging techniques
- String encryption and control flow obfuscation
- Runtime packing/unpacking capabilities
- Environmental keying and time-based activation
- Lightweight TCP/IP stack implementation
- HTTP/HTTPS client functionality
- DNS resolution capabilities
- Proxy support and tunneling
- Comprehensive unit testing framework
- Detailed API documentation
- Step-by-step tutorials and examples
- Analysis and debugging utilities
Stardust Core
├── Core Modules
│ ├── Memory Manager
│ ├── API Resolver
│ ├── String Handler
│ └── Error Handler
├── Plugin System
│ ├── Plugin Loader
│ ├── Plugin Manager
│ └── Plugin Sandbox
├── Communication Layer
│ ├── IPC Manager
│ └── Message Queue
└── Security Layer
├── Encryption Engine
├── Obfuscation Engine
└── Anti-Analysis Module
The advanced plugin system supports dynamic loading, dependency management, and secure sandboxing:
class IPlugin {
public:
virtual PluginResult Initialize(PluginContext* context) = 0;
virtual PluginResult Execute(PluginContext* context) = 0;
virtual PluginResult Cleanup(PluginContext* context) = 0;
virtual const PluginInfo* GetInfo() const = 0;
virtual uint32_t GetCapabilities() const = 0;
virtual PluginResult SendMessage(uint32_t message_id, const void* data, uint32_t data_size) = 0;
virtual PluginResult ReceiveMessage(uint32_t message_id, void* data, uint32_t* data_size) = 0;
};Enhanced API resolution with caching for improved performance:
// Name-based resolution with caching
decltype(MessageBoxA) * msgbox = RESOLVE_API(user32.handle, MessageBoxA);
// Ordinal-based resolution for performance
decltype(LoadLibraryA) * loadlib = RESOLVE_API_ORDINAL(kernel32.handle, 624);
// Direct cached access
uintptr_t cached_addr = resolve::EnhancedResolver::GetCachedAddress(module_hash, symbol_hash);- Clang compiler with MinGW-w64 targets
- NASM assembler
- objcopy utility
makemake debugmake x64 # bin/stardust.x64.exe + .bin
make x86 # bin/stardust.x86.exe + .binmake plugin-samplemake cleanmake stomper# For 64-bit shellcode
./test/stomper.x64.exe ./bin/stardust.x64.bin
# For 32-bit shellcode
./test/stomper.x86.exe ./bin/stardust.x86.bin- Release:
bin/stardust.x64.exe,bin/stardust.x64.binbin/stardust.x86.exe,bin/stardust.x86.bin
- Debug (coexists with release):
bin/stardust.x64.debug.exe,bin/stardust.x64.debug.binbin/stardust.x86.debug.exe,bin/stardust.x86.debug.bin
- Plugins:
bin/plugins/sample_plugin.x64.dll,bin/plugins/sample_plugin.x86.dll
The simple GUI writes config/config.h which is compiled first (Makefile/CMake include config/).
It sets macros used by the code:
- Feature toggles:
ENABLE_ANTI_STATIC,ENABLE_RUNTIME_METAMORPHOSIS,ENABLE_ENVIRONMENT_KEYING,ENABLE_TIME_BASED_ACTIVATION,ENABLE_ETW_PATCHING,ENABLE_AMSI_BYPASS - Groups:
INCLUDE_STRINGS,INCLUDE_API_RESOLUTION,INCLUDE_INJECTION,INCLUDE_PERSISTENCE,INCLUDE_CREDENTIAL_ACCESS - Communication:
C2_PROTOCOL(string),C2_INTERVAL,C2_JITTER - Execution/persistence:
INJECTION_METHOD,PERSISTENCE_METHOD(strings)
Debug builds are still controlled by -D DEBUG in make debug.
At runtime, the core will enumerate and invoke plugins from bin\plugins\*.dll (and plugins\*.dll fallback),
calling CreatePlugin/DestroyPlugin and executing Initialize → Execute → Cleanup for each plugin instance.
Stardust supports modular configuration through compile-time flags:
// Enable specific features
#define FEATURE_INJECTION 1
#define FEATURE_PERSISTENCE 1
#define FEATURE_CREDENTIAL_ACCESS 1
// Configure security features
#define ENABLE_ANTI_STATIC 1
#define ENABLE_ETW_PATCHING 1
#define ENABLE_AMSI_BYPASS 1
// Set communication protocol
#define C2_PROTOCOL "https"
#define C2_INTERVAL 60Custom heap management with encryption and scrambling:
void* secure_mem = stardust::memory::SecureAllocate(size);
stardust::memory::SecureFree(secure_mem);Runtime string encryption/decryption:
const char* encrypted = stardust::crypto::EncryptString("sensitive_data");
const char* decrypted = stardust::crypto::DecryptString(encrypted);Multiple injection techniques:
stardust::inject::CreateRemoteThread(target, shellcode, size);
stardust::inject::NtCreateThreadEx(target, shellcode, size);The framework implements various security features to avoid detection:
- Anti-Analysis: Multiple anti-debugging and virtualization detection techniques
- Obfuscation: Control flow obfuscation and junk code insertion
- Encryption: Runtime encryption for sensitive strings and data
- Evasion: ETW patching, AMSI bypass, and syscall obfuscation
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is intended for security research and educational purposes only. Any misuse of this tool is not the responsibility of the author.