• Stars
    star
    618
  • Rank 72,605 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A "malicious" DNS server for executing DNS Rebinding attacks on the fly (public instance running on rebind.network:53)

Whonow DNS Server

A malicious DNS server for executing DNS Rebinding attacks on the fly. whonow lets you specify DNS responses and rebind rules dynamically using domain requests themselves.

# respond to DNS queries for this domain with 34.192.228.43 the first time
# it is requested and then 192.168.1.1 every time after that
A.34.192.228.43.1time.192.168.1.1.forever.rebind.network

# respond first with 34.192.228.43, then 192.168.1.1 the next five times,
# and then start all over again (1, then 5, forever...)
A.34.192.228.43.1time.192.168.1.1.5times.repeat.rebind.network

What's great about dynamic DNS Rebinding rules is that you don't have to spin up your own malicious DNS server to start exploiting the browser's Same-origin policy. Instead, everyone can share the same public whonow server running on port 53 of rebind.network.

Note: You should include UUIDs (e.g. a06a5856-1fff-4415-9aa2-823230b05826 ) as a subdomain in each DNS lookup to a whonow server. These have been omitted from examples in this README for brevity, but assume requests to *.rebind.network should be *.a06a5856-1fff-4415-9aa2-823230b05826.rebind.network. See the Gotchas section for more info as to why.

DISCLAIMER: This software is for educational purposes only. This software should not be used for illegal activity. The author is not responsible for its use. Don't be a dick.

Subdomains = Rebind Rules

The beauty of whonow is that you can define the behavior of DNS responses via subdomains in the domain name itself. Using only a few simple keywords: A, (n)times, forever, and repeat, you can define complex and powerful DNS behavior.

Anatomy of a whonow request

