Class: Arachni::Options
- Inherits:
-
Object
- Object
- Arachni::Options
- Includes:
- Singleton
- Defined in:
- lib/options.rb
Overview
Options class.
Implements the Singleton pattern and formaly defines all of Arachni’s runtime options.
@author: Anastasios “Zapotek” Laskos
<tasos.laskos@gmail.com> <zapotek@segfault.gr>
@version: $Rev: 352 $
Instance Attribute Summary (collapse)
-
- (Bool) arachni_verbose
Be verbose?.
-
- (Bool) audit_cookies
Should Arachni audit cookies?.
-
- (Bool) audit_forms
Should Arachni audit forms?.
-
- (Bool) audit_headers
Should Arachni audit HTTP headers?.
-
- (Bool) audit_links
Should Arachni audit links?.
-
- (String) authed_by
The person that authorized the scan
It will be added to the HTTP “user-agent” and “from” headers. -
- (String) cookie_jar
Location of the cookiejar.
-
- (Hash) cookies
To be populated by the framework.
-
- (Bool) debug
Output debugging messages?.
-
- (Object) delta_time
to be populated by the framework.
-
- (Integer) depth_limit
How deep to go in the site structure?
If nil, depth_limit = inf. -
- (Hash) dir
Holds absolute paths for the directory structure of the framework.
-
- (Array) exclude
Exclude filters
URL matching any of these patterns won’t be followed. -
- (Array) exclude_cookies
Cookies to exclude from audit
. -
- (Object) finish_datetime
to be populated by the framework.
-
- (Bool) follow_subdomains
Should the crawler follow subdomains?.
-
- (Bool) help
Show help?.
-
- (Array) include
Include filters
Only URLs that match any of these patterns will be followed. -
- (Integer) link_count_limit
How many links to follow? If nil, link_count_limit = inf.
-
- (String) load_profile
Location of an Arachni Framework Profile (.afp) file to load.
-
- (Bool) lsmod
List modules and exit?.
-
- (Bool) lsrep
List reports and exit?.
-
- (Array) mods
Array of modules to load.
-
- (Bool) mods_run_last
Run the modules after the crawl/analysis?.
-
- (Bool) obey_robots_txt
Should the crawler obery robots.txt files?.
-
- (Bool) only_positives
Output only positive results during the audit?.
-
- (String) proxy_addr
The address of the proxy server.
-
- (String) proxy_pass
The proxy password.
-
- (String) proxy_port
The port to connect on the proxy server.
-
- (String) proxy_type
The proxy type.
-
- (String) proxy_user
The proxy user.
-
- (Integer) redirect_limit
How many redirects to follow? If nil, redirect_limit = inf.
-
- (Array) redundant
Filters for redundant links.
-
- (String) repload
Location of an Arachni Framework Report (.afr) file to load.
-
- (Hash) repopts
Options to be passed to the reports.
-
- (Array) reports
Array of reports to load.
-
- (String) repsave
Where to save the Arachni Framework Report (.afr) file.
-
- (Object) resume
Not implemented.
-
- (String) save_profile
Where to save the Arachni Framework Profile (.afp) file.
-
- (Object) start_datetime
to be populated by the framework.
-
- (Integer) threads
How many threads to spawn?.
-
- (String, URI) url
The URL to audit.
-
- (String) user_agent
The HTTP user-agent to use.
Instance Method Summary (collapse)
-
- (Options) initialize
constructor
A new instance of Options.
-
- (Object) merge!(options)
Merges self with the object in ‘options’.
-
- (Hash) to_h
Converts the Options object to hash.
Constructor Details
- (Options) initialize
A new instance of Options
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
# File 'lib/options.rb', line 325 def initialize( ) # nil everything out self.instance_variables.each { |var| send( "#{var}=", nil ) } @exclude = [] @include = [] @redundant = [] @reports = [] @repopts = Hash.new @dir = Hash.new @exclude_cookies = [] end |
Instance Attribute Details
- (Bool) arachni_verbose
Be verbose?
70 71 72 |
# File 'lib/options.rb', line 70 def arachni_verbose @arachni_verbose end |
- (Bool) audit_cookies
Should Arachni audit cookies?
157 158 159 |
# File 'lib/options.rb', line 157 def @audit_cookies end |
- (Bool) audit_forms
Should Arachni audit forms?
150 151 152 |
# File 'lib/options.rb', line 150 def audit_forms @audit_forms end |
- (Bool) audit_headers
Should Arachni audit HTTP headers?
164 165 166 |
# File 'lib/options.rb', line 164 def audit_headers @audit_headers end |
- (Bool) audit_links
Should Arachni audit links?
143 144 145 |
# File 'lib/options.rb', line 143 def audit_links @audit_links end |
- (String) authed_by
The person that authorized the scan
It will be added to the HTTP
“user-agent” and “from” headers.
221 222 223 |
# File 'lib/options.rb', line 221 def authed_by @authed_by end |
- (String) cookie_jar
Location of the cookiejar
272 273 274 |
# File 'lib/options.rb', line 272 def @cookie_jar end |
- (Hash) cookies
To be populated by the framework
Parsed cookiejar cookies
265 266 267 |
# File 'lib/options.rb', line 265 def @cookies end |
- (Bool) debug
Output debugging messages?
77 78 79 |
# File 'lib/options.rb', line 77 def debug @debug end |
- (Object) delta_time
to be populated by the framework
323 324 325 |
# File 'lib/options.rb', line 323 def delta_time @delta_time end |
- (Integer) depth_limit
How deep to go in the site structure?
If nil, depth_limit = inf
99 100 101 |
# File 'lib/options.rb', line 99 def depth_limit @depth_limit end |
- (Hash) dir
Holds absolute paths for the directory structure of the framework
37 38 39 |
# File 'lib/options.rb', line 37 def dir @dir end |
- (Array) exclude
Exclude filters
URL matching any of these patterns won’t be
followed
287 288 289 |
# File 'lib/options.rb', line 287 def exclude @exclude end |
- (Array) exclude_cookies
Cookies to exclude from audit
294 295 296 |
# File 'lib/options.rb', line 294 def @exclude_cookies end |
- (Object) finish_datetime
to be populated by the framework
321 322 323 |
# File 'lib/options.rb', line 321 def finish_datetime @finish_datetime end |
- (Bool) follow_subdomains
Should the crawler follow subdomains?
309 310 311 |
# File 'lib/options.rb', line 309 def follow_subdomains @follow_subdomains end |
- (Bool) help
Show help?
51 52 53 |
# File 'lib/options.rb', line 51 def help @help end |
- (Array) include
Include filters
Only URLs that match any of these patterns will be
followed
302 303 304 |
# File 'lib/options.rb', line 302 def include @include end |
- (Integer) link_count_limit
How many links to follow? If nil, link_count_limit = inf
107 108 109 |
# File 'lib/options.rb', line 107 def link_count_limit @link_count_limit end |
- (String) load_profile
Location of an Arachni Framework Profile (.afp) file to load
213 214 215 |
# File 'lib/options.rb', line 213 def load_profile @load_profile end |
- (Bool) lsmod
List modules and exit?
122 123 124 |
# File 'lib/options.rb', line 122 def lsmod @lsmod end |
- (Bool) lsrep
List reports and exit?
129 130 131 |
# File 'lib/options.rb', line 129 def lsrep @lsrep end |
- (Array) mods
Array of modules to load
171 172 173 |
# File 'lib/options.rb', line 171 def mods @mods end |
- (Bool) mods_run_last
Run the modules after the crawl/analysis?
316 317 318 |
# File 'lib/options.rb', line 316 def mods_run_last @mods_run_last end |
- (Bool) obey_robots_txt
Should the crawler obery robots.txt files?
91 92 93 |
# File 'lib/options.rb', line 91 def obey_robots_txt @obey_robots_txt end |
- (Bool) only_positives
Output only positive results during the audit?
58 59 60 |
# File 'lib/options.rb', line 58 def only_positives @only_positives end |
- (String) proxy_addr
The address of the proxy server
228 229 230 |
# File 'lib/options.rb', line 228 def proxy_addr @proxy_addr end |
- (String) proxy_pass
The proxy password
242 243 244 |
# File 'lib/options.rb', line 242 def proxy_pass @proxy_pass end |
- (String) proxy_port
The port to connect on the proxy server
235 236 237 |
# File 'lib/options.rb', line 235 def proxy_port @proxy_port end |
- (String) proxy_type
The proxy type
256 257 258 |
# File 'lib/options.rb', line 256 def proxy_type @proxy_type end |
- (String) proxy_user
The proxy user
249 250 251 |
# File 'lib/options.rb', line 249 def proxy_user @proxy_user end |
- (Integer) redirect_limit
How many redirects to follow? If nil, redirect_limit = inf
115 116 117 |
# File 'lib/options.rb', line 115 def redirect_limit @redirect_limit end |
- (Array) redundant
Filters for redundant links
84 85 86 |
# File 'lib/options.rb', line 84 def redundant @redundant end |
- (String) repload
Location of an Arachni Framework Report (.afr) file to load
185 186 187 |
# File 'lib/options.rb', line 185 def repload @repload end |
- (Hash) repopts
Options to be passed to the reports
199 200 201 |
# File 'lib/options.rb', line 199 def repopts @repopts end |
- (Array) reports
Array of reports to load
178 179 180 |
# File 'lib/options.rb', line 178 def reports @reports end |
- (String) repsave
Where to save the Arachni Framework Report (.afr) file
192 193 194 |
# File 'lib/options.rb', line 192 def repsave @repsave end |
- (Object) resume
Not implemented
63 64 65 |
# File 'lib/options.rb', line 63 def resume @resume end |
- (String) save_profile
Where to save the Arachni Framework Profile (.afp) file
206 207 208 |
# File 'lib/options.rb', line 206 def save_profile @save_profile end |
- (Object) start_datetime
to be populated by the framework
319 320 321 |
# File 'lib/options.rb', line 319 def start_datetime @start_datetime end |
- (Integer) threads
How many threads to spawn?
136 137 138 |
# File 'lib/options.rb', line 136 def threads @threads end |
- (String, URI) url
The URL to audit
44 45 46 |
# File 'lib/options.rb', line 44 def url @url end |
- (String) user_agent
The HTTP user-agent to use
279 280 281 |
# File 'lib/options.rb', line 279 def user_agent @user_agent end |
Instance Method Details
- (Object) merge!(options)
Merges self with the object in ‘options’
362 363 364 365 366 367 |
# File 'lib/options.rb', line 362 def merge!( ) .to_h.each_pair { |k, v| send( "#{k}=", v ) if v } end |
- (Hash) to_h
Converts the Options object to hash
348 349 350 351 352 353 354 355 |
# File 'lib/options.rb', line 348 def to_h hash = Hash.new self.instance_variables.each { |var| hash[normalize_name( var )] = self.instance_variable_get( var ) } hash end |