https://github.com/mpdroog/dnsleak
DNS Leak testing
https://github.com/mpdroog/dnsleak
cors dns geoip2 leak letsencrypt spyoff systemd-service
Last synced: 5 months ago
JSON representation
DNS Leak testing
- Host: GitHub
- URL: https://github.com/mpdroog/dnsleak
- Owner: mpdroog
- Created: 2018-03-16T10:27:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-27T08:56:34.000Z (about 8 years ago)
- Last Synced: 2024-12-20T03:03:23.729Z (over 1 year ago)
- Topics: cors, dns, geoip2, leak, letsencrypt, spyoff, systemd-service
- Language: Go
- Size: 22.5 KB
- Stars: 17
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

DNSleak
==================
Small DNS-server that catches requests and offers origins through HTTP(s) API.
What is used?
- LetsEncrypt to offer easy HTTPS-requests
- CORS-headers are added to cross-domain do AJAX-requests
- ISP/Country lookup through Maxmind's GeoIP
How to use?
- Point A-record to this node i.e. ns-dnstest.spyoff.com
- Point NS-record to this node i.e. dnstest.spyoff.com
- POST https://ns-dnstest.spyoff.com/dns/leaktest
IN: `{domain: ["4eb4b123bbd72478a29bff21cd00f48722b704ce.dnstest.spyoff.com"]}`
OUT: `{"15169":{"ISP":"Google LLC","Country":"US","IP":"172.217.40.8"}`
Arguments
```bash
./dnsleak --help
Usage of ./dnsleak:
-d string
DNS listen on (both tcp and udp) (default "[::]:53")
-h string
HTTP listen on (default "[::]:80")
-m string
HTTPS-domain (LetsEncrypt) (default "ns-dnstest.spyoff.com")
-s string
HTTPS listen on (default "[::]:443")
-v Verbose-mode (log more)
```
Tool created for [SpyOFF](https://spyoff.com/dns-leak-test/?a_aid=11108&a_bid=02dc3d81)
Install
```bash
# User + systemd
useradd -r dnsleak
mkdir -p /home/dnsleak
vi /etc/systemd/system/dnsleak.service
# Systemd file below...
chmod 644 /etc/systemd/system/dnsleak.service
systemctl daemon-reload
systemctl enable dnsleak
systemctl start dnsleak
# MaxMind GeoIP
vi /etc/cron.d/dnsleak-geo
# @daily dnsleak /home/dnsleak/geoip.sh
mkdir -p /tmp/geoip
chown dnsleak:dnsleak -R /tmp/geoip
```
/etc/systemd/system/dnsleak.service
```
[Unit]
Description=DNS Leak tester by faking a DNS-server
After=network.target
Requires=network.target
[Service]
LimitNOFILE=8192
Type=notify
Restart=always
RestartSec=30
TimeoutStartSec=0
WorkingDirectory=/home/dnsleak
ExecStart=/home/dnsleak/dnsleak
User=dnsleak
Group=dnsleak
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
```