• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

m4/H07-May-2022-9,0768,204

src/H03-May-2022-17,45213,054

CHANGESH A D16-Feb-20186.5 KiB206151

LICENSEH A D17-Jan-20181.5 KiB3528

Makefile.amH A D17-Jan-20181.8 KiB498

Makefile.inH A D16-Feb-201828.5 KiB898765

NOTES.mdH A D28-Sep-2017987 3832

README.mdH A D17-Jan-20185.8 KiB175136

aclocal.m4H A D16-Feb-201843.3 KiB1,2201,110

ar-libH A D16-Feb-20185.7 KiB271210

compileH A D16-Feb-20187.2 KiB348258

config.guessH A D16-Feb-201842.5 KiB1,4421,249

config.subH A D16-Feb-201835.3 KiB1,8141,676

configureH A D16-Feb-2018461.7 KiB15,72213,165

configure.acH A D16-Feb-20182.6 KiB7768

depcompH A D16-Feb-201823 KiB792502

install-shH A D16-Feb-201814.8 KiB509329

ltmain.shH A D16-Feb-2018316.8 KiB11,1577,986

missingH A D16-Feb-20186.7 KiB216143

test-driverH A D16-Feb-20184.5 KiB14987

README.md

1# DNS Replay Tool (drool)
2
3[![Build Status](https://travis-ci.org/DNS-OARC/drool.svg?branch=develop)](https://travis-ci.org/DNS-OARC/drool) [![Coverity Scan Build Status](https://scan.coverity.com/projects/12202/badge.svg)](https://scan.coverity.com/projects/dns-oarc-drool)
4
5`drool` can replay DNS traffic from packet capture (PCAP) files and send
6it to a specified server, with options such as to manipulate the timing
7between packets, as well as loop packets infinitely or for a set number
8of iterations. This tool's goal is to be able to produce a high amount
9of UDP packets per second and TCP sessions per second on common hardware.
10
11The purpose can be to simulate Distributed Denial of Service (DDoS) attacks
12on the DNS and measure normal DNS querying. For example, the tool could
13enable you to take a snapshot of a DDoS and be able to replay it later
14to test if new code or hardening techniques are useful, safe & effective.
15Another example is to be able to replay a packet stream for a
16bug that is sequence- and/or timing-related in order to validate the
17efficacy of subsequent bug fixes.
18
19## Known Issues
20
21- IP fragments are currently not processed and will be discarded.
22- TCP sessions are not reassembled, each packet is parsed as DNS after
23  discarding the first two bytes.
24
25## Usage example
26
27Send all DNS queries twice as fast as found in the PCAP file to localhost
28using UDP:
29
30```shell
31drool -vv \
32  -c 'text:timing multiply 0.5; client_pool target "127.0.0.1" "53"; client_pool sendas udp;' \
33  -r file.pcap
34```
35
36Only look for DNS queries in TCP traffic and send it to localhost:
37
38```shell
39drool -vv \
40  -c 'text:filter "tcp"; client_pool target "127.0.0.1" "53";' \
41  -r file.pcap
42```
43
44Listen for DNS queries on eth0 and send them to an (assuming) internal server:
45
46```shell
47drool -vv \
48  -c 'text:filter "port 53"; client_pool target "172.16.1.2" "53";' \
49  -i eth0
50```
51
52Take all UDP DNS queries found in the PCAP file and send them as fast as
53possible to localhost by ignoring both timings, replies and starting 5
54contexts (threads) that will simultaneously send queries:
55
56```shell
57drool -vv \
58  -c 'text:filter "udp"; timing ignore; context client_pools 5; client_pool target "127.0.0.1" "53"; client_pool skip_reply;' \
59  -r file.pcap
60```
61
62## Timing warnings
63
64The warnings from timing mode `keep` consists of:
65- `process cost`: This is the CPU cost of processing the packet including the cost of measuring the cost
66- `packet diff`: This is the timing differential between the previous packet and the packet being processed as seen from the PCAP, i.e. the time to wait before sending it
67- `now`: Is the time "now" or at least when the processing for this packet begun
68- `sleep to`: Was the time it should have slept to
69
70The values for `now` and `sleep to` are in monotonic or real-time clock
71depending on the available system functionality during compilation.
72
73## Dependencies and build tools
74
75`drool` requires the PCAP library and the event engine EV along with system
76build tools.
77
78To install the dependencies and build tools under Debian 8+/Ubuntu 14.04+:
79```
80apt-get install -y libpcap-dev libev-dev build-essential autoconf automake libtool
81```
82
83To install the dependencies and build tools under CentOS 7+ (with EPEL enabled):
84```
85yum install -y libpcap-devel libev-devel
86yum group install -y "Development Tools"
87```
88
89To install the dependencies, build tools and setup the environment for
90FreeBSD 11+ using `pkg`:
91```
92pkg install -y libpcap libev gmake autoconf automake libtool gcc
93export AUTOCONF_VERSION=2.69 \
94  AUTOMAKE_VERSION=1.15 \
95  CFLAGS="-I/usr/local/include" \
96  LDFLAGS="-L/usr/local/lib"
97```
98
99For OpenBSD 6.0+ it is recommended to install a later version of the PCAP
100library then the system provides, rest of the dependencies can be installed
101using `pkg_add` (based on 6.0, package versions may be different for others):
102```
103pkg_add libev gcc autoconf-2.69p2 automake-1.15p0 gmake-4.2.1 libtool-2.4.2p0
104export AUTOCONF_VERSION=2.69 \
105  AUTOMAKE_VERSION=1.15 \
106  CFLAGS="-I/usr/local/include" \
107  LDFLAGS="-L/usr/local/lib"
108```
109
110## Build from GitHub
111
112```
113git clone https://github.com/DNS-OARC/drool.git
114cd drool
115git submodule update --init
116sh autogen.sh
117./configure
118make
119make test
120make install
121```
122
123## Build from tarball
124
125```
126cd drool-VERSION...
127./configure
128make
129make test
130make install
131```
132
133## Author(s)
134
135Jerry Lundström <jerry@dns-oarc.net>
136
137## Copyright
138
139Copyright (c) 2017-2018, OARC, Inc.
140
141Copyright (c) 2017, Comcast Corporation
142
143All rights reserved.
144
145```
146Redistribution and use in source and binary forms, with or without
147modification, are permitted provided that the following conditions
148are met:
149
1501. Redistributions of source code must retain the above copyright
151   notice, this list of conditions and the following disclaimer.
152
1532. Redistributions in binary form must reproduce the above copyright
154   notice, this list of conditions and the following disclaimer in
155   the documentation and/or other materials provided with the
156   distribution.
157
1583. Neither the name of the copyright holder nor the names of its
159   contributors may be used to endorse or promote products derived
160   from this software without specific prior written permission.
161
162THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
163"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
164LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
165FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
166COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
167INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
168BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
169LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
170CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
171LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
172ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
173POSSIBILITY OF SUCH DAMAGE.
174```
175