Class: Ronin::Listener::CLI::Commands::Dns Private
- Inherits:
-
Ronin::Listener::CLI::Command
- Object
- Core::CLI::Command
- Ronin::Listener::CLI::Command
- Ronin::Listener::CLI::Commands::Dns
- Includes:
- Core::CLI::Logging
- Defined in:
- lib/ronin/listener/cli/commands/dns.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Starts a DNS server for receiving exfiltrated data.
Usage
ronin-listener dns [options] DOMAIN
Options
-o, --output FILE The output file to write DNS queries to
-F, --output-format txt|csv|json|ndjson
The output format
-H, --host IP The interface to listen on (Default: 0.0.0.0)
-p, --port PORT The port to listen on (Default: 53)
-h, --help Print help information
Arguments
DOMAIN The domain to receive queries for
Examples
ronin-listener dns -H 127.0.0.1 -p 5553 example.com
Instance Method Summary collapse
-
#run(domain) ⇒ Object
private
Runs the
ronin-listener dns
command. -
#server_kwargs ⇒ Hash{Symbol => Object}
private
Maps options to keyword arguments for
Ronin::Listener::DNS.listen
.
Instance Method Details
#run(domain) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Runs the ronin-listener dns
command.
110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/ronin/listener/cli/commands/dns.rb', line 110 def run(domain) output_file = if [:output] [:output_format].open([:output]) end log_info "Listening on #{[:host]}:#{[:port]} ..." Ronin::Listener::DNS.listen(domain,**server_kwargs) do |query| log_info "Received DNS query: #{query.type} #{query.label} from #{query.source}" output_file << query if output_file end end |
#server_kwargs ⇒ Hash{Symbol => Object}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Maps options to keyword arguments for Ronin::Listener::DNS.listen
.
128 129 130 131 132 133 |
# File 'lib/ronin/listener/cli/commands/dns.rb', line 128 def server_kwargs { host: [:host], port: [:port] } end |