-
-
Notifications
You must be signed in to change notification settings - Fork 105
Added bofnet_executeassembly for calling entry point on standard .NET assemblies #1
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
base: main
Are you sure you want to change the base?
Conversation
… assemblies and capturing output
… assemblies and capturing output
Is this going to be merged soon ? |
Sorry, I cannot merge this as it conflicts with an internal version we have of the same BOF but implemented differently. |
Thanks for this awesome PR, I have noticed that depending on how args are passed something under the hood fails to properly parse the args and pass them to the .NET assembly being invoked which causes the program to crash. For example, with Seatbelt: |
@williamknows Have you had a chance to look? I am going to attempt to modify the aggressor script some time to fix this issue but wasn't sure if you already have. |
…All credit MDSec (Peter Winter-Smith)
Hey, sorry for the slow reply, only realised today when I saw this thread pop up on Slack. To test this, I wrote a quick assembly that just prints the arguments. As shown below, they make it through fine: I suspect there's a few different issues here. For SeatBelt, given the arguments above work, I think it's just that that particular command takes: (1) a long time to execute when doing the full enumeration (often > 5 minutes); (2) it generates a huge amount of data to send back, which takes a while to filter back (e.g., check the memory usage which rapidly rises to > 100MB). The fact that For Rubeus and SharpMapExec I'm honestly not so sure. Do you have any example commands? I know they both have some Environment.Exit() calls which may be the root of the issue. For this I've just pushed functionality for a Note that this now compiles BOF.NET with the |
…xecute_assembly; (3) tidied code for Exit() patch
Just pushed a It's limited to one assembly at a time due to the way it's capturing standard output. Capturing on a per assembly basis is possible, but the code requires a lot more thought. You can still run standard @CCob I've left this open in case anyone finds it useful until your implementation hits the public code, but if you want to close it, certainly no drama from me. Thanks again for the awesome project. |
Great stuff. I will leave it open for others to take advantage of the PR. |
Add internal needle to determine buffer length to truncate null bytes.
Create FUNDING.yml
Adds
bofnet_executeassembly
function to execute standard .NET assemblies in-process through BOF.NET. Arguments can be optionally supplied.Console output is captured in a memory stream then returned through
BeaconConsole.WriteLine()
.Thanks for the tip on Twitter for getting this working!
Example Command Sequence
Example with Seatbelt