All Projects → ehids → ehids

ehids / ehids

Licence: AGPL-3.0 license
A Linux Host-based Intrusion Detection System based on eBPF.

Programming Languages

c
50402 projects - #5 most used programming language
go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to ehids

ebpfmanager
A golang ebpf libary base on cilium/ebpf and datadog/ebpf.
Stars: ✭ 37 (-82.38%)
Mutual labels:  hids, ebpf
aya
Aya is an eBPF library for the Rust programming language, built with a focus on developer experience and operability.
Stars: ✭ 950 (+352.38%)
Mutual labels:  ebpf
lmp
LMP is a supermarket
Stars: ✭ 228 (+8.57%)
Mutual labels:  ebpf
docker-wallarm-node
⚡️ Docker official image for Wallarm Node. API security platform agent.
Stars: ✭ 18 (-91.43%)
Mutual labels:  security-audit
sec-scannode
SEC分布式资产扫描系统
Stars: ✭ 8 (-96.19%)
Mutual labels:  security-audit
Spydan
A web spider for shodan.io without using the Developer API.
Stars: ✭ 30 (-85.71%)
Mutual labels:  security-audit
go-tc
traffic control in pure go - it allows to read and alter queues, filters and classes
Stars: ✭ 245 (+16.67%)
Mutual labels:  ebpf
pixie-demos
Demos for Pixie: github.com/pixie-io/pixie
Stars: ✭ 106 (-49.52%)
Mutual labels:  ebpf
Logmira
Logmira by Blumira has been created by Amanda Berlin as a helpful download of Microsoft Windows Domain Group Policy Object settings.
Stars: ✭ 46 (-78.1%)
Mutual labels:  security-audit
Elkeid
Elkeid is a Cloud-Native Host-Based Intrusion Detection solution project to provide next-generation Threat Detection and Behavior Audition with modern architecture.
Stars: ✭ 1,245 (+492.86%)
Mutual labels:  hids
XDP-Firewall
An XDP firewall that is capable of filtering specific packets based off of filtering rules specified in a config file. IPv6 is supported!
Stars: ✭ 129 (-38.57%)
Mutual labels:  ebpf
phan-taint-check-plugin
Github mirror of "mediawiki/tools/phan/SecurityCheckPlugin" - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing)
Stars: ✭ 21 (-90%)
Mutual labels:  security-audit
defense-matrix
Express security essentials deployment for Linux Servers
Stars: ✭ 61 (-70.95%)
Mutual labels:  hids
uprobe-http-tracer
uprobe-based HTTP tracer for Go binaries
Stars: ✭ 45 (-78.57%)
Mutual labels:  ebpf
packiffer
lightweight cross-platform networking toolkit
Stars: ✭ 52 (-75.24%)
Mutual labels:  ebpf
awesome-rails-security
A curated list of security resources for a Ruby on Rails application
Stars: ✭ 36 (-82.86%)
Mutual labels:  security-audit
vsaudit
VOIP Security Audit Framework
Stars: ✭ 104 (-50.48%)
Mutual labels:  security-audit
MailRipV3
SMTP and IMAP checker / cracker for mailpass combolists with a user-friendly GUI, automated inbox test and many more features.
Stars: ✭ 28 (-86.67%)
Mutual labels:  security-audit
pixie
Instant Kubernetes-Native Application Observability
Stars: ✭ 3,238 (+1441.9%)
Mutual labels:  ebpf
RockYou2021.txt
RockYou2021.txt is a MASSIVE WORDLIST compiled of various other wordlists. RockYou2021.txt DOES NOT CONTAIN USER:PASS logins!
Stars: ✭ 288 (+37.14%)
Mutual labels:  security-audit

eHIDS 介绍

eBPF内核技术实现的HIDS demo.

功能实现:

  1. TCP网络数据捕获
  2. UDP网络数据捕获
  3. uprobe方式的DNS信息捕获
  4. 进程数据捕获
  5. uprobe方式实现JAVA的RASP命令执行场景事件捕获
  6. eBPF的go框架实现,针对kprobe\uprobe挂载方式,多类型event进行抽象实现。
  7. 开发者只需要实现内核态C文件,用户态go文件,用户态event消息结构体三个文件即可,框架会自动加载执行。
  8. 使用者可以按照logger的interface自行实现数据的上报处理,比如上报到ES\kafka等日志中心。

原理

参考ebpf官网的介绍

  1. 内核态用C写eBPF代码,llvm编译为eBPF字节码。
  2. 用户态使用golang编写,cilium/ebpf纯go类库,做eBPF字节码的内核加载,kprobe/uprobe HOOK对应函数。
  3. 用户态使用golang做事件读取、解码、处理。

规划

排期规划

笔者在从源码角度分析cilium、datadog、tracee、falco、kubeArmor等云原生相关eBPF技术实现的运行时安全防护产品,在分析完成后,会继续分享本产品的设计方案、思路、功能等。

当前进展完成

产品功能

  1. 功能完善(网络、进程、文件、事件)
  2. 监控
  3. 告警
  4. 熔断
  5. 统计
  6. 对账
  7. 统一管控

说明

  1. 内核态部分为linux原生类库实现的ebpf编程代码,使用clang(llvm)进行字节码编译。
  2. 用户态部分为golang的cilium/ebpf类库编写,实现加载eBPF字节码到内核,挂载到hook点,事件读取等功能。
  3. 本项目分别用kprobe、uprobe实现了TCP、UDP的网络事件捕获。

开发环境

  • UBUNTU 21.04 server
  • go version go1.17.2 linux/amd64
  • Ubuntu clang version 12.0.0-3ubuntu1~21.04.2
  • openjdk version "1.8.0_292"

环境安装步骤

参见CFC4N的eBPF开发环境

  • sudo apt-get install -y make gcc libssl-dev bc libelf-dev libcap-dev clang gcc-multilib llvm libncurses5-dev git pkg-config libmnl-dev bison flex graphviz
  • sudo apt-get install -y make gcc clang llvm git pkg-config dpkg-dev gcc-multilib
  • cd ~/download/
  • sudo apt update
  • sudo apt-get source linux-image-$(uname -r)
  • sudo apt-get source linux-image-unsigned-$(uname -r)
  • sudo apt install libbfd-dev libcap-dev zlib1g-dev libelf-dev libssl-dev

编译运行

编译

git clone https://github.com/ehids/ehids-agent.git
cd ehids
make
./bin/ehids-agent

运行

再开一个shell,执行网络命令,触发网络行为

wget www.cnxct.com

或者编译运行java的命令执行例子,来测试java RASP的功能。 uprobe挂载了libjava.so的 JDK_execvpe函数,对应偏移地址offset为0x19C30,其他版本请自行定位偏移地址。

cd examples
javac Main.java
java Main

JAVA JDK版本信息如下

~$java -version

openjdk version "1.8.0_292"

OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1-b10)

OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)

结果

root@vmubuntu:/home/cfc4n/project/ehids# ./bin/ehids
2021/12/01 19:27:08 start to run EBPFProbeUJavaRASP probe
2021/12/01 19:27:08 start to run EBPFProbeKTCP probe
2021/12/01 19:27:08 start to run EBPFProbeKTCPSec probe
2021/12/01 19:27:08 start to run EBPFProbeKUDP probe
2021/12/01 19:27:08 start to run EBPFProbeUDNS probe
2021/12/01 19:27:08 probeName:EBPFProbeKTCPSec, probeTpye:kprobe, start time:07:23:49, PID:864, UID:101, AF:2, TASK:5systemd-resolv
2021/12/01 19:27:08 probeName:EBPFProbeKUDP, probeTpye:kprobe, PID:0, comm:systemd-resolve, qname:57.22.91.101.in-addr.arpa, qclass:1, qtype:12.
2021/12/01 19:27:09 probeName:EBPFProbeKTCP, probeTpye:kprobe, start time:19:31:19, family:AF_INET, PID:409744, command:curl, UID:0, rx:67408, tx:79, dest:118.31.44.218:20480, source:172.16.71.4, type:OUT, result:True
2021/12/01 19:27:10 probeName:EBPFProbeUJavaRASP, probeTpye:uprobe, JAVA RASP exec and fork. PID:409049, command:ifconfig, mode:MODE_VFORK

参考

eBPF的恶意利用与检测机制

基于eBPF的恶意利用与检测机制文章,已经分享在美团安全应急响应中心微信公众号上,eBPF的恶意利用与检测机制

微信群 Wechat Group

说明

非美团官方仓库,仅为工程师个人贡献。

该仓库非美团在用HIDS版本,为精简后demo,若需要查看详细全部源码,请点击:https://www.cnxct.com/jobs/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].