module PWN::Plugins::OpenVAS

def self.authors

def self.authors
st.pentest@0dayinc.com>

def self.get_report_types(opts = {})

def self.get_report_types(opts = {})
sername].to_s.scrub
[:password].nil?
Plugins::AuthenticationHelper.mask_password
:password].to_s.scrub

 => e

def self.get_task_id(opts = {})

def self.get_task_id(opts = {})
task_name].to_s.scrub
sername].to_s.scrub
[:password].nil?
Plugins::AuthenticationHelper.mask_password
:password].to_s.scrub
 = Nokogiri::XML(
 _gvm -- /usr/bin/gvm-cli \
 '#{username}' \
 '#{password}' \
sks/>"
.xpath(
onse/task[name/text()='#{task_name}']"
 => e

def self.get_task_status(opts = {})

def self.get_task_status(opts = {})
task_name].to_s.scrub
sername].to_s.scrub
[:password].nil?
Plugins::AuthenticationHelper.mask_password
:password].to_s.scrub
name,
me,
rd
text
 => e

def self.help

def self.help
#{self}.get_task_id(
quired task name to start',
uired username',
ional password (will prompt if nil)'
esp = #{self}.start_task(
quired task name to start',
uired username',
ional password (will prompt if nil)'
self}.get_task_status(
quired task name to start',
uired username',
ional password (will prompt if nil)'
 #{self}.last_report_id(
quired task name to start',
uired username',
ional password (will prompt if nil)'
ort(
required report type (csv|itg|pdf|txt|xml)',
quired report id to save',
equired directory to save report',
uired username',
ional password (will prompt if nil)',
 'optional - results filter (Default: \"apply_overrides=0 levels=hml rows=1000 min_qod=70 first=1 sort-reverse=severity\")
{self}.get_report_types(
uired username',
ional password (will prompt if nil)'

def self.last_report_id(opts = {})

def self.last_report_id(opts = {})
task_name].to_s.scrub
sername].to_s.scrub
[:password].nil?
Plugins::AuthenticationHelper.mask_password
:password].to_s.scrub
_id(
name,
me,
rd
t
Nokogiri::XML(
 _gvm -- /usr/bin/gvm-cli \
 '#{username}' \
 '#{password}' \
ports/>"
ath(
sponse/report/task[@id='#{task_id}']"
h(
 => e

def self.save_report(opts = {})

def self.save_report(opts = {})
[:report_type].to_s.scrub
report_id].to_s.scrub
:report_dir].to_s.scrub
r} Does Not Exist." unless Dir.exist?(
sername].to_s.scrub
[:password].nil?
Plugins::AuthenticationHelper.mask_password
:password].to_s.scrub
ts[:report_filter]
'apply_overrides=0 levels=hml rows=1000 min_qod=70 first=1 sort-reverse=severity'
o_sym
 = 'CSV Results'
 = 'ITG'
 = 'PDF'
 = 'TXT'
 = 'XML'
pe: \"#{report_type}\" not supported."
_resp = Nokogiri::XML(
 _gvm -- /usr/bin/gvm-cli \
 '#{username}' \
 '#{password}' \
port_formats/>"
y_name = report_formats_xml_resp.xpath(
mats_response/report_format[name/text()='#{report_type_name}']"
t_xml_resp_by_name.xpath('@id').text
Nokogiri::XML(
 _gvm -- /usr/bin/gvm-cli \
 '#{username}' \
 '#{password}' \
ports report_id='#{report_id}' format_id='#{format_id}' filter='#{report_filter}' details='1' />"
.parse(
p.xpath('//modification_time')
time(
M-%S%z'
port_xml_resp.xpath(
'
ort_dir}/openvas_results-#{timestamp}.#{report_type}", 'w') do |f|
t_dir}/openvas_results.#{report_type}", 'w') do |f|
rict_decode64(base64_report)
 => e

def self.start_task(opts = {})

def self.start_task(opts = {})
task_name].to_s.scrub
sername].to_s.scrub
[:password].nil?
Plugins::AuthenticationHelper.mask_password
:password].to_s.scrub
_id(
name,
me,
rd
t
 _gvm -- /usr/bin/gvm-cli \
 '#{username}' \
 '#{password}' \
task task_id='#{task_id}'/>"
 => e