Class: Ronin::Listener::CLI::Commands::New::Dns Private

Inherits:
Ronin::Listener::CLI::Command show all
Includes:
Core::CLI::Generator
Defined in:
lib/ronin/listener/cli/commands/new/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.

Creates a new standalone DNS listener Ruby script.

Usage

ronin-listener new dns PATH

Options

-H, --host IP                    The interface to listen on (Default: 0.0.0.0)
-p, --port PORT                  The port to listen on (Default: 5553)
    --domain DOMAIN              The domain to receive queries for (Default: example.com)
-h, --help                       Print help information

Arguments

PATH                             The script file to create

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ Dns

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.

Initializes the ronin-listener new dns command.

Parameters:

  • kwargs (Hash{Symbol => Object})

    Additional keyword arguments for the command.



99
100
101
102
103
104
105
# File 'lib/ronin/listener/cli/commands/new/dns.rb', line 99

def initialize(**kwargs)
  super(**kwargs)

  @host   = '0.0.0.0'
  @port   = 5553
  @domain = 'example.com'
end

Instance Method Details

#run(path) ⇒ 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 new dns command.

Parameters:

  • path (String)

    The path to the new script file to create.



113
114
115
116
# File 'lib/ronin/listener/cli/commands/new/dns.rb', line 113

def run(path)
  erb 'dns.rb.erb', path
  chmod '+x', path
end