Closed RicoVZ closed 6 years ago
Thanks for doing this. One thing I noticed as a typo on my side is too few Fs in the memory address on the injection sigs (write memory) where 0xfffffff should be 0xffffffff. I think though maybe the the following to more precisely cover 32 bit and 64 bit addresses as not sure startswith would be good enough now I think about if as you could have memory addresses like 0xffffffff00000001 which would be missed so maybe:
and not call["arguments"]["process_handle"] == "0xffffffff" and not call["arguments"]["process_handle"] == "0xffffffffffffffff":
Thanks for the comment/update! I didn't notice that. :) I've made a new commit in which I changed the address verification according to your comment.
Hi,
Another thing on the WriteMemory injeciton sigs NtWow64WriteVirtualMemory64 might need added to APIs like below. This is not hooked by cuckoo currently but could be in the future to provide this missing coverage so might be worth adding it so sig does not need changed later although currently it will never match.
filter_apinames = [
"NtWow64WriteVirtualMemory64",
"NtWriteVirtualmemory",
"WriteProcessMemory",
]
Hi.
I also have a quick question around the changes you made to the non-child process stuff for memory injection. I have been using it to create other injection sigs and they do work it seems for instance you can see Dridex output now below. I have a few questions:
How accurate should this be in assuring the process being manipulated is truly not a child process as I have seen some cases where it is manipulating a process it created. Now this is fundamentally weird in itself so fine but still want to be sure as I am messing with non-child processes are key to some of my injection detection ideas.
Is something like process["pid"] != injected_pid needed too in the sigs because in one case of this code being used I saw it be for instance "process 382 injected into process 382" kind of thing but maybe I am using this wrong.
Generally it seems OK though and is letting me begin creating and tightening some injection sigs. I am taking the concept of describing anomalies at injection stages rather than complete beginning to end of every injection technique as it is false negative prone. For instance the ones i have done (many submitted) are:
The reason though for highlighting each anomaly is more if it is a new technique, something is missed or the method differs from the current signature anomalies can be reliably highlighted showing code injection. I am finding while not 100% here the sigs are highlighting combinations of code injection methods without necessarily describing the whole code injection beginning to end but it is picking this stuff up.
Dridex:
Dridex Alternative NtQueueApcThread injection (dbf96ab40b728c12951d317642fbd9da)
Vawtrak
Merged, thanks! Checking hashes later.
Thanks for all the signatures Kevin Ross!
This merge contains:
Signatures I still had in master are also included in this PR. In this PR: https://github.com/cuckoosandbox/community/pull/282
All signatures have been tested.
Some of Kevross's PRs include comments/requests about adding new hooks for some calls of the win api.
PR https://github.com/cuckoosandbox/community/pull/329 contains:
PR https://github.com/cuckoosandbox/community/pull/319 contains: