Module: Arachni::UI::Output

Included in:
Anemone::Core, Anemone::HTTP, Arachni::Analyzer, Arachni::Framework, Arachni::Module::HTTP, Arachni::Module::Registry, Arachni::Modules::Audit::AuditObjects, Arachni::Modules::Audit::Eval, Arachni::Modules::Audit::ResponseSplitting, Arachni::Modules::Audit::SQLInjection, Arachni::Modules::Audit::SimpleCmdExec, Arachni::Modules::Audit::SimpleRFI, Arachni::Modules::Audit::XSS, Arachni::Modules::Recon::BackupFiles, Arachni::Modules::Recon::ExtractObjects, Arachni::Reports::AP, Arachni::Reports::HTML, Arachni::Reports::Stdout, Arachni::Spider, CLI
Defined in:
lib/ui/cli/output.rb

Overview

CLI Output module

Provides a command line output interface to the framework.
All UIs should provide an Arachni::UI::Output module with these methods.

@author: Anastasios “Zapotek” Laskos

                                     <tasos.laskos@gmail.com>
                                     <zapotek@segfault.gr>

@version: 0.1-pre

Constant Summary

@@verbose =

verbosity flag

if it’s on verbose messages will be enabled

false
@@debug =

debug flag

if it’s on debugging messages will be enabled

false
@@only_positives =

only_positives flag

if it’s on status messages will be disabled

false

Instance Method Summary (collapse)

Instance Method Details

- (void) debug!

This method returns an undefined value.

Sets the @@debug flag to true

See Also:



201
202
203
# File 'lib/ui/cli/output.rb', line 201

def debug!
    @@debug = true
end

- (Bool) debug?

Returns the @@debug flag

Returns:

  • (Bool)

    @@debug

See Also:



211
212
213
# File 'lib/ui/cli/output.rb', line 211

def debug?
    @@debug
end

- (void) only_positives!

This method returns an undefined value.

Sets the @@only_positives flag to true

See Also:



221
222
223
# File 'lib/ui/cli/output.rb', line 221

def only_positives!
    @@only_positives = true
end

- (Bool) only_positives?

Returns the @@only_positives flag

Returns:

  • (Bool)

    @@only_positives

See Also:



231
232
233
# File 'lib/ui/cli/output.rb', line 231

def only_positives?
    @@only_positives
end

This method returns an undefined value.

Prints a debugging message

Obeys @@debug

Parameters:

  • (String) debugging

    string

See Also:



109
110
111
112
# File 'lib/ui/cli/output.rb', line 109

def print_debug( str = '' )
    if !@@debug then return end
    print_color( '[!]', 36, str )
end

This method returns an undefined value.

Prints the backtrace of an exception

Obeys @@debug

Parameters:

  • (Exception)

See Also:



140
141
142
143
# File 'lib/ui/cli/output.rb', line 140

def print_debug_backtrace( e = nil )
    if !@@debug then return end
    e.backtrace.each{ |line| print_debug( line ) }
end

This method returns an undefined value.

Pretty prints an object, used for debugging, needs some improvement but it’ll do for now

Obeys @@debug

Parameters:

  • (Object)

See Also:



125
126
127
128
# File 'lib/ui/cli/output.rb', line 125

def print_debug_pp( obj = nil )
    if !@@debug then return end
    pp obj
end

This method returns an undefined value.

Prints an error message

It ignores all flags, error messages will be output under all circumstances.

Parameters:

  • (String) error

    string



53
54
55
# File 'lib/ui/cli/output.rb', line 53

def print_error( str = '' )
    print_color( '[-]', 31, str )
end

This method returns an undefined value.

Prints an info message

Obeys @@only_positives

Parameters:

  • (String) info

    string

See Also:



82
83
84
85
# File 'lib/ui/cli/output.rb', line 82

def print_info( str = '' )
    if @@only_positives then return end
    print_color( '[~]', 30, str )
end

This method returns an undefined value.

Prints a line of message

Obeys @@only_positives

Parameters:

  • (String) string

See Also:



170
171
172
173
# File 'lib/ui/cli/output.rb', line 170

def print_line( str = '' )
    if @@only_positives then return end
    puts str
end

This method returns an undefined value.

Prints a good message, something that went very very right, like the discovery of a vulnerability

Disregards all flags.

Parameters:

  • (String) ok

    string



95
96
97
# File 'lib/ui/cli/output.rb', line 95

def print_ok( str = '' )
    print_color( '[+]', 32, str )
end

This method returns an undefined value.

Prints a status message

Obeys @@only_positives

Parameters:

  • (String) status

    string

See Also:



67
68
69
70
# File 'lib/ui/cli/output.rb', line 67

def print_status( str = '' )
    if @@only_positives then return end
    print_color( '[*]', 34, str )
end

This method returns an undefined value.

Prints a verbose message

Obeys @@verbose

Parameters:

  • (String) verbose

    string

See Also:



155
156
157
158
# File 'lib/ui/cli/output.rb', line 155

def print_verbose( str = '' )
    if !@@verbose then return end
    print_color( '[v]', 37, str )
end

- (void) verbose!

This method returns an undefined value.

Sets the @@verbose flag to true

See Also:



181
182
183
# File 'lib/ui/cli/output.rb', line 181

def verbose!
    @@verbose = true
end

- (Bool) verbose?

Returns the @@verbose flag

Returns:

  • (Bool)

    @@verbose

See Also:



191
192
193
# File 'lib/ui/cli/output.rb', line 191

def verbose?
    @@verbose
end