Coder Social home page Coder Social logo

ropwarejb / dnsflare Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 34 KB

A simple DNS service that relays queries to a webhook for notifications to assist detection of OOB or pseudo-blind vulnerabilities during penetration testing activities.

License: MIT License

Makefile 6.02% Haskell 73.98% Dockerfile 4.39% HCL 9.00% Shell 6.61%
dns dns-server pentesting pentesting-tools bug-bounty bugbounty hacking hacking-tools

dnsflare's Introduction

DNSFlare

A simple DNS service that relays queries to a webhook for notifications to assist detection of OOB or pseudo-blind vulnerabilities during penetration testing activities.

Note

To reduce notification noise, as DNS clients will often query for both IPv4 and IPv6, queries will be cached and only unique queries will receive the webhook notification. The limit defaults to 10. So you must send 10 additional unique requests before a given request for a particular domain will produce another webhook. See the Help section to configure this setting.

Usage

Create a file config which contains a single line representing a HTTPS endpoint to POST received queries to.

> cat config
https://hooks.slack.com/services/xxxxxxxxxxx/xxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx
> sudo ./dnsflare --monitor-domain=example.com

Run the service on at least two internet-routable hosts. Then, configure your DNS records to point to your two new nameservers.

> dig @1.1.1.1 ns e.example.com

...
;; AUTHORITY SECTION:
example.com.		21600	IN	NS	ns1.example.com.
example.com.		21600	IN	NS	ns2.example.com.
...

Docker

Build the docker container with the make command, then you can run the docker container forwarding your host UDP and TCP port 53 to the container. Share a webhook config file with a mount:

> make docker
> sudo docker run -p 53:53/tcp -p 53:53/udp -v $(pwd)/config:/app/config dnsflare

There is also a Dockerhub image available at cortisol/dnsflare.

> sudo docker run -p 53:53/tcp -p 53:53/udp -v $(pwd)/config:/app/config cortisol/dnsflare

Compiling

Requires Haskell Stack.

make bin

Binary will be in ./bin/dnsflare.

Webhook Notification

The webhook notification will take each domain from the DNS query and produce a JSON blob as follows to be POSTed to the webhook:

{ "text" : "`<domain>`",
  "username" :  "DNS Flare"
}

Help

> ./dnsflare --help

v0.1.0, 2021 ROPWARE, Joshua Brown

dnsflare [OPTIONS]
  DNS Flare

Common flags:
  -c --cache-length=INT   
  -m --monitor-domain=ITEM
  -? --help                 Display help message
  -V --version              Print version information

By default, the cache length is 10. You can change it with the -c CLI arg.

Deploying with Terraform

Add your webhook URL to a config file in the root directory of the repo:

> ls
bin  config  deploy.sh  docker  LICENSE  makefile  README.md  src  terraform

Grab your Vultr API key and export it as an environment variable, then run the terraform plan and the deployment script:

> export VULTR_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> cd terraform
> terraform apply
> cd ..
> ./deploy.sh

Then set your DNS nameservers to the IPs returned by terraform output:

> terraform output -state=terraform/terraform.tfstate
ns1_ip_addr = "111.111.111.11"
ns2_ip_addr = "22.22.22.222"

dnsflare's People

Contributors

ropwarejb avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

noe233

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.