modules/recon/interesting_responses.rb in arachni-0.3 vs modules/recon/interesting_responses.rb in arachni-0.4
- old
+ new
@@ -1,28 +1,27 @@
=begin
Arachni
- Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
+ Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
This is free software; you can copy and distribute and modify
this program under the term of the GPL v2.0 License
(See LICENSE file for details)
=end
require 'digest/md5'
module Arachni
-
module Modules
#
# Logs all non 200 (OK) and non 404 server responses.
#
# @author: Tasos "Zapotek" Laskos
# <tasos.laskos@gmail.com>
# <zapotek@segfault.gr>
-# @version: 0.1.1
+# @version: 0.1.3
#
#
class InterestingResponses < Arachni::Module::Base
include Arachni::Module::Utilities
@@ -30,18 +29,16 @@
IGNORE_CODES = [
200,
404
]
- def initialize( page )
- super( page )
-
+ def prepare
# we need to run only once
@@__ran ||= false
end
- def run( )
+ def run
return if @@__ran
print_status( "Listening..." )
# tell the HTTP interface to cal this block every-time a request completes
@@ -60,11 +57,11 @@
{
:name => 'Interesting responses',
:description => %q{Logs all non 200 (OK) server responses.},
:elements => [ ],
:author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>',
- :version => '0.1.1',
+ :version => '0.1.3',
:targets => { 'Generic' => 'all' },
:issue => {
:name => %q{Interesting server response.},
:description => %q{The server responded with a non 200 (OK) code. },
:tags => [ 'interesting', 'response', 'server' ],
@@ -92,23 +89,20 @@
@@_loged[:digests].include?( digest )
@@_loged[:paths] << path
@@_loged[:digests] << digest
- issue = Issue.new( {
+ log_issue(
:url => res.effective_url,
:method => res.request.method.to_s.upcase,
:id => "Code: #{res.code.to_s}",
:elem => Issue::Element::SERVER,
:response => res.body,
:headers => {
:request => res.request.headers,
:response => res.headers,
}
- }.merge( self.class.info ) )
-
- # register our results with the system
- register_results( [issue] )
+ )
# inform the user that we have a match
print_ok( "Found an interesting response (Code: #{res.code.to_s})." )
end