TheWover / donut

Generates x86, x64, or AMD64+x86 position-independent shellcode that loads .NET Assemblies, PE files, and other Windows payloads from memory and runs them with parameters
BSD 3-Clause "New" or "Revised" License
3.38k stars 610 forks source link

Not working with CobaltStrike payloads #127

Closed PocketDC closed 1 year ago

PocketDC commented 1 year ago

Hello! Entirely possible I'm missing something here but just wanted to say that I can't seem to get it to work with cobaltstrike at the moment. Using the up-to-date master.

Steps:

  1. Stand up cobaltstrike server
  2. Generate following stageless x64 payloads: raw (.bin), windows executable (.exe), windows executable (.bin), windows dll (.dll)
  3. clone and build donut (tried on both Kali and Win10)
  4. ./donut -i path/to/payload
  5. take loader.bin output, use the inject.exe example, no callback or errors
  6. take the loader.bin output, use the inject-local.exe example, no callback or errors

The hiccup must be with the loader generation in donut because I'm able to execute the unobfuscated payloads just fine (.exe and .dll) and able to use the inject.exe to execute the unobfuscated .bin files too

TheWover commented 1 year ago

I do not have access to Cobalt Strike to test this out, but can provide some guidance.

1) Donut will not be able to load the raw payload (.bin). It can load the PEs. 2) The issue may be with your donut parameters. I would suggest the following to test:

PocketDC commented 1 year ago

Oh man that absolutely fixed it thank you! It must have been the -x 3 that did it because I looked through my history and I had tried all of the others but was using -x 2. You're a legend; thank you sir