MythicAgents / thanatos

Mythic C2 agent targeting Linux and Windows hosts written in Rust
BSD 3-Clause "New" or "Revised" License
310 stars 42 forks source link

socks draft #1

Closed DarkC0ntributor closed 11 months ago

DarkC0ntributor commented 2 years ago

Hi, I would like to add the Socks Client, but I am still new to Mythic, so I still have to figure out the python/docker/building part

MEhrn00 commented 2 years ago

Awesome thanks! I created a socks branch on the main repository which includes your changes along with the Mythic server code for a socks command https://github.com/MythicAgents/tetanus/tree/socks. Once everything is working well on your end, I can merge it into the socks branch.

I did some basic testing and found that the agent will fail getting the initial tasking from the Mythic server. It looks like the issue is due to the fact that not all tasking responses will include a socks field in the JSON. Wrapping this socks field in an option should get rid of that error https://github.com/MythicAgents/tetanus/blob/socks/Payload_Type/tetanus/agent_code/src/agent.rs#L44.

DarkC0ntributor commented 2 years ago

Ok, its working.

But stopping it is a bit of a problem socks stop <port> does the trick, but jobkill or deleting the socks port in Mythic do nothing

MEhrn00 commented 2 years ago

Hi,

This is really great thanks for all of your work on it! I did some testing and everything works; however, the socks tasking status does not get relayed back up to Mythic. This will leave socks commands left in a processing state.

socks tasking

DarkC0ntributor commented 2 years ago

Hi, I hope the jobs are all good now?