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

adding / updating linux / android rules #907

Merged
merged 5 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
- joakim@intezer.com
- mehunhoff@google.com
scopes:
static: function
dynamic: thread
Expand All @@ -27,5 +28,7 @@ rule:
- api: write
- api: fwrite
- api: putwchar
- api: dprintf
mike-hunhoff marked this conversation as resolved.
Show resolved Hide resolved
- api: fprintf
mike-hunhoff marked this conversation as resolved.
Show resolved Hide resolved
- 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
mike-hunhoff marked this conversation as resolved.
Show resolved Hide resolved
- 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:
- mehunhoff@google.com
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"
- mehunhoff@google.com
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
mike-hunhoff marked this conversation as resolved.
Show resolved Hide resolved
- 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:
- mehunhoff@google.com
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:
- mehunhoff@google.com
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}"
17 changes: 17 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,17 @@
rule:
meta:
name: modify API blacklist or denylist via JNI on Android
namespace: host-interaction/bypass
authors:
- mehunhoff@google.com
scopes:
static: function
dynamic: thread
features:
- and:
- os: android
- string: "com/android/internal/os/ZygoteInit"
- or:
- string: "setApiBlacklistExemptions"
- string: "setApiDenylistExemptions"
- string: "java/lang/String"
mike-hunhoff marked this conversation as resolved.
Show resolved Hide resolved
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:
- mehunhoff@google.com
scopes:
static: basic block
dynamic: call
features:
mike-hunhoff marked this conversation as resolved.
Show resolved Hide resolved
- and:
- api: ftruncate
Loading