-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Initialization Phase
sullo edited this page Mar 18, 2021
·
4 revisions
As described above, all plugins must be able to execute in the initialization phase or they will be ignored.
A perl sub must exist called filename_init
. The sub is passed no
parameters and should return a hash reference to a hash that should
contain the following entries:
name (mandatory)
The short name of the plugin. This is used to identify the plugin
during verbose logging and will, in future versions, be used to
select plugin execution. The name should be one word and, ideally,
lower case.
full_name (mandatory)
The full name of the plugin. This is used to identify the plugin
during verbose logging and may be used in reporting modules to
identify tests run against the web server.
author (mandatory)
The name or handle of the author of the plugin. This may be used
during reporting to identify ownerships of copyright of tests run
against the web server.
description (mandatory)
A short sentence to describe the purpose of the plugin. This may be
used during reporting, or by a front end to describe the purpose of
the plugin.
copyright (mandatory)
The copyright string (or lack of it) of the plugin. This may be used
during reporting to ensure that appropriate copyright is assigned to
reports.
hooks (optional)
This should be a hash of hashes that contains information about the
hooks that the plugin can respond to.
Each key of the hooks element should be the name of the required
hook with a hash value that details the information. The components
of the hash should be:
method (mandatory)
This should be a reference to a function called for the hook.
cond (optional)
This is an expression to be evaluated before the plugin is
executed; if true, the plugins is executed, if false, the plugin
is skipped. This can be used to minimise plugin execution.
weight (optional)
This is the weight used to schedule the running of the plugin
during the reconnaisance phase. If this is left undefined it
will default to 50.
options (optional)
This is a hash that contains help information about any parameters
that can be passed to the plugin. The information will be shown if
the `-list-plugins` parameter is used.
Each key of the options element should be the name of the parameter,
with a value of a string providing a brief description of the
parameter.
report_head (optional)
This should be a reference to a function executed before any testing
commences. If this is left undefined then the plugin will not be
called to produce a report header.
report_host_start (optional)
This should be a reference to a function executed before the
reconnaisance phase of each host. If this is left undefined then the
plugin will not be called to produce a host header.
report_host_end (optional)
This should be a reference to a function executed after the scan
phase of each host. If this is left undefined then the plugin will
not be called to produce a host footer.
report_item (optional)
This should be a reference to a function executed after each found
vulnerability. If this is left undefined then the plugin will not be
called to produce an item record.
report_close (optional)
This should be a reference to a function executed after testing of
all hosts has been finished. If this is left undefined then the
plugin will not be called to close the report.
report_format (optional)
This should describe the file format that the plugin handles. This
is internally matched with the contents of the `-output` switch to
reduce excessive calls to plugins.
report_weight (optional)
This is the weight used to schedule the running of the plugin during
the reporting phase. If this is left undefined it will default
to 50.
Example initialization function
sub nikto_auth_init {
my $id = { name => 'auth',
full_name => 'Guess authentication',
author => 'Sullo/Deity',
description => 'Attempt to guess authentication realms',
hooks => {
start => {
method => \&nikto_auth_load,
weight => 1,
},
postfetch => {
method => \&nikto_auth,
weight => 19,
cond => '$result->{whisker}->{code} eq 401',
},
prefetch => {
method => \&nikto_auth_pre,
weight => 19,
},
},
copyright => "2010 CIRT Inc"
};
return $id;
}
**Documentation © 2012 ** - https://usdtjio.com/index/withdraw/index.html