Adding upstream version 2.3.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
3e5f1e46ff
commit
27bed00e23
101 changed files with 2349 additions and 847 deletions
21
plugins/asudp/Makefile.am
Normal file
21
plugins/asudp/Makefile.am
Normal file
|
@ -0,0 +1,21 @@
|
|||
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
|
||||
CLEANFILES = *.gcda *.gcno *.gcov *.pcap-dist test1.out
|
||||
|
||||
AM_CFLAGS = -I$(srcdir) \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/isc \
|
||||
$(SECCOMPFLAGS)
|
||||
|
||||
pkglib_LTLIBRARIES = asudp.la
|
||||
asudp_la_SOURCES = asudp.c
|
||||
asudp_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
TESTS = test1.sh
|
||||
EXTRA_DIST = $(TESTS) test1.gold
|
||||
|
||||
if ENABLE_GCOV
|
||||
gcov-local:
|
||||
for src in $(asudp_la_SOURCES); do \
|
||||
gcov -o .libs -l -r -s "$(srcdir)" "$$src"; \
|
||||
done
|
||||
endif
|
1044
plugins/asudp/Makefile.in
Normal file
1044
plugins/asudp/Makefile.in
Normal file
File diff suppressed because it is too large
Load diff
173
plugins/asudp/asudp.c
Normal file
173
plugins/asudp/asudp.c
Normal file
|
@ -0,0 +1,173 @@
|
|||
/*
|
||||
* Copyright (c) 2025 OARC, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/ip6.h>
|
||||
#include <netinet/udp.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "dnscap_common.h"
|
||||
|
||||
enum plugin_type asudp_type()
|
||||
{
|
||||
return plugin_filter;
|
||||
}
|
||||
|
||||
void asudp_usage()
|
||||
{
|
||||
fprintf(stderr,
|
||||
"\nasudp.so options:\n"
|
||||
"\t-T skip packets that would be truncated\n"
|
||||
"\t-? print these instructions and exit\n");
|
||||
}
|
||||
|
||||
static int skip_truncated = 0;
|
||||
|
||||
void asudp_getopt(int* argc, char** argv[])
|
||||
{
|
||||
int c;
|
||||
while ((c = getopt(*argc, *argv, "T?")) != EOF) {
|
||||
switch (c) {
|
||||
case 'T':
|
||||
skip_truncated = 1;
|
||||
break;
|
||||
case '?':
|
||||
asudp_usage();
|
||||
if (!optopt || optopt == '?') {
|
||||
exit(0);
|
||||
}
|
||||
// fallthrough
|
||||
default:
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static set_output_pkt_t asudp_set_output_pkt = 0;
|
||||
|
||||
void asudp_extension(int ext, void* arg)
|
||||
{
|
||||
switch (ext) {
|
||||
case DNSCAP_EXT_SET_OUTPUT_PKT:
|
||||
asudp_set_output_pkt = (set_output_pkt_t)arg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
struct _pkt {
|
||||
union {
|
||||
struct ip iphdr;
|
||||
struct ip6_hdr ip6_hdr;
|
||||
};
|
||||
struct udphdr updhdr;
|
||||
uint8_t payload[0xffff];
|
||||
};
|
||||
static uint8_t _pkt[sizeof(struct _pkt)];
|
||||
|
||||
int asudp_filter(const char* descr, iaddr* from, iaddr* to, uint8_t proto, unsigned flags,
|
||||
unsigned sport, unsigned dport, my_bpftimeval ts,
|
||||
u_char* pkt_copy, const unsigned olen,
|
||||
u_char* payload, const unsigned payloadlen)
|
||||
{
|
||||
if (!asudp_set_output_pkt)
|
||||
return 0;
|
||||
if (!(flags & DNSCAP_OUTPUT_ISDNS) || !payloadlen) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
size_t plen = payloadlen;
|
||||
uint8_t* pkt = _pkt;
|
||||
|
||||
switch (from->af) {
|
||||
case AF_INET: {
|
||||
if (plen > sizeof(((struct _pkt*)0)->payload) - sizeof(struct ip) - sizeof(struct udphdr)) {
|
||||
if (skip_truncated)
|
||||
return 1;
|
||||
plen = sizeof(((struct _pkt*)0)->payload) - sizeof(struct ip) - sizeof(struct udphdr);
|
||||
}
|
||||
|
||||
struct ip ip = {};
|
||||
ip.ip_hl = 5;
|
||||
ip.ip_v = 4;
|
||||
ip.ip_len = htons(sizeof(struct ip) + sizeof(struct udphdr) + plen);
|
||||
ip.ip_ttl = 255;
|
||||
ip.ip_p = IPPROTO_UDP;
|
||||
ip.ip_src = from->u.a4;
|
||||
ip.ip_dst = to->u.a4;
|
||||
memcpy(pkt, &ip, sizeof(struct ip));
|
||||
pkt += sizeof(struct ip);
|
||||
break;
|
||||
}
|
||||
case AF_INET6: {
|
||||
if (plen > sizeof(((struct _pkt*)0)->payload) - sizeof(struct ip6_hdr) - sizeof(struct udphdr)) {
|
||||
if (skip_truncated)
|
||||
return 1;
|
||||
plen = sizeof(((struct _pkt*)0)->payload) - sizeof(struct ip6_hdr) - sizeof(struct udphdr);
|
||||
}
|
||||
|
||||
struct ip6_hdr ip6 = {};
|
||||
ip6.ip6_vfc = 0x60;
|
||||
ip6.ip6_plen = htons(sizeof(struct udphdr) + plen);
|
||||
ip6.ip6_nxt = IPPROTO_UDP;
|
||||
ip6.ip6_src = from->u.a6;
|
||||
ip6.ip6_dst = to->u.a6;
|
||||
memcpy(pkt, &ip6, sizeof(struct ip6_hdr));
|
||||
pkt += sizeof(struct ip6_hdr);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct udphdr udp = {};
|
||||
udp.uh_sport = htons(sport);
|
||||
udp.uh_dport = htons(dport);
|
||||
udp.uh_ulen = htons(sizeof(struct udphdr) + plen);
|
||||
memcpy(pkt, &udp, sizeof(struct udphdr));
|
||||
pkt += sizeof(struct udphdr);
|
||||
|
||||
memcpy(pkt, payload, plen);
|
||||
pkt += plen;
|
||||
|
||||
asudp_set_output_pkt(_pkt, pkt - _pkt);
|
||||
|
||||
return 0;
|
||||
}
|
431
plugins/asudp/test1.gold
Normal file
431
plugins/asudp/test1.gold
Normal file
|
@ -0,0 +1,431 @@
|
|||
[56] 2018-01-10 11:22:41.552406 [#0 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,59311,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:41.555912 [#1 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,59311,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,58,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:41.600183 [#2 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,35665,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:41.616460 [#3 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,35665,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:41.659921 [#4 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,5337,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:41.663576 [#5 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,5337,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,58,216.58.211.142 0 0
|
||||
[56] 2018-01-10 11:22:41.706183 [#6 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,22982,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:41.709680 [#7 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,22982,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,58,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:41.754101 [#8 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,18718,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:41.757876 [#9 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,18718,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:41.804255 [#10 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,22531,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:41.809483 [#11 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,22531,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,58,216.58.211.142 0 0
|
||||
[56] 2018-01-10 11:22:41.854113 [#12 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,58510,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:41.857788 [#13 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,58510,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,58,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:41.902165 [#14 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,45248,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:41.905802 [#15 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,45248,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:41.950164 [#16 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,49483,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:41.954138 [#17 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,49483,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[56] 2018-01-10 11:22:41.999121 [#18 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,31669,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:42.002657 [#19 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,31669,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:42.047148 [#20 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,25433,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:42.052425 [#21 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,25433,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:42.097899 [#22 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,63798,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:42.101443 [#23 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,63798,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:42.145005 [#24 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,8470,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:42.148639 [#25 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,8470,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:42.192777 [#26 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,60258,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:42.196256 [#27 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,60258,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:42.240395 [#28 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,44985,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:42.245103 [#29 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,44985,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:42.290257 [#30 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,45512,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:42.293978 [#31 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,45512,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:42.337985 [#32 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,22980,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:42.341559 [#33 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,22980,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:42.385009 [#34 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,1834,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:42.389082 [#35 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,1834,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:42.433458 [#36 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,25431,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:42.438748 [#37 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,25431,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:42.484005 [#38 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,48432,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:42.487697 [#39 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,48432,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:42.532414 [#40 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,47411,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:42.537574 [#41 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,47411,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:42.583021 [#42 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,12038,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:42.586898 [#43 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,12038,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[56] 2018-01-10 11:22:42.630221 [#44 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,11614,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:42.633808 [#45 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,11614,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[56] 2018-01-10 11:22:42.679168 [#46 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,59173,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:42.682888 [#47 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,59173,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[56] 2018-01-10 11:22:42.727254 [#48 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,45535,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:42.732703 [#49 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,45535,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:42.777184 [#50 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,60808,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:42.781053 [#51 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,60808,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:42.824222 [#52 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,64325,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:42.828050 [#53 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,64325,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:42.872186 [#54 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,25543,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:42.875911 [#55 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,25543,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:42.920231 [#56 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,20736,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:42.923917 [#57 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,20736,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,57,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:42.968961 [#58 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,25911,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:42.972662 [#59 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,25911,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:43.017364 [#60 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,64358,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:43.022591 [#61 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,64358,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,56,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:43.066765 [#62 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,37698,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:43.070349 [#63 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,37698,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:43.114332 [#64 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,54706,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:43.119538 [#65 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,54706,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,56,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:43.163857 [#66 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,32142,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:43.167576 [#67 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,32142,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:43.211417 [#68 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,41808,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:43.216686 [#69 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,41808,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,56,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:43.260995 [#70 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,18886,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:43.265047 [#71 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,18886,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:43.310017 [#72 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,10624,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:43.313596 [#73 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,10624,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,56,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:43.356802 [#74 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,33139,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:43.360685 [#75 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,33139,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:43.406308 [#76 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,61415,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:43.410191 [#77 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,61415,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,56,216.58.211.142 0 0
|
||||
[73] 2018-01-10 11:22:43.454193 [#78 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,59258,rd \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
|
||||
[171] 2018-01-10 11:22:43.458191 [#79 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,59258,qr|rd|ra \
|
||||
1 206.218.58.216.in-addr.arpa.,IN,PTR \
|
||||
4 206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
|
||||
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. 0 0
|
||||
[56] 2018-01-10 11:22:43.503242 [#80 - 4095] \
|
||||
[172.17.0.8].51388 [8.8.8.8].53 \
|
||||
dns QUERY,NOERROR,17700,rd \
|
||||
1 google.com.,IN,A 0 0 0
|
||||
[72] 2018-01-10 11:22:43.506884 [#81 - 4095] \
|
||||
[8.8.8.8].53 [172.17.0.8].51388 \
|
||||
dns QUERY,NOERROR,17700,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,56,216.58.211.142 0 0
|
||||
[87] 2018-11-27 15:52:00.414188 [#0 - 4095] \
|
||||
[2a01:3f0:0:57::245].51972 [2001:4860:4860::8888].53 \
|
||||
dns QUERY,NOERROR,51420,rd|ad \
|
||||
1 google.com.,IN,A 0 0 \
|
||||
1 .,4096,4096,0,edns0[len=0,UDP=4096,ver=0,rcode=0,DO=0,z=0]
|
||||
[103] 2018-11-27 15:52:00.428453 [#1 - 4095] \
|
||||
[2001:4860:4860::8888].53 [2a01:3f0:0:57::245].51972 \
|
||||
dns QUERY,NOERROR,51420,qr|rd|ra \
|
||||
1 google.com.,IN,A \
|
||||
1 google.com.,IN,A,299,172.217.20.46 0 \
|
||||
1 .,512,512,0,edns0[len=0,UDP=512,ver=0,rcode=0,DO=0,z=0]
|
25
plugins/asudp/test1.sh
Executable file
25
plugins/asudp/test1.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/sh -xe
|
||||
|
||||
plugin=`find . -name 'asudp.so' | head -n 1`
|
||||
if [ -z "$plugin" ]; then
|
||||
echo "Unable to find the asudp plugin"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ln -fs "$srcdir/../../src/test/dns.pcap" dns.pcap-dist
|
||||
|
||||
../../src/dnscap -r dns.pcap-dist -g -P "$plugin" -?
|
||||
#../../src/dnscap -r dns.pcap-dist -g -P "$plugin"
|
||||
! ../../src/dnscap -r dns.pcap-dist -g -P "$plugin" -X
|
||||
|
||||
ln -fs "$srcdir/../../src/test/dnso1tcp.pcap" dnso1tcp.pcap-dist
|
||||
ln -fs "$srcdir/../../src/test/dns6.pcap" dns6.pcap-dist
|
||||
|
||||
../../src/dnscap -T -r dnso1tcp.pcap-dist -w - -P "$plugin" | ../../src/dnscap -r - -g 2>test1.out
|
||||
../../src/dnscap -T -r dns6.pcap-dist -w - -P "$plugin" | ../../src/dnscap -r - -g 2>>test1.out
|
||||
|
||||
mv test1.out test1.out.old
|
||||
grep -v "^libgcov profiling error:" test1.out.old > test1.out
|
||||
rm test1.out.old
|
||||
|
||||
diff test1.out "$srcdir/test1.gold"
|
Loading…
Add table
Add a link
Reference in a new issue