Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drakshell: bootstrap agent to reduce injector usage #945

Closed
wants to merge 17 commits into from

Conversation

psrok1
Copy link
Member

@psrok1 psrok1 commented Aug 5, 2024

Yeah, I know that adding agent to the agentless sandbox is a funny plot-twist, but Drakvuf Sandbox needs to make series of operations on guest before analysis has even started. My previous idea has faiiled (#933) and it seems we can't reliably hijack a thread in explorer.exe, especially for operations that may take a bit longer like file upload or sync command execution.

That's why I'm coming with another idea - injecting small agent using shellcode mode in injector that:

  • spawns its own thread as soon as the code is executed
  • connects to the COM1 port (which is bound to the Unix socket on the other side)
  • acts like a shell, allowing to upload/download files and execute arbitrary commands on the Windows system
  • disappears when no longer needed by calling VirtualFree on itself and exiting the thread

The things I don't like in this solution is that:

  • we need to enable serial port device. It's not a device that can be hot-plugged so we can't reuse an existing snapshot, we need to reboot it
  • it may be difficult to handle cases when we're out of sync with the agent
  • it doesn't improve the injector itself
  • injector -m shellcode declares that it works only on Win10 x64

@psrok1
Copy link
Member Author

psrok1 commented Aug 30, 2024

Well, that was interesting idea, but injector is stable enough after fixes.

@psrok1 psrok1 closed this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant