Skip to content

Commit

Permalink
adding / updating linux / android rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-hunhoff committed Jun 5, 2024
1 parent 9e0ffdf commit 3729fa3
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 6 deletions.
3 changes: 3 additions & 0 deletions host-interaction/file-system/write/write-file-on-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ rule:
namespace: host-interaction/file-system/write
authors:
- [email protected]
- [email protected]
scopes:
static: function
dynamic: thread
Expand All @@ -27,5 +28,7 @@ rule:
- api: write
- api: fwrite
- api: putwchar
- api: dprintf
- api: fprintf
- optional:
- match: create or open file
4 changes: 4 additions & 0 deletions host-interaction/process/create/create-process-on-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ rule:
- os: android
- or:
- api: execve
- and:
- match: execute syscall
- arch: aarch64
- number: 0xdd
- api: execl
- api: execlp
- api: execle
Expand Down
19 changes: 19 additions & 0 deletions nursery/bypass-hidden-api-restrictions-via-jni-on-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
rule:
meta:
name: bypass hidden API restrictions via JNI on Android
namespace: host-interaction/bypass
authors:
- [email protected]
description: Starting in Android 9 (API level 28), the platform restricts which non-SDK interfaces your app can use
scopes:
static: function
dynamic: thread
references:
- https://stackoverflow.com/questions/55970137/bypass-androids-hidden-api-restrictions
features:
- and:
- os: android
- string: "dalvik/system/VMRuntime"
- string: "getRuntime"
- string: "setHiddenApiExemptions"
- string: "java/lang/String"
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
rule:
meta:
name: execute syscall instruction
name: execute syscall
namespace: anti-analysis
authors:
- "@kulinacs"
- "@mr-tz"
- [email protected]
description: may be used to evade hooks or hinder analysis
scopes:
static: basic block
dynamic: unsupported # requires mnemonic features
references:
- https://github.com/j00ru/windows-syscalls
features:
- and:
- mnemonic: syscall
- or:
- mnemonic: ret
- mnemonic: retn
- or:
- api: syscall
- and:
- mnemonic: syscall
- or:
- mnemonic: ret
- mnemonic: retn
16 changes: 16 additions & 0 deletions nursery/get-current-process-memory-mapping-on-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
rule:
meta:
name: get current process memory mapping on Linux
namespace: host-interation/process
authors:
- [email protected]
scopes:
static: basic block
dynamic: call
features:
- and:
- or:
- os: linux
- os: android
- match: create or open file
- string: "/proc/self/maps"
17 changes: 17 additions & 0 deletions nursery/hook-routines-via-lsplant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
rule:
meta:
name: hook routines via LSPlant
namespace: linking/hooking
authors:
- [email protected]
description: LSPlant is an Android ART hook library, providing Java method hook/unhook and inline deoptimization
scopes:
static: basic block
dynamic: thread
references:
- https://github.com/LSPosed/LSPlant
features:
- and:
- string: "LSPHooker_"
- string: "hooker"
- string: "{target}"
16 changes: 16 additions & 0 deletions nursery/modify-api-blacklist-or-denylist-via-jni-on-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
rule:
meta:
name: modify API blacklist or denylist via JNI on Android
namespace: host-interaction/bypass
authors:
- [email protected]
scopes:
static: function
dynamic: thread
features:
- and:
- os: android
- string: "com/android/internal/os/ZygoteInit"
- string: "setApiBlacklistExemptions"
- string: "setApiDenylistExemptions"
- string: "java/lang/String"
12 changes: 12 additions & 0 deletions nursery/truncate-file-on-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
rule:
meta:
name: truncate file on Linux
namespace: host-interaction/file-system/truncate
authors:
- [email protected]
scopes:
static: basic block
dynamic: call
features:
- and:
- api: ftruncate

0 comments on commit 3729fa3

Please sign in to comment.