Class: Arachni::UI::CLI::RPC::Local

Inherits:
Object
  • Object
show all
Includes:
Utilities, Output
Defined in:
lib/arachni/ui/cli/rpc/local.rb

Overview

Spawns and controls an RPC::Server::Instance directly to avoid having to use a RPC::Server::Dispatcher to take advantage of RPC-only features like multi-Instance scans.

Author:

Instance Method Summary collapse

Methods included from Utilities

#load_profile, #lsmod, #lsplat, #lsplug, #lsrep, #print_banner, #print_issues, #print_profile, #save_profile

Methods included from Mixins::ProgressBar

#eta, #format_time, #progress_bar

Methods included from Mixins::Terminal

#clear_screen, #flush, #move_to_home, #reprint, #reputs, #restr

Methods included from Arachni::Utilities

#available_port, #cookie_encode, #cookies_from_document, #cookies_from_file, #cookies_from_response, #exception_jail, #exclude_path?, #extract_domain, #follow_protocol?, #form_decode, #form_encode, #form_parse_request_body, #forms_from_document, #forms_from_response, #generate_token, #get_path, #html_decode, #html_encode, #include_path?, #links_from_document, #links_from_response, #normalize_url, #page_from_response, #page_from_url, #parse_query, #parse_set_cookie, #parse_url_vars, #path_in_domain?, #path_too_deep?, #port_available?, #rand_port, #redundant_path?, #remove_constants, #seed, #skip_page?, #skip_path?, #skip_resource?, #to_absolute, #uri_decode, #uri_encode, #uri_parse, #uri_parser, #url_sanitize

Methods included from Output

#debug?, #debug_off, #debug_on, #disable_only_positives, #error_logfile, #flush_buffer, #log_error, #mute, #muted?, old_reset_output_options, #only_positives, #only_positives?, #print_bad, #print_debug, #print_debug_backtrace, #print_debug_pp, #print_error, #print_error_backtrace, #print_info, #print_line, #print_ok, #print_status, #print_verbose, #reroute_to_file, #reroute_to_file?, reset_output_options, #set_buffer_cap, #set_error_logfile, #uncap_buffer, #unmute, #verbose, #verbose?

Constructor Details

#initialize(opts = Arachni::Options.instance) ⇒ Local

Returns a new instance of Local.



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/arachni/ui/cli/rpc/local.rb', line 39

def initialize( opts = Arachni::Options.instance )
    @opts = opts

    # If the user needs help, output it and exit.
    if opts.help
        print_banner
        usage
        exit 0
    end

    # Tells all Instances which are going to be spawned to ignore interrupt
    # signals.
    @opts.datastore[:do_not_trap] = true

    # Spawns an Instance and configures it to listen on a UNIX-domain socket.
    instance = Processes::Instances.spawn( socket: "/tmp/arachni-#{available_port}" )

    # Let the Instance UI manage the Instance from now on.
    Instance.new( @opts, instance ).run

    # Make sure the Instance processes are killed.
    Processes::Instances.killall
end

Instance Method Details

#usageObject

Outputs help/usage information.



64
65
66
67
68
69
70
71
72
73
# File 'lib/arachni/ui/cli/rpc/local.rb', line 64

def usage
    super

    print_line <<USAGE
Distribution -----------------

--spawns=<integer>          How many slaves to spawn for a high-performance mult-Instance scan.

USAGE
end