sshd_backdoor

渗透技巧 2年前 (2023) admin
430 0 0

sshd_backdoor

This Project is based on BlackHat USA 2021 and Defcon 29.

About Using ebpf technique, hijacking the process during sshd service getting the ~/.ssh/authorized_keys to authorize user logging and injecting our public key make our login successful.

Demo

sshd_backdoor

Main Process in ebpf program

  1. Hook OpenAt syscall enter: check if the sshd process call this, log the pid of sshd.

  2. Hook OpenAt Syscall exit: check the pid logged. logging the fd of pid, map pid->fd.

  3. Hook Read Syscall enter: check the pid logged. logging the user_space_char_buffer of pid.

  4. Hook Read Syscall exit: check the pid logged. find the buffer and change the buffer into our Key. Then delete pid in map to avoid blocking administrators’ keys be read.

Usage

make build

By the way

sshd keylogging

make bpftrace_keylogging

which logging all message in sshd process. Of Course the key log.

 

原文始发于Github:sshd_backdoor

版权声明:admin 发表于 2023年1月28日 下午10:58。
转载请注明:sshd_backdoor | CTF导航

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...