pycobalt icon indicating copy to clipboard operation
pycobalt copied to clipboard

Capture Powerscript output for parsing?

Open MichaelQuaMan opened this issue 2 years ago • 0 comments

I want to run a powershell command like get-domaincomputer, capture the output, so I can parse the hosts and add them to Cobalt Strike's using the hosts_update API call.

It seems like it sould be pretty easy, but, so far, I've I haven't found a way to do it.

I thought maybe I could create a callback and pass it in bpowershell, via an alias command call, but the callback is auto registered, but never called because the 'name' is set to 'return' after the alias callback is run.

So, far it seems like only official Cobalt Script functions, expecting a call back will accept a callback. (which makes sense).

I would greatly appreciate any advice you may have on the subject,

Thanks!

MichaelQuaMan avatar Mar 31 '23 01:03 MichaelQuaMan