Library omp2

This library was written to ease interaction with OpenVAS Manager servers using OMP (OpenVAS Management Protocol) version 2.

A very small subset of the protocol is implemented.

  • Connection/authentication
  • Targets enumeration

The library can also store accounts in the registry to share them between scripts.

The complete protocol documentation is available on the official OpenVAS website: http://www.openvas.org/omp-2-0.html

Sample use:

   local session = omp2.Session:new()
   local status, err = session:connect(host, port)
   local status, err = session:authenticate(username, password)
   ...
   session:close()

Author:

  • Henri Doreau

Copyright © Same as Nmap -- See https://nmap.org/book/man-legal.html

Source: https://svn.nmap.org/nmap/nselib/omp2.lua

Script Arguments

omp2.username

The username to use for authentication.

omp2.password

The password to use for authentication.

Functions

add_account (host, username, password)

Registers OMP2 credentials for a given host

authenticate (self, username, password)

Attempts to authenticate on the current connection

close (self)

Closes connection

connect (self, host, port)

Establishes the (SSL) connection to the remote server

get_accounts (host)

Retrieves the list of accounts for a given host

ls_targets (self)

Lists targets defined on the remote server

new (self, socket)

Creates a new session object

Functions

add_account (host, username, password)

Registers OMP2 credentials for a given host

Parameters

host
 
username
 
password
 
authenticate (self, username, password)

Attempts to authenticate on the current connection

Parameters

self
 
username
 
password
 
close (self)

Closes connection

Parameters

self
 
connect (self, host, port)

Establishes the (SSL) connection to the remote server

Parameters

self
 
host
 
port
 
get_accounts (host)

Retrieves the list of accounts for a given host

Parameters

host
 
ls_targets (self)

Lists targets defined on the remote server

Parameters

self
 
new (self, socket)

Creates a new session object

Parameters

self
 
socket