Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/darvincisec/AntiDebugandMemoryDump
Anti-Debug and Anti-Memory Dump for Android
https://github.com/darvincisec/AntiDebugandMemoryDump
Last synced: 22 days ago
JSON representation
Anti-Debug and Anti-Memory Dump for Android
- Host: GitHub
- URL: https://github.com/darvincisec/AntiDebugandMemoryDump
- Owner: darvincisec
- Created: 2021-02-21T10:59:50.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-21T21:42:53.000Z (almost 4 years ago)
- Last Synced: 2024-08-05T17:25:19.079Z (4 months ago)
- Language: C
- Homepage:
- Size: 1.36 MB
- Stars: 245
- Watchers: 9
- Forks: 72
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-hacking-lists - darvincisec/AntiDebugandMemoryDump - Anti-Debug and Anti-Memory Dump for Android (C)
README
# AntiDebugandMemoryDump
Anti-Debug and Anti-Memory Dump for AndroidSome known techniques for anti-debug and anti-memory dump have been used in this project. The focus is to use these techniques in a stealthy way without relying on Java APIs.
Following are the techniques used
## Anti-Debug for Java
Presence of JDWP in /proc/self/task/comm and in each of task /proc/self/task//comm is an indication that app is debuggable.## Anti-Debug for Native
Check for TracerPid != 0 in /proc/self/status and in each of task /proc/self/task//status## Anti-Memorydump
Anti-Memory dump is useful to protect the app from memory dumping via frida or [Gameguardian](https://gameguardian.net/forum/gallery/image/248-how-to-dump-memory-of-any-running-processes-in-android-gameguardian/) or any other means.
inotify watch of the following files
1. /proc/self/maps
2. /proc/self/mem
3. /proc/self/pagemap
4. /proc/self/task//mem
5. /proc/self/task//pagemap
Any attempts to access or open these files is an indication of access to the memory. If you use the techniques in [DetectFrida](https://github.com/darvincisec/DetectFrida), inotify will be triggered. There is no way to filter if the access is by the same process or a different process. fanotify addresses the problem wherein it provides the pid of the process accessing the file. But [seccomp](https://android-developers.googleblog.com/2017/07/seccomp-filter-in-android-o.html) filter in Android O filters restricts the usage by normal apps.## Bonus
Just listening on file opening of /proc/self/maps makes it a candidate for Anti-Frida. Just that it is mutually exclusive with other anti-frida techniques relying on the /proc/self/maps.