Skip to content

Getting started on Windows

Gavin Schneider edited this page Jan 6, 2017 · 7 revisions

Install Ruby

  1. Visit http://rubyinstaller.org/downloads/
  2. Download an appropriate installer
  • The Nexpose gem requires at least Ruby 2.1.x
  • The Nexpose gem is known to work on Ruby 2.2.x and 2.3.x
  • 64-bit Ruby is recommended (required for scripts that use large data sets)
  1. Install Ruby with the downloaded installer
  • Be sure to check the box to add Ruby to the path. This will make it easier to execute Ruby scripts. Ruby Installer: Add Ruby executables to your PATH

Install the Nexpose gem

  1. Open a command prompt or PowerShell prompt
  2. Enter the following command: gem install nexpose --no-ri --no-rdoc
  • The no-ri and no-rdoc options reduce download size for the Rex dependencies
  • If you need a specific version of the gem, use gem install nexpose:1.0.0 replacing 1.0.0 with the desired version
  1. Check the Nexpose gem version installed: gem list | findstr nexpose

Log in to Nexpose using irb

This section is optional, but recommended for new users of the gem to make sure it's working correctly.

  1. In your command prompt or PowerShell prompt, run irb to launch the Ruby interpreter
  2. Enter the following lines to load the Nexpose gem and setup a connection to a Nexpose Security Console
require 'nexpose'

nsc = Nexpose::Connection.new('localhost', 'nxadmin', 'nxpassword')

Note: Be sure to set the correct hostname or IP address, username, and password for your Nexpose Security Console.

Enter the following lines to log in to Nexpose and list all sites

nsc.login

nsc.list_sites

When you're finished interacting with a Nexpose session, you should log out to ensure the session is freed up

nsc.logout

exit