Sha256: 23f9c75401bff30d855ca3780d2adbbda7bdb808956612e2f178fa703041318e

Contents?: true

Size: 1.6 KB

Versions: 744

Compression:

Stored size: 1.6 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'pwn'
require 'optparse'

opts = {}
OptionParser.new do |options|
  options.banner = "USAGE:
    #{$PROGRAM_NAME} [opts]
  "

  # Nexpose Flags
  options.on('-CIP', '--console_ip=IP', '<Required - Nexpose Console IP>') { |c| opts[:console_ip] = c }
  options.on('-UCUSER', '--console_username=CUSER', '<Required - Nexpose Console Username>') { |cu| opts[:console_username] = cu }
  options.on('-PCPASS', '--console_password=CPASS', '<Required - Nexpose Console Password>') { |cp| opts[:console_password] = cp }
  options.on('-SSITE', '--site_name=SITE', '<Required - Nexpose Site Name>') { |s| opts[:site_name] = s }
  options.on('-RREPORTS', '--report_names=REPORTS', '<Required - Comma Delimited String of Report Names>') { |r| opts[:report_names] = r }
end.parse!

if opts.empty?
  puts `#{$PROGRAM_NAME} --help`
  exit 1
end

# Nexpose
console_ip = opts[:console_ip].to_s.scrub
console_username = opts[:console_username].to_s.scrub
console_password = opts[:console_password] # Prompt if console_password.nil? (For Demos)
site_name = opts[:site_name].to_s.scrub
report_names = opts[:report_names].to_s.scrub

#-----------------
# Login to Nexpose
site_id = nil
nsc_obj = PWN::Plugins::NexposeVulnScan.login(
  console_ip: console_ip,
  username: console_username,
  password: console_password
)

nsc_obj = PWN::Plugins::NexposeVulnScan.scan_site_by_name(
  nsc_obj: nsc_obj,
  site_name: site_name
)

nsc_obj = PWN::Plugins::NexposeVulnScan.download_recurring_report(
  nsc_obj: nsc_obj,
  report_names: report_names
)

PWN::Plugins::NexposeVulnScan.logout(nsc_obj: nsc_obj)

Version data entries

744 entries across 744 versions & 1 rubygems

Version Path
pwn-0.5.80 bin/pwn_nexpose
pwn-0.5.79 bin/pwn_nexpose
pwn-0.5.78 bin/pwn_nexpose
pwn-0.5.77 bin/pwn_nexpose
pwn-0.5.76 bin/pwn_nexpose
pwn-0.5.75 bin/pwn_nexpose
pwn-0.5.74 bin/pwn_nexpose
pwn-0.5.73 bin/pwn_nexpose
pwn-0.5.72 bin/pwn_nexpose
pwn-0.5.71 bin/pwn_nexpose
pwn-0.5.70 bin/pwn_nexpose
pwn-0.5.69 bin/pwn_nexpose
pwn-0.5.68 bin/pwn_nexpose
pwn-0.5.67 bin/pwn_nexpose
pwn-0.5.66 bin/pwn_nexpose
pwn-0.5.65 bin/pwn_nexpose
pwn-0.5.64 bin/pwn_nexpose
pwn-0.5.63 bin/pwn_nexpose
pwn-0.5.62 bin/pwn_nexpose
pwn-0.5.61 bin/pwn_nexpose