summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Schanzenbacher <ryan@rschanz.org>2023-02-16 23:30:52 -0500
committerRyan Schanzenbacher <ryan@rschanz.org>2023-02-16 23:30:52 -0500
commit23061bab189d3cfc7181ce68f4949304d91b3ce6 (patch)
treeb8bd7cc0c1c99a8e6bec5f629978d84dcb977c87
added readme
-rw-r--r--README.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0e6d352
--- /dev/null
+++ b/README.md
@@ -0,0 +1,30 @@
1# Red Team Tool - XDP Packet Dropper
2
3## Ryan Schanzenbacher - Bravo Team
4
5### Getting Started
6
7To run this tool, get a Linux (newer than kernel 4.9) system running. First, we need to mount the bpf kernel directory that will be hooked into later.
8
9```
10mount -t bpf bpf /sys/fs/bpf
11```
12
13This command should return no errors. Next, ensure the package xdp-loader is installed. This package is provided in `xdp-tools`. Finally, load the driver on the interface you want to "attack" (found using `ip a`).
14
15```
16xdp-loader load {interface_name} packet_dropper.o
17```
18
19### Usage
20
21Now that the driver is loaded, it is active. Nothing will appear to have changed on the host system (however if you run `ip a` now you will see a new "xdp" entry after the interface mtu. On a separate system, craft an IP packet with the source address equal to `223.255.254.115` and the destination equal to the computer with the tainted interface. There can be any payload encapsulated within the IP packet, this is discarded. A sample python script utilizing scapy has been provided. When this packet is sent, all IP communication from the tainted interface will be blocked, effectively disabling the computers communication with the outside world. Note: Layer 2 communication (like ARP) will still be allowed to ensure connectivity can be restored. If you send the specially crafted packet again, IP communication will be allowed through again, like a toggle.
22
23### Build information
24
25You need the linux headers, libbpf headers, libxdp headers and clang. Once you have all of these installed, run the following command to build the object file that can be loaded:
26
27```
28clang -O2 -g -Wall -target bpf -c packet_dropper.c -o packet_dropper.o
29```
30