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

add new linux rules to nursery #870

Merged
merged 5 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
15 changes: 15 additions & 0 deletions nursery/get-current-process-command-line.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
rule:
meta:
name: get current process command line
williballenthin marked this conversation as resolved.
Show resolved Hide resolved
namespace: host-interation/process
authors:
- [email protected]
scopes:
static: function
dynamic: thread
features:
- and:
- os: linux
- api: open
- string: "/proc/self/cmdline"
- api: read
14 changes: 14 additions & 0 deletions nursery/get-current-process-file-path.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
rule:
meta:
name: get current process file path
# namespace: host-interation/process
williballenthin marked this conversation as resolved.
Show resolved Hide resolved
authors:
- [email protected]
scopes:
static: basic block
dynamic: call
features:
- and:
- os: linux
- api: readlink
- string: "/proc/self/exe"
22 changes: 22 additions & 0 deletions nursery/hook-routines-via-dlsym-rtld_next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
rule:
meta:
name: hook routines via dlsym RTLD_NEXT
# namespace: linking/hooking
williballenthin marked this conversation as resolved.
Show resolved Hide resolved
authors:
- [email protected]
scopes:
static: basic block
dynamic: call
references:
- https://stackoverflow.com/questions/71695007/hook-library-function-using-custom-method-using-dlsym
- https://liveoverflow.com/hooking-on-linux-with-ld_preload-pwn-adventure-3/
features:
- and:
- api: dlsym
- or:
- and:
- arch: i386
- number: 0xFFFFFFFF = RTLD_NEXT
- and:
- arch: amd64
- number: 0xFFFFFFFFFFFFFFFF = RTLD_NEXT
Loading