MCPcopy Index your code
hub / github.com/USArmyResearchLab/Dshell / __init__

Method __init__

dshell/plugins/dns/dns.py:29–64  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

27class DshellPlugin(dnsplugin.DNSPlugin):
28
29 def __init__(self, *args, **kwargs):
30 super().__init__(
31 name="DNS",
32 description="Extract and summarize DNS queries/responses",
33 longdescription="""
34The DNS plugin extracts and summarizes DNS queries and their responses. If
35possible, each query is paired with its response(s).
36
37Possible anomalies can be found using the --dns_show_noanswer,
38--dns_only_noanswer, --dns_show_norequest, or --dns_only_norequest flags
39(see --help).
40
41For example, looking for responses that did not come from a request:
42 decode -d dns --dns_only_norequest
43
44Additional information for responses can be seen with --dns_country and
45--dns_asn to show country codes and ASNs, respectively. These results can be
46piped to grep for filtering results.
47
48For example, to look for all traffic from Germany:
49 decode -d dns --dns_country |grep "country: DE"
50
51To look for non-US traffic, try:
52 decode -d dns --dns_country |grep "country:" |grep -v "country: US"
53""",
54 author="bg/twp",
55 bpf="udp and port 53",
56 output=AlertOutput(label=__name__),
57 optiondict={'show_noanswer': {'action': 'store_true', 'help': 'report unanswered queries alongside other queries'},
58 'show_norequest': {'action': 'store_true', 'help': 'report unsolicited responses alongside other responses'},
59 'only_noanswer': {'action': 'store_true', 'help': 'report only unanswered queries'},
60 'only_norequest': {'action': 'store_true', 'help': 'report only unsolicited responses'},
61 'country': {'action': 'store_true', 'help': 'show country code for returned IP addresses'},
62 'asn': {'action': 'store_true', 'help': 'show ASN for returned IP addresses'},
63 }
64 )
65
66 def premodule(self):
67 if self.only_norequest:

Callers

nothing calls this directly

Calls 1

AlertOutputClass · 0.90

Tested by

no test coverage detected