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

Anti Dbg/VM Checks and Malicious API File Behavior Checks #53

Merged
merged 7 commits into from
Jun 30, 2018

Conversation

redsand
Copy link
Contributor

@redsand redsand commented Jun 28, 2018

Adds some anti debug/vm checks along with a few malicious api behavior checks.

@kevoreilly kevoreilly merged commit 18d6808 into ctxis:master Jun 30, 2018
@kevoreilly
Copy link
Contributor

Thanks for these - much appreciated. I'll look at adding the missing hook for NtSetInformationThread when I'm back from travels next week. There are already hooks for NtCreateThreadEx and NtSetContextThread which are in hook_thread.c, but I'll check that they all tie up when I get back.

Also will look at adding the ThemeInitApiHook technique to the Injection package.

The anti-debug signatures are useful but worth pointing out most of these checks don't apply to CAPE's debugger. Exceptions are of course adding a vectored handler and messing with debug registers with NtSetContextThread, but there is some protection against these in the hook code for that function and RtlAddVectoredExceptionHandler (hook_misc.c).

@redsand
Copy link
Contributor Author

redsand commented Jun 30, 2018 via email

@doomedraven
Copy link
Contributor

this is awesome stuff, I have some suggestion, @snemes and I, we started to do hunt of anticuckoos/monitor bugs, he pushed some fixes here, spender-sandbox/cuckoomon-modified#34 would be great to get them into monitor no? + we have much more found, I would like to speak with you @kevoreilly in PM for some related stuff if that possible

@redsand
Copy link
Contributor Author

redsand commented Jul 1, 2018 via email

@kevoreilly
Copy link
Contributor

Thanks @doomedraven and @snemes - I have patched capemon with these fixes, much appreciated.

I submitted the sample mentioned in the pull request to public cape which works fine (https://cape.contextis.com/analysis/11883). I noticed that this sample is detected as CyberGate (via process dump) in the main task, and triggers an Injection task (#11885) which gets the config and the injected payloads. Happy days - this is what cape is all about!

I am very keen to hear about any other fixes you might have, please feel free to email me at [email protected]. I really appreciate any contributions and I have a lot of things on my to-do list so any help would be great. I have been contacted by VirusTotal about the possibility of integrating results from the public instance with them, and am considering submitting to blackhat EU - both really exciting opportunities!

Kev

@doomedraven
Copy link
Contributor

cool :)
sound pretty cool. I will ping you today, and we will can discuss some stuff in private

@redsand
Copy link
Contributor Author

redsand commented Jul 2, 2018 via email

@redsand
Copy link
Contributor Author

redsand commented Jul 2, 2018

I forgot to ask, are there hooks on NtQueryInformationProcess, GetTickCount, SetLastError/GetLastError, MoveFileWithProgressTransactedA/W ? Needed as well

@kevoreilly
Copy link
Contributor

It's funny you ask as I have literally just finished adding a hook for NtQueryInformationProcess as well as NtSetInformationThread and NtQueryInformationThread. I will push these as soon as I have tested them!

There are already hooks for MoveFileWithProgressTransactedW and GetLastError, but not for SetLastError. There is a hook for GetTickCount but it's not logged currently (so not visible to signatures for example) but this can of course be changed.

@kevoreilly
Copy link
Contributor

As far as the BH submission goes I would really appreciate a review - not quite sure yet what to base the presentation around but I'll be putting thought into it over the next few days and will let you know what I come up with.

The VT integration probably would only provide a bit of publicity but that is definitely something I would value at this stage - I still think it's not a project that's too well known about yet. I would love to get more users and contributors and see the project really take off.

@doomedraven
Copy link
Contributor

or more complainers what everything is broken/doesn't work for them is why I removed fork of cuckoo-mod after it died, I was starting to see very stupid issues

@kevoreilly
Copy link
Contributor

Right I've just pushed the new capemon with new hooks for NtSetInformationThread, NtQueryInformationThread, and NtQueryInformationProcess, as well as expanding slightly the existing hook for NtSetInformationProcess.

enzok pushed a commit to enzok/CAPE that referenced this pull request Aug 20, 2019
add ability to remove sample if exist --unique
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.

3 participants