Comments (2)
Yes. There are five primary ways to enumerate DLLs that have been loaded into the process:
- CreateToolHelp32Snapshot with Module32First/Next
- EnumProcessModules(Ex)
- Walk the LDR structures manually via the PEB (making sure to get the WOW64 PEB too for 32-bit processes on 64-bit systems)
- Scan all memory pages with GetModuleHandle (32-bit only, 64-bit would be too slow)
- Scan all memory pages with VirtualQuery to find executable allocations, then check the start of each allocation for 'MZ' (again 32-bit only for speed reasons).
I'm not sure yet how I can speed up the latter two to make them usable for x64 processes. I'm looking into a few potential ways to enumerate all allocated memory (not just the heaps) in the process but none of it is well documented and I'm mostly having to guess.
Once modules have been identified we can simply look to see if any of them have paths outside the system directory. Validating that they are signed is another potential step but I'd like to avoid it because signing checks are slow and can trigger an outbound network connection for OCSP/CRLs.
Another potential check is to do a compare across these methods to potentially find DLLs that have been loaded into memory but don't appear in the LDR. Furthermore we could try to look for orphaned LDR entries to find modules that have been hidden.
from al-khaser.
Work on this has begun in the dll-injection-detection branch.
from al-khaser.
Related Issues (20)
- Anti-VM: Hyper-V / Windows Sandbox MAC HOT 2
- [anti-debug]NtSetInformationThread_ThreadHideFromDebugger uses a wrong parameter when calling NtQueryInformationThread. HOT 1
- Using PoolTags to Fingerprint Hosts HOT 3
- Hyper-V RAW network protocol detection
- Anti-Debug: LocalSize(0)
- [Improvement] ScanForModules does not support managed modules HOT 11
- Module scanner assumes memory region must be executable HOT 1
- Is dyncheck.com signature exists? HOT 4
- Ability to run a specific subset of checks HOT 1
- Enhancement support request
- can embed in golang? HOT 1
- False positives
- Debugger Detection BUG HOT 2
- Mouse movement HOT 3
- put into malware HOT 5
- Anti-VM Fix Issue
- ldt_trick invalid detection method same results on 2 VM and 2 bare-metal (win+linux) HOT 1
- Anti-debugging attacks
- Bug in commit 0c22e74 HOT 1
- Question about the RDTSC detection with locky trick HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from al-khaser.