-
Notifications
You must be signed in to change notification settings - Fork 453
Add Tracee eBPF threat detection for Linux Dynamic Analysis #2235
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
Conversation
Thank you ❤️ |
hello, thank you for such a great contribution, i will merge it , but some parts will be moved to community repo to clarify that is not done by core devs |
log |
Tracee Pull Request
This pull request integrates Aqua Security Tracee, an eBPF-based threat detection engine with built-in signatures, into CAPEv2 for Linux dynamic analysis to complement the existing
strace
implementation. The log streaming implementation is similar to @winson0123'sstrace
streaming to prevent ransomware's encryption of the logs.Please comment if you see any issues.
Screenshots and demo
Screenshot of the Tracee Behaviour UI

Demonstration of a captured kernel module (which was encrypted and stored only in memory)

Rationale
In no order of importance:
kallsyms_lookup_name
- it could be used in some rootkits, likely until recently... (it's an interesting story)LD_PRELOAD
andLD_LIBRARY_PATH
environment variables, or similar methods which can potentially be leveraged for code injectionprocess_vm_writev
syscallstrace
by malware.Trying it out
To get started, use the branch theoleecj2/CAPEv2 -> tracee.
Run
docker pull docker.io/aquasec/tracee:0.20.0
in a Ubuntu VM which already has the CAPE agent running. For best results, use Ubuntu 20.04.Then
docker image tag aquasec/tracee:0.20.0 aquasec/tracee:latest
to record v0.20.0 as the latest.Add
tracee_linux = yes
to the auxiliary.conf's[auxiliary_modules]
section andinto processing.conf.
You can obtain a live malware sample for Linux to load into CAPEv2 from https://bazaar.abuse.ch/sample/bd0141e88a0d56b508bc52db4dab68a49b6027a486e4d9514ec0db006fe71eed/. Please be careful with this file as it's an actual malware. We do not take responsibility for anything that goes wrong.
For further demonstration, you can try https://github.com/citronneur/pamspy which loads an eBPF program to steal credentials. The eBPF should be captured by Tracee in 'Dropped Files'.
Limitations
Tracee sometimes does not de-reference pointers while
strace
can capture the contents. The Tracee implementation here is not 100% reliable, and we are working on improving it (for instance, we have added a health check).Common Issues
You need to have the
strace
auxiliary module enabled. Processing forstrace
need not be enabled, but you can enable it to observe the Tracee module's weaknesses and strengths compared to it.The event capturing is not 100% reliable. If a task's Tracee output looks incorrect, please try again.
Check that you have
/opt/CAPEv2/data/linux/linux-syscalls.json
. If not, you can obtain it from https://raw.githubusercontent.com/mebeim/linux-syscalls/master/db/x86/64/x64/v6.5/table.json.