MythicAgents / merlin

Cross-platform post-exploitation HTTP Command & Control agent written in golang
GNU General Public License v3.0
88 stars 11 forks source link

Merlin payload build fails #22

Open timukas opened 2 weeks ago

timukas commented 2 weeks ago

Hi,

Running latest Mythic with latest Merlin. Unable to build Merlin payload for windows and linux. I see following error during payload build process:


Sending Build command
there was an error compiling the agent
StdErr: 
exit status 1
StdOut: 
main.go:34:2: github.com/Ne0nd0g/merlin-agent/v2@v2.4.1: replacement directory /opt/merlin-agent does not exist
main.go:35:2: github.com/Ne0nd0g/merlin-agent/v2@v2.4.1: replacement directory /opt/merlin-agent does not exist
main.go:36:2: github.com/Ne0nd0g/merlin-agent/v2@v2.4.1: replacement directory /opt/merlin-agent does not exist
main.go:37:2: github.com/Ne0nd0g/merlin-agent/v2@v2.4.1: replacement directory /opt/merlin-agent does not exist
main.go:38:2: github.com/Ne0nd0g/merlin-agent/v2@v2.4.1: replacement directory /opt/merlin-agent does not exist
Ne0nd0g commented 2 weeks ago

@timukas I'm taking a look at this now

Ne0nd0g commented 2 weeks ago

@timukas I pulled down and installed Mythic, the http C2 profile, and Merlin from source today. After installing them I was able to create an agent without errors.

The error you provided looks like we've modified the go.mod file to reference files in the container. Likely from our conversation at https://github.com/MythicAgents/merlin/issues/17. I removed those directories from the latest commit https://github.com/Ne0nd0g/merlin-docker/commit/6deaf8fb3c1ee15c173f5c3d7dd7f5d0407e1ed0 because they were not necessary and they bloated the image size. As a temporary workaround, you could add the instructions back to your local copy of the Dockerfile in Payload_Type/merlin/Dockerfile like this:

# Clone Merlin Agent
WORKDIR /opt/
RUN git clone -b v2.4.1 https://github.com/Ne0nd0g/merlin-agent
WORKDIR /opt/merlin-agent
RUN go mod download