https://github.com/daemon1024/blockport
https://github.com/daemon1024/blockport
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/daemon1024/blockport
- Owner: daemon1024
- Created: 2021-05-09T09:40:23.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-09T12:05:12.000Z (about 4 years ago)
- Last Synced: 2024-05-28T17:31:37.851Z (12 months ago)
- Language: Go
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BlockPort
eBPF program using XDP to drop TCP packets on a specified port
```
Usage: blockport [--device] [--port]
-device string
Network device to attach XDP program to (default "lo")
-port string
Port number to block incoming tcp packets at
```# Testing
Used hping3 to send tcp packets to a particular port using
```sh
sudo hping3 127.0.0.1 -p 7999
```When we set a rule to drop packets using iptables using
```sh
sudo iptables -I INPUT -p tcp --dport 7999 -j DROP
```It reported packet loss.
Similarly when we ran our tool, it reported packet loss in a similar way.
```
sudo ./blockport -port 7999
``````
--- 127.0.0.1 hping statistic ---
14 packets transmitted, 7 packets received, 50% packet loss
round-trip min/avg/max = 0.8/6.5/11.5 ms
```| iptables | blockport |
|---|---|
|  |  |