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)
-
- (void) debug!
Sets the Output::@@debug flag to true.
-
- (Bool) debug?
Returns the Output::@@debug flag.
-
- (void) only_positives!
Sets the Output::@@only_positives flag to true.
-
- (Bool) only_positives?
Returns the Output::@@only_positives flag.
-
- (void) print_debug(str = '')
Prints a debugging message.
-
- (void) print_debug_backtrace(e = nil)
Prints the backtrace of an exception.
-
- (void) print_debug_pp(obj = nil)
Pretty prints an object, used for debugging, needs some improvement but it’ll do for now.
-
- (void) print_error(str = '')
Prints an error message.
-
- (void) print_info(str = '')
Prints an info message.
-
- (void) print_line(str = '')
Prints a line of message.
-
- (void) print_ok(str = '')
Prints a good message, something that went very very right, like the discovery of a vulnerability.
-
- (void) print_status(str = '')
Prints a status message.
-
- (void) print_verbose(str = '')
Prints a verbose message.
-
- (void) verbose!
Sets the Output::@@verbose flag to true.
-
- (Bool) verbose?
Returns the Output::@@verbose flag.
Instance Method Details
- (void) debug!
This method returns an undefined value.
Sets the @@debug flag to true
201 202 203 |
# File 'lib/ui/cli/output.rb', line 201 def debug! @@debug = true end |
- (Bool) debug?
Returns the @@debug flag
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
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
231 232 233 |
# File 'lib/ui/cli/output.rb', line 231 def only_positives? @@only_positives end |
- (void) print_debug(str = '')
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 |
- (void) print_debug_backtrace(e = nil)
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 |
- (void) print_debug_pp(obj = nil)
This method returns an undefined value.
Pretty prints an object, used for debugging, needs some improvement but it’ll do for now
Obeys @@debug
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 |
- (void) print_error(str = '')
This method returns an undefined value.
Prints an error message
It ignores all flags, error messages will be output under all circumstances.
53 54 55 |
# File 'lib/ui/cli/output.rb', line 53 def print_error( str = '' ) print_color( '[-]', 31, str ) end |
- (void) print_info(str = '')
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 |
- (void) print_line(str = '')
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 |
- (void) print_ok(str = '')
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.
95 96 97 |
# File 'lib/ui/cli/output.rb', line 95 def print_ok( str = '' ) print_color( '[+]', 32, str ) end |
- (void) print_status(str = '')
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 |
- (void) print_verbose(str = '')
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
181 182 183 |
# File 'lib/ui/cli/output.rb', line 181 def verbose! @@verbose = true end |
- (Bool) verbose?
Returns the @@verbose flag
191 192 193 |
# File 'lib/ui/cli/output.rb', line 191 def verbose? @@verbose end |