Summary
Configures the default 64-bit executable and arguments used for post-exploitation jobs that require process creation. Sets the application path and optional arguments in Apollo’s process manager for use by commands likespawn and other process injection operations.
- Needs Admin: False
- Version: 2
- Author: @djhohnstein
Arguments
- application (String, Required) - Full path to 64-bit executable (default: C:\Windows\System32\rundll32.exe)
- arguments (String, Optional) - Command line arguments to pass to the executable
Usage
Detailed Summary
Agent Execution Flow
1. Parameter Processing
- Deserializes application path and arguments from JSON
- Supports both JSON and command-line parameter formats
- Application parameter is required, arguments are optional
2. Command Line Parsing (Python)
- Handles quoted arguments properly
- Splits command line respecting quote boundaries
- Removes surrounding quotes from arguments
3. Parameter Validation and Setup
- Validates executable path is provided
- Supports both JSON and space-separated formats
- Extracts application path and remaining arguments
4. Process Manager Configuration
- Calls
SetSpawnToon process manager with application, arguments, and x64 flag (true) - Retrieves updated startup info to confirm configuration
- Provides success confirmation with configured values
- Handles configuration failures with error message
Process Manager Integration
SetSpawnTo Method
- Sets 64-bit specific spawn configuration
- Third parameter (true) indicates x64 architecture
- Stores configuration for use by other commands
GetStartupInfo Method
- Retrieves current startup configuration
- Used to confirm successful configuration
- Returns structure with Application and Arguments properties
Default Configuration
Default Values
- Default 64-bit executable:
C:\Windows\System32\rundll32.exe - Default arguments: empty string
- Arguments are optional parameter
Display Parameters
- Shows configured application path
- Includes arguments in display if provided
- Used for task display in Mythic interface
Error Handling
Configuration Failure
- Single error condition: SetSpawnTo method returns false
- Generic error message for configuration failures
- No specific error details provided
Parameter Validation
- Validates that executable path is provided
- Raises exception if no command line provided
- No validation of executable existence or accessibility
Integration with Other Commands
Commands That Use Spawnto Configuration
Based on the code, commands that call_agent.GetProcessManager().GetStartupInfo() will use this configuration:
spawncommand uses startup info for process creation- Other process injection commands may use this configuration
Architecture Relationship
spawnto_x64sets 64-bit configuration (true flag)- Likely counterpart to
spawnto_x86for 32-bit configuration - Commands determine which configuration to use based on payload architecture
Data Structures
SpawnToArgsx64 Structure
Command Parameters
APIs Used
| API | Purpose | Integration |
|---|---|---|
SetSpawnTo() | Configure spawn executable | Apollo ProcessManager |
GetStartupInfo() | Retrieve startup configuration | Apollo ProcessManager |
split_commandline() | Parse command line arguments | Internal Method |
load_args_from_json_string() | Parse JSON parameters | TaskArguments |
MITRE ATT&CK Mapping
- T1055 - Process Injection
Security Considerations
- Process Configuration: Sets default executable for process creation operations
- Persistence: Configuration persists for agent session duration
- Process Selection: Choice of executable affects stealth of subsequent operations
- Command Line Arguments: Arguments may be visible in process listings
Limitations
- No Path Validation: Does not verify executable exists or is accessible
- Session Scope: Configuration limited to current agent session
- Architecture Specific: Only configures 64-bit executable path
- No Error Details: Limited error information on configuration failure
- Static Configuration: Cannot dynamically change based on target requirements
Error Conditions
- No Executable Path: Command line is empty
- Configuration Failed: SetSpawnTo method returns false
- Invalid JSON: Malformed JSON parameters (if using JSON format)
Best Practices
- Executable Selection: Choose legitimate, commonly present executables
- Path Verification: Verify executable exists before configuration
- Argument Consideration: Be aware arguments may be visible in process lists
- Architecture Matching: Ensure executable matches intended architecture (64-bit)
- Default Awareness: Understand default (rundll32.exe) implications