Class: Arachni::UI::CLI::RPC::DispatcherMonitor

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

Overview

Provides an simplistic Dispatcher monitoring user interface.

Author:

Version:

  • 0.1.3

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) ⇒ DispatcherMonitor

Returns a new instance of DispatcherMonitor.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/arachni/ui/cli/rpc/dispatcher_monitor.rb', line 40

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

    debug if @opts.debug

    clear_screen
    move_to_home

    # print banner message
    print_banner

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

    if !@opts.url
        print_error 'No server specified.'
        print_line
        usage
        exit
    end

    begin
        # start the RPC client
        @dispatcher = Arachni::RPC::Client::Dispatcher.new( @opts, @opts.url.to_s )
        @dispatcher.alive?
    rescue RPC::Exceptions::ConnectionError => e
        print_error "Could not connect to server '#{@opts.url}'."
        print_error "Error: #{e.to_s}."
        print_debug_backtrace e
        exit
    end

    # trap interupts and exit cleanly when required
    trap( 'HUP' ) { exit }
    trap( 'INT' ) { exit }

    run
end