MythicAgents / Apollo

A .NET Framework 4.0 Windows Agent
BSD 3-Clause "New" or "Revised" License
439 stars 89 forks source link

New Agent Function: meterpreter #15

Closed reznok closed 3 years ago

reznok commented 3 years ago

This PR adds support for injecting meterpreter stager payloads into processes. It will automatically build the shellcode based off of modal inputs. It functions very similarly to shinject, but generates the meterpreter shellcode for you.

For the agent, it functions identically to shinject (Meterpreter.cs is a very slightly altered Shellcode.cs). For mythic, it also functions similarly to shinject by registering a file with the payload's shellcode.

Support is implemented for the following stagers:

windows/x64/meterpreter/reverse_tcp
windows/x64/meterpreter/reverse_http
windows/x64/meterpreter/reverse_https
windows/meterpreter/reverse_tcp
windows/meterpreter/reverse_http
windows/meterpreter/reverse_https

Parameters are input using a modal: https://imgur.com/avBV3r4 The function takes the following parameters:

PID

Target process ID to inject into.

Payload Type

Which stager payload to use (reverse_tcp, reverse_http, reverse_https)

Architecture

Architecture type to use for payload (x86, x64)

LHOST

The IP address of the listening meterpreter handler

LPORT

The port of the listening meterpreter handler