Created
February 23, 2011 21:38
-
-
Save Zapotek/841237 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
Arachni | |
Copyright (c) 2010-2011 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 | |
module Arachni | |
module MetaModules | |
# | |
# | |
# Description and stuff, bla blah blah... | |
# | |
# @author: Tasos "Zapotek" Laskos | |
# <tasos.laskos@gmail.com> | |
# <zapotek@segfault.gr> | |
# @version: 0.1 | |
# | |
class MyMeta < Base | |
include Arachni::Module::Utilities | |
def initialize( framework ) | |
# you'll need this to set your hook up and listen for responses | |
@http = framework.http | |
# initialize your stuff here | |
@my_array = [] | |
end | |
# | |
# prepare() runs while the scan is running to give you a chance to prepare all | |
# the data you need for later analysis | |
# | |
def prepare | |
# | |
# run for each response as it arrives | |
# | |
# These are somewhat raw responses and not parsed pages like with the modules | |
# | |
@http.add_on_complete { | |
|res| | |
# | |
# do stuff with the response and put the results in @my_array | |
# | |
# you're probably interested in: | |
# * res.body | |
# * res.code | |
# * res.headers | |
# | |
} | |
end | |
# | |
# run() executes after the scan has finished | |
# | |
def run | |
# | |
# analyze the data in @my_array | |
# | |
# | |
# if you want to include the results of your analysis in reports | |
# you'll have to return them to the framework | |
# | |
# return my_data | |
# | |
# However, since that data will be abstract their format can't | |
# be anticipated my Arachni so you'll have to format them yourself. | |
# | |
# You can do this by adding a 'metaformatter' to be used by the report | |
# you want. | |
# | |
# For example, look in <arachni root>/reports/plugin_formatters/stdout/metaformatters/ | |
# | |
# The class name of the metaformatter must be the same as this one (MyMeta) | |
# and the same goes for the filename (my_meta.rb). | |
# | |
end | |
def self.info | |
super.merge( { | |
:description => %q{Description of the purpose of this metaformatter.}, | |
:author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>', | |
:version => '0.1', | |
} ) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment