Home

Awesome

Apollo

Apollo is a Windows agent written in C# using the 4.0 .NET Framework designed to be used in SpecterOps training offerings.

Installation

To install Apollo, you'll need Mythic installed on a remote computer. You can find installation instructions for Mythic at the Mythic project page.

From the Mythic install directory, use the following command to install Apollo as the root user:

./mythic-cli install github https://github.com/MythicAgents/Apollo.git

From the Mythic install directory, use the following command to install Apollo as a non-root user:

sudo -E ./mythic-cli install github https://github.com/MythicAgents/Apollo.git

Once installed, restart Mythic to build a new agent.

Notable Features

Commands Manual Quick Reference

CommandSyntaxDescription
assembly_injectassembly_inject -PID [pid] -Assembly [assembly] -Arguments [args]Execute .NET assembly in remote process.
blockdllsblockdlls -EnableBlock [false]Block non-Microsoft signed DLLs from loading into post-ex jobs.
catcat -Path [file]Retrieve the output of a file.
cdcd -Path [dir]Change working directory.
cpcp -Path [source] -Destination [destination]Copy a file from path to destination.
dcsyncdcsync -Domain contoso.local [-User username -DC dc.ip]DCSync one or more user credentials
downloaddownload -Path [path] [-Host [hostname]]Download a file off the target system.
execute_assemblyexecute_assembly -Assembly [assembly.exe] -Arguments [args]Execute a .NET assembly registered with register_file
execute_coffexecute_coff -Coff [object.x64.o] -Function [go] -Timeout [30] [-Arguments [args]]Execute a object file (BOF) that's been registered with register_file
execute_peexecute_pe -PE [binary.exe] -Arguments [args]Execute a statically compiled executable that's been registered with register_file
exitexitTask agent to exit.
get_injection_techniquesget_injection_techniquesShow currently registered injection techniques as well as the current technique.
getprivsgetprivsEnable as many privileges as possible for the current access token.
ifconfigifconfigGet Network Adapters and Interfaces
injectinjectInject a new payload into a remote process.
inline_assemblyinline_assembly -Assembly [Assembly.exe] -Arguments [Additional Args]Execute a .NET assembly in the currently executing process that's been registered with register_file
jobkilljobkill [jid]Kill a running job in the agent.
jobsjobsList all running jobs.
keylog_injectkeylog_inject -PID [pid]Inject a keylogger into a remote process.
killkill -PID [pid]Attempt to kill the process specified by [pid].
linklinkLink to a P2P agent via SMB or TCP. Modal popup only.
loadload command1 command2 ...Load new commands into the agent.
lsls [-Path [path]]List files and folders in [path]. Defaults to current working directory.
make_tokenmake_tokenImpersonate a user using plaintext credentials. Modal popup.
mimikatzmimikatz -Command [args]Execute Mimikatz with the specified arguments.
mkdirmkdir -Path [dir]Create a directory.
mvmv -Path [source] -Destination [destination]Move a file from source to destination. Modal popup.
net_dclistnet_dclist [domain.local]List all domain controllers for the current or specified domain.
net_localgroup_membernet_localgroup_member -Group [groupname] [-Computer [computername]]Retrieve membership information from a specified group on a given computer.
net_localgroupnet_localgroup [computer]Retrieve local groups known by a computer. Default to localhost.
net_sharesnet_shares [-Computer [computer]]Show shares of a remote PC.
netstatnetstat [-Tcp -Udp -Established -Listen]Get TCP and UDP connections
powerpickpowerpick -Command [command]Executes PowerShell in a sacrificial process.
powershellpowershell -Command [command]Executes PowerShell in your currently running process.
powershell_importpowershell_importRegister a new .ps1 file to be used in other PowerShell jobs
ppidppid -PID [pid_integer]Set the PPID of sacrificial jobs to the specified PID.
printspooferprintspoofer -Command [command]Execute a command in SYSTEM integrity so long as you have SeImpersonate privileges.
pspsList process information.
psinjectpsinject -PID [pid] -Command [command]Executes PowerShell in the process specified by [pid]. Note: Currently stdout is not captured of child processes if not explicitly captured into a variable or via inline execution (such as $(whoami)).
pthpth -Domain [domain] -User [username] -NTLM [ntlm_hash] [-AES128 [aes128_key] -AES256 [aes256_key] -Run [program.exe]]Use mimikatz's pth module to spawn a process with alternate credentials.
pwdpwdPrint working directory.
reg_query`reg_query -Hive [HKCU:\HKU:\
reg_write_value`reg_write_value -Hive [HKCU:\HKU:\
register_assemblyregister_assemblyRegister a .NET assembly with the agent to be used in .NET post-exploitation activities
register_fileregister_fileRegister a file to the agent's file cache. Used to store assemblies, executables, and PowerShell scripts.
rev2selfrev2selfRevert the access token to the original access token.
rmrm -Path [path] [-Host [hostname] -File [filename]]Remove a file specified by [path]. Alternatively, if -File is provided, -Path will be used as the directory, and -File will be the filename.
runrun -Executable [binary.exe] -Arguments [args]Runs the binary specified by [binary.exe] with passed arguments (if any).
scsc [-Query|-Start|-Stop|-Create|-Delete] [-Computer [computername] -DisplayName [display_name] -ServiceName [servicename] -BinPath [binpath]].NET implementation of the Service Control Manager.
screenshot_injectscreenshot_inject -PID [pid] [-Interval [int] -Count [int]]Get a screenshot of the desktop session associated with PID every Interval seconds for Count screenshots.
screenshotscreenshotGet a screenshot of the current screen.
set_injection_techniqueset_injection_technique [technique]Set the injection technique used in post-ex jobs that require injection.
shellshell [command]Run a shell command which will translate to a process being spawned with command line: cmd.exe /S /c [command]
shinjectshinjectInject given shellcode into a specified pid. Modal popup only.
sleepsleep [seconds]Set the callback interval of the agent in seconds.
sockssocks -Port [port]Standup the socks server to proxy network traffic, routable via Mythic on [port].
spawnspawnSpawn a new callback in the postex process specified by spawnto_*.
spawnto_x64spawnto_x64 -Application [path] -Arguments [args]Sets the process used in jobs requiring sacrificial processes to the specified [path] with arguments [args].
spawnto_x86spawnto_x86 -Application [path] -Arguments [args]Sets the process used in jobs requiring sacrificial processes to the specified [path] with arguments [args].
steal_tokensteal_token [pid]Attempts to steal the process's primary token specified by [pid] and apply it to our own session.
unlinkunlinkUnlink a callback linked to via the link command. Modal popup only.
uploaduploadUpload a file to a remote path on the machine. Modal popup only.
whoamiwhoamiReport access token for local and remote operations.

Supported C2 Profiles

HTTP Profile

The HTTP profile calls back to the Mythic server over the basic, non-dynamic profile. When selecting options to be stamped into Apollo at compile time, all options are respected with the exception of those parameters relating to GET requests.

SMB Profile

Establish communications over SMB named pipes. By default, the named pipe name will be a randomly generated GUID.

TCP Profile

Establish communications over a specified network socket. Note: If unelevated, the user may receive a prompt to allow communications from the binary to occur over the network.

SOCKSv5 Support

Apollo can route SOCKS traffic regardless of what other commands are compiled in. To start the socks server, issue socks -Port [port]. This starts a SOCKS server on the Mythic server which is proxychains4 compatible. To stop the SOCKS proxy, navigate to the SOCKS page in the Mythic UI and terminate it.

Quality of Life Improvements

File Triage

The ls command reports back a wealth of information and allows operators to easily copy file paths and examine permissions of files, in addition to being able to sort and filter files. Clicking the icon under the ACLs column will show all the permissions of a file. Additionally, this hooks into Mythic's native file browser.

This shows typical ls output: ls browserscript

Interfaces with Mythic's filebrowser and caches data server-side: ls mythic builtin

Process Listings

When issuing ps, additional details are retrieved such as:

This process listing also interfaces with Mythic's builtin process browser, which allows you to see process trees more easily.

Lastly, the associated browser script will do row highlighting based on the process's name (in a one-to-one port of this script)

ps

Portable Executable, Assembly, and PowerShell Script Caching

Apollo can cache files for expeditious task execution. In general, control flow follows the register_file command followed by whatever command you wish to execute (execute_assembly, powerpick, execute_pe, etc.). These files are cached client side via DPAPI encrypted AES256 blobs, preventing their signatures being exposed outside of task execution.

Dynamic Injection Techniques

The agent can change what code injection technique is in use by post-exploitation jobs that require injection through a suite of injection commands. Currently, injection techniques that are supported:

injection

Job Tracking

Agent jobs are tracked by job ID, by command, and by the arguments passed to the command so that you know what job correlates to what tasking.

jobs

Artifact Tracking

Commands that manipulate the disk, create new logons, or spawn new processes will document those changes in the Artifact Reporting page as shown below.

artifacts

And more!

There's a number of niceities that come with pairing an agent to Mythic - too many to list in one README. Install the agent and see for yourself!

Special Thanks

A big thanks goes to those who have contributed to the project in both major and minor ways.