A.<ip-address>.<rule>[.<ip-address>.<rule>[.<ip-address>.<rule>]][.uuid/random-string].example.com
  • A: The type of DNS request. Currently only A records are supported, but AAAA should be coming soon.
  • <ip-address>: an ipv4 (ipv6 coming soon) address with each octet seprated by a period (e.g. 192.168.1.1.
  • <rule>: One of three rules
    • (n)time[s]: The number of times the DNS server should reply with the previous IP address. Accepts both plural and singular strings (e.g. 1time, 3times, 5000times)
    • forever: Respond with the previous IP address forever.
    • repeat: Repeat the entire set of rules starting from the beginning.
  • [uuid/random-string]: A random string to keep DNS Rebind attacks against the same IP addresses separate from each other. See Gotchas for more info.
  • example.com: A domain name you have pointing to a whonow nameserver, like the publicly available rebind.network:53 whonow instance.

Rules can be chained together to form complex response behavior.

Examples

# always respond with 192.168.1.1. This isn't really DNS rebinding
# but it still works
A.192.168.1.1.forever.rebind.network

# alternate between localhost and 10.0.0.1 forever
A.127.0.0.1.1time.10.0.0.1.1time.repeat.rebind.network

# first respond with 192.168.1.1 then 192.168.1.2. Now respond 192.168.1.3 forever.
A.192.168.1.1.1time.192.168.1.2.2times.192.168.1.3.forever.rebind.network

# respond with 34.192.228.43 the first time, then whatever `whonow --default-address`
# is set to forever after that (default: 127.0.0.1)
A.34.192.228.43.1time.rebind.network

Limitations

Each label [subdomain] may contain zero to 63 characters... The full domain name may not exceed the length of 253 characters in its textual representation. (from the DNS Wikipedia page)

Additionally, there may not be more than 127 labels/subdomains.

Gotchas

Use Unique Domain Names

Each unique domain name request to whonow creates a small state-saving program in the server's RAM. The next time that domain name is requested the program counter increments and the state may be mutated. All unique domain names are their own unique program instances. To avoid clashing with other users or having your domain name program's state inadvertently incremented you should add a UUID subdomain after your rule definitions. That UUID should never be reused.

# this
A.127.0.0.1.1time.10.0.0.1.1time.repeat.8f058b82-4c39-4dfe-91f7-9b07bcd7fbd4.rebind.network

# not this
A.127.0.0.1.1time.10.0.0.1.1time.repeat.rebind.network

--max-ram-domains

The program state associated with each unique domain name is stored by whonow in RAM. To avoid running out of RAM an upper-bound is placed on the number of unique domains who's program state can be managed at the same time. By default, this value is set to 10,000,000, but can be configured with the --max-ram-domains. Once this limit is reached, domain names and their saved program state will be removed in the order they were added (FIFO).

Running your own whonow server

To run your own whonow server in the cloud use your domain name provider's admin panel to configure a custom nameserver pointing to your VPS. Then install whonow on that VPS and make sure it's running on port 53 (the default DNS port) and that port 53 is accessible to the Internet.

# install
npm install --cli -g whonow@latest

# run it!
whonow --port 53

# you can also run it with more logging to stdout and save DNS activity to CSV
whonow --port 53 --logfile log.csv --verbose

whonow screenshot

If that is too much trouble, feel free to just use the public whonow server running on port 53 of rebind.network.🌐.

Usage

$ whonow --help
usage: whonow [-h] [-v] [-p PORT] [-d DEFAULT_ANSWER] [-b MAX_RAM_DOMAINS]
              [-l LOGFILE] [-m]
              

A malicious DNS server for executing DNS Rebinding attacks on the fly.

Optional arguments:
  -h, --help            Show this help message and exit.
  -v, --version         Show program's version number and exit.
  -p PORT, --port PORT  What port to run the DNS server on (default: 53).
  -d DEFAULT_ANSWER, --default-answer DEFAULT_ANSWER
                        The default IP address to respond with if no rule is 
                        found (default: "127.0.0.1").
  -b MAX_RAM_DOMAINS, --max-ram-domains MAX_RAM_DOMAINS
                        The number of domain name records to store in RAM at 
                        once. Once the number of unique domain names queried 
                        surpasses this number domains will be removed from 
                        memory in the order they were requested. Domains that 
                        have been removed in this way will have their program 
                        state reset the next time they are queried (default: 
                        10000000).
  -l LOGFILE, --logfile LOGFILE
                        Log to CSV file (default: false)
  -m, --verbose         Log request timestamp and sender IP address to stdout 
                        (default: false)

Testing

A whonow server must be running on localhost:15353 to perform the tests in test.js

# in one terminal
whonow -p 15353
# in another terminal
cd path/to/node_modules/whonow
npm test

More Repositories

1

wifi-cracking

Crack WPA/WPA2 Wi-Fi Routers with Airodump-ng and Aircrack-ng/Hashcat
10,642
star
2

PassGAN

A Deep Learning Approach for Password Guessing (https://arxiv.org/abs/1709.00440)
Python
1,749
star
3

naive-hashcat

Crack password hashes without the fuss 🐈
C
1,075
star
4

chattervox

📡 An AX.25 packet radio chat protocol with support for digital signatures and binary compression. Like IRC over radio waves.
TypeScript
748
star
5

dns-rebind-toolkit

A front-end JavaScript toolkit for creating DNS rebinding attacks.
JavaScript
482
star
6

sniff-probes

Plug-and-play bash script for sniffing 802.11 probes requests 👃
Shell
231
star
7

apibuilder

Easy API builder mini library for PHP
PHP
202
star
8

host-validation

Express.js middleware for "Host" and "Referer" header validation to protect against DNS rebinding attacks.
JavaScript
190
star
9

distributed-password-cracking

Borrow CPU cycles from visitor's web browsers to crack MD5 password hashes 😲
JavaScript
181
star
10

midi-rnn

Generate monophonic melodies with machine learning using a basic LSTM RNN
Python
155
star
11

ProbeKit

SSID Probe Request Collection Workshop
JavaScript
133
star
12

keras_weight_animator

Save keras weight matrices as short animated videos during training
Python
105
star
13

ml4music-workshop

Machine Learning for Music and Sound Synthesis workshop
Jupyter Notebook
104
star
14

GloVe-experiments

GloVe word vector embedding experiments (similar to Word2Vec)
Python
60
star
15

radio-thermostat

Radio Thermostat CT50 & CT80 REST API notes
33
star
16

rust-incompatible-transitive-dependencies

An example demonstrating how Rust and cargo support incompatible transitive dependencies (like Node.js + npm not Python + pip)
Rust
29
star
17

letterpress

A nefarious keylogger for Ubuntu. Encrypts keylogs and uploads to pastebin.
Python
26
star
18

the-wandering-dreamer

The Wandering Dreamer: An Synthetic Feedback Loop
JavaScript
22
star
19

pw

Generate strong passwords using /dev/urandom 👻
Shell
15
star
20

markov-passwords

Markov-chain password generator
Python
13
star
21

chirp-files

A collection of notable radio frequencies near Philadelphia PA and beyond
11
star
22

chattervox-examples

A collection of example applications and use cases for the Chattervox protocol
Python
11
star
23

quartzite

Auto-log screenshots and metadata to your personal cloud server when surfing the web
PHP
11
star
24

aprsc-docker

A dockerized aprsc APRS-IS server
Dockerfile
11
star
25

xmrig-k8s

Mine Monero using leftover resources in a Kubernetes cluster
10
star
26

chattervox-keys

A public chattervox key server 🔑
Python
9
star
27

cve

A collection of vulnerabilities found through independent security research.
8
star
28

DreamMachines

Research into using Machine Learning to hallucinate circuit board schematics
KiCad Layout
8
star
29

pokemods

A small collection of Pokémon Red & Blue Gameboy game mods.
Assembly
7
star
30

attacker-personas

🏴‍☠️ Use attacker personas to improve your threat modeling and cybersecurity practices
7
star
31

vanity-keygen

A vanity key generator for the P224, P256, P384, and P521 elliptic curves.
Go
7
star
32

go-runway

A small Go module for interfacing with RunwayML
Go
7
star
33

helm-charts

A small collection of helm charts
HTML
6
star
34

ofTutoring

Course repository for 1-on-1 openFrameworks/C++ tutoring
6
star
35

markov

A small Markov chain generator 📃
Go
5
star
36

distance-sort

Sort geographic locations by their distance from eachother
Python
5
star
37

twilio-cleverbot

Talk to Cleverbot from your phone
JavaScript
4
star
38

BetweenTheTwoOfThese

Custom openFrameworks applications for an 80ft projection installation in Atlanta
C++
4
star
39

spectrum-wrangler-docker

A Dockerized version of Spectrum Wrangler that downloads and geo indexes public FCC license data
Dockerfile
4
star
40

indexd

Archive and connect independent artists websites
PHP
4
star
41

exchatter

A personalized chatbot framework for Node js
JavaScript
4
star
42

application-security-workshop

HTML
4
star
43

LANlockED

PirateBox style LAN tutorial website for EmptyBox
HTML
3
star
44

LEDWallVideoPlayer

Video player application for the Moment LED wall installation at Dolby Labs
C++
3
star
45

pastebin-mirror-docker

A dockerized version of the pastebin-mirror service.
Dockerfile
3
star
46

manifesto

A young art and technologist's manifesto
3
star
47

picamstreaming

Stream directly to Youtube from the Raspberry Pi camera module
Python
2
star
48

thisisatrackingdevice

An interactive map to display data from a public tracking device project
Processing
2
star
49

osm-museums

Open Street Maps data for all museums on earth (36,694 as of June 5th, 2017)
Python
2
star
50

gpssandbox

Sandbox to play with gps/gpx data visualization using google maps api
Processing
2
star
51

kiss-tnc

Talk to a packet radio KISS TNC over a serial port.
JavaScript
2
star
52

runway-glove

A Runway model for experimenting with GloVe vector embeddings
Python
2
star
53

rtl-433-influxdb-importer

Import data from an Acurite 5-in-1 weather station into influxdb
Python
2
star
54

osm-syria-poi

Open Street Maps data for cultural/historic points of interest in Syria
Python
2
star
55

ofxCanvasEvents

Broadcasts mouse, touch, and key events from an HTML5 Canvas to an openFrameworks app
JavaScript
2
star
56

P5AlbersColorTheory

Materials for an introduction to P5.js lecture themed around Josef Albers inspired color theory.
JavaScript
1
star
57

oculusself

Self reflection with the Oculus Rift
C++
1
star
58

projectortracking

A sandbox repo for projects aimed to make any projector touch screen
Processing
1
star
59

OculusWebcamExperiments

Experimental webcam projects for the Oculus Rift. Built with openFrameworks.
C++
1
star
60

nodesandbox

A sandbox repo for node.js + RPi experiments
JavaScript
1
star
61

ChessEmbeddings

GloVe vector embeddings of chess moves
Jupyter Notebook
1
star
62

ofBook_IntroToGraphics

1
star
63

looplamp

Raspberry Pi + Node.js interactive lamp project
JavaScript
1
star
64

ml-sandbox

Machine Learning sandbox
Python
1
star
65

brannondorsey.com

My portfolio website
PHP
1
star
66

website

Personal Website. Using Kirby CMS.
PHP
1
star
67

scarecrow

A Node.js chat bot that learns.
JavaScript
1
star
68

tvtalker-app

TVTalker Display app made with openFrameworks
C++
1
star
69

OpenNIWebSocketDaemon

Stream depth and skeleton tracking data from OpenNI2 + NiTE2 to the browser via WebSockets
JavaScript
1
star
70

UBox

Generalized modular framework to create software like PirateBox or LibraryBox
JavaScript
1
star
71

oFMaskTool

C
1
star
72

webconnections

A node.js powered command-line app for illustrating the degrees of separation between webpages
JavaScript
1
star
73

brbxoxo

PHP
1
star
74

vectorpi

C++
1
star
75

LEDWallInteractive

Interactive scenes for the Moment LED wall installation at Dolby Labs (Authored by Jason Van Cleave and Brannon Dorsey)
C++
1
star
76

exes

A romantic artificial intelligence project
Python
1
star
77

zetamaze

Repo for the Zetamaze threejs project
JavaScript
1
star
78

ProgrammingForArtists

Art && Programming Lecture @ The School of the Art Institute of Chicago, March 2017
JavaScript
1
star