-
Notifications
You must be signed in to change notification settings - Fork 391
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
Refactor/fix/update PowerShell and related features #296
Conversation
…nting all failed commands, and properly use single quotes for linux
- large amount of debugging added to powershell - powershell helper refactored to fix obfuscation, running in 32 bit mode, encoding, etc - turn off obfuscation by default for powershell, since defender picks it up easily - turn off amsi-bypass by default, since it was an incredibly old signatured bypass (users can still pass in their own) - check if virus detected in wmiexec - more error checking for powershell - update mssql powershell to match smb - more error checking for mssql queries - better handling of quotes for powershell queries, since we have almost 4 layers of quoting (python, mssql, cmd, powershell)
…documentation; related to #223
Signed-off-by: Marshall Hallenbeck <Marshall.Hallenbeck@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, i will test it as soon as the changes are made and i have the time.
What about winrm powershell? Does that need to be adjusted now as well?
@Marshall-Hallenbeck i think we should also update the winrm powershell logic to match the logic of smb/mssql, thoughts? |
hmm didn't realize it used a different method of execution... I'll have to look into that. |
@NeffIsBack ohh it uses RSRP over WinRM, that's why. I think it should be fine to leave alone since it's a different protocol. I can look into updating the obfuscation/etc later, but that's not a huge priority right now. |
💯 |
Ok sounds good👍🏼will test the next days and than this can be merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the cosmetic issue everything is working as expected! Finally powershell is working again 🚀
Fyi, tests ran perfectly fine
Tested other exec methods because of crashes in #317, so far it looks like this PR fixes the issue(s). I will add the exec methods to the tests though. |
@NeffIsBack fixed the output, this should be good to go |
Signed-off-by: Marshall Hallenbeck <Marshall.Hallenbeck@gmail.com>
@NeffIsBack ah okay I misunderstood. I've changed it back and they're both the same now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There's still more work to be done for the iex cradle & injection functions, but this gets us to a good point where we aren't being blown up by defender by default for simple powershell queries, etc.