Openvas Compendium 1.0.1
Openvas Compendium 1.0.1
Imprint
Copyright c 2008, 2009 Intevation GmbH
This work is licensed under the Creative Commons License Attribution-ShareAlike 3.0 Unported
http://creativecommons.org/licenses/by-sa/3.0/deed.en
Contents
1 Introduction 1.1 About this Compendium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 About the OpenVAS Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 About the OpenVAS Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Planning OpenVAS-based Network Auditing 2.1 Consider Coverage of Available Vulnerability Tests 2.2 Choose Location of Scan-Server . . . . . . . . . . 2.3 Choose Type of Scan-Server . . . . . . . . . . . . 2.3.1 Hardware . . . . . . . . . . . . . . . . . . 2.3.2 Operating System . . . . . . . . . . . . . . 9 9 9 10 11 11 12 12 12 12 13 13 13 13 13 14 14 14 15 15 15 15 16 19 19 19 20 20 20 20 21 21 22 22 22 23 25 25 25 25 26 26
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
3 Installing and Conguring OpenVAS-Server 3.1 Installing Binary Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1 Debian and Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2 Gentoo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.3 RPM-Based Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.4 FreeBSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Compiling OpenVAS-Server from Source Packages . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Latest source code release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Most current state of development (directly from the source code management system) 3.3 Conguring OpenVAS-Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 Generating a Server Certicate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2 Adding New Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.3 Advanced Conguration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Conguring NVT Feeds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.2 Performing a synchronization with an OpenVAS NVT Feed . . . . . . . . . . . . . . 3.4.3 Available NVT Feed Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.4 Automatically Updating an NVT Feed . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Managing NVT signatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1 What is a Signature? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2 The Signature Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.3 The Signature Verication Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.4 How to Add a Certicate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.5 How to Set Trust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.6 How to Remove a Certicate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.7 Manual Signature Verication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 OpenVAS File Locations 4.1 Executables for users (PREFIX/bin) . . . . . 4.2 Server conguration (PREFIX/etc/openvas) . 4.3 Compilation les (PREFIX/include/openvas) 4.4 Libraries (PREFIX/lib) . . . . . . . . . . . . 4.5 NVTs (PREFIX/lib/openvas/plugins) . . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
6
4.6 4.7 4.8 4.9 4.10 4.11 4.12
5 Installing and Conguring OpenVAS-Client 5.1 Installing Binary Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.1 Debian and Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.2 Gentoo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.3 RPM-Based Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.4 Windows XP SP2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.5 FreeBSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Compiling OpenVAS-Client from Source Packages . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Latest source code release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.2 Most current state of development (directly from the source code management system) 6 Using OpenVAS-Client 6.1 The Main Window . . . . . . . . . . . . . . 6.1.1 Tasks . . . . . . . . . . . . . . . . . 6.1.2 Scopes . . . . . . . . . . . . . . . . 6.1.3 Reports . . . . . . . . . . . . . . . . 6.2 Authentication . . . . . . . . . . . . . . . . . 6.3 Scan Options . . . . . . . . . . . . . . . . . 6.3.1 General . . . . . . . . . . . . . . . . 6.3.2 Plugins . . . . . . . . . . . . . . . . 6.3.3 Credentials . . . . . . . . . . . . . . 6.3.4 Target Selection . . . . . . . . . . . . 6.3.5 Plugin Preferences . . . . . . . . . . 6.3.6 Access Rules . . . . . . . . . . . . . 6.3.7 Knowledge Base . . . . . . . . . . . 6.4 Reports . . . . . . . . . . . . . . . . . . . . 6.4.1 Report Page of OpenVAS-Client . . . 6.4.2 Report Formats . . . . . . . . . . . . 6.5 OpenVAS-Client Preferences . . . . . . . . . 6.5.1 User Interface . . . . . . . . . . . . . 6.5.2 Connection to the OpenVAS server . 6.5.3 Plugin Cache . . . . . . . . . . . . . 6.5.4 Report . . . . . . . . . . . . . . . . . 6.5.5 External Links in HTML/PDF . . . . 6.5.6 Installing SLAD using SLADinstaller
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
7 Performing Local Security Checks 7.1 Debian Local Security Checks . . . . . . . . . . . . . . . . . 7.1.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . 7.1.2 Create users for local security checks . . . . . . . . . 7.1.3 Congure the local security checks in OpenVAS-Client 7.2 Windows Local Security Checks . . . . . . . . . . . . . . . . 7.2.1 Preparing the OpenVAS Server . . . . . . . . . . . . . 7.2.2 Preparing the Microsoft Windows target . . . . . . . . 7.2.3 Executing the checks via OpenVAS-Client . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
7
49 49 49 49 51 51 51 52 52 55 55 56 56 56 57 57 57 57 57 57 58 58 58 65 66 75 76 77 79 81 85 85 87 87 88 88 89 89 90 93 93 94 94 94 94 95 95 95 95 96
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
10 Developers Guide for OpenVAS Server and Client 10.1 The OpenVAS Source Code Map . . . . . . . . . . . . 10.2 Source Code Branches for Stable and In-Development 10.3 Code Quality and Code Security . . . . . . . . . . . . 10.4 Management of OpenVAS Change Requests . . . . . . 10.5 Submitting Patches . . . . . . . . . . . . . . . . . . . 10.6 Write-Access to Source Code Repository . . . . . . . 10.7 Maintaining ChangeLog . . . . . . . . . . . . . . . . 10.8 Source Code Style Guide . . . . . . . . . . . . . . . . 11 OpenVAS Transfer Protocol (OTP) 11.1 Changes from NTP 1.2 to OTP 1.0 11.2 General Aspects of OTP . . . . . 11.3 Protocol Initialization . . . . . . . 11.4 Protocol Commands . . . . . . . . 11.4.1 ATTACHED_FILE . . . . 11.4.2 BYE . . . . . . . . . . . 11.4.3 CERTIFICATES . . . . . 11.4.4 COMPLETE_LIST . . . . 11.4.5 DEBUG . . . . . . . . . . 11.4.6 ERROR . . . . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
8
11.4.7 FINISHED . . . . . . . . . . 11.4.8 GO ON . . . . . . . . . . . . 11.4.9 HOLE . . . . . . . . . . . . . 11.4.10 INFO . . . . . . . . . . . . . 11.4.11 LOG . . . . . . . . . . . . . 11.4.12 LONG_ATTACK . . . . . . . 11.4.13 NOTE . . . . . . . . . . . . . 11.4.14 OPENVAS_VERSION . . . . 11.4.15 PLUGINS_DEPENDENCIES 11.4.16 PLUGINS_MD5 . . . . . . . 11.4.17 PLUGIN_INFO . . . . . . . . 11.4.18 PLUGIN_LIST . . . . . . . . 11.4.19 PORT . . . . . . . . . . . . . 11.4.20 PREFERENCES . . . . . . . 11.4.21 RULES . . . . . . . . . . . . 11.4.22 SEND_PLUGINS_MD5 . . . 11.4.23 SESSIONS_LIST . . . . . . . 11.4.24 SESSION_DELETE . . . . . 11.4.25 SESSION_RESTORE . . . . 11.4.26 STATUS . . . . . . . . . . . 11.4.27 STOP_ATTACK . . . . . . . 11.4.28 STOP_WHOLE_TEST . . . . 11.4.29 TIME . . . . . . . . . . . . . 12 Document License: CC by SA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 Introduction
1.1 About this Compendium
(by Jan-Oliver Wagner) This compendium was compiled by people involved in the OpenVAS project. The intention is to provide a comprehensive documentation for all aspects of network vulnerability scanning with OpenVAS. This ranges from instructions on how to use the OpenVAS-Client graphical user interface, run specic test methods and write NASL vulnerability tests up to details on the internal architecture of the actual scan server software. This compendium is permanently being improved and extended. You may nd some sections not comprehensive enough and you may miss some topics entirely. Further authors are welcome and if you identify important aspects that need to be added here, please coordinate with the OpenVAS team if you plan to get an author for this compendium. It is important that you coordinate before starting to write to avoid concurrent works on the same subject.
A A The source format of this document is LTEXwith HyperLTEXextensions for HTML output. The sources are available as module openvas-compendium at the OpenVAS development platform1 .
http://wald.intevation.org/projects/openvas
10
As one of the rst tasks of planning security audits based on OpenVAS, you should compare your targets with the coverage of the currently available OpenVAS vulnerability tests. Please be aware that the OpenVAS server releases (actually the releases of its module openvas-plugins) delivers a base set of tests. The update cycle of this base set is quite long compared to the occurrence of new vulnerabilities and respective NVTs. New or changed tests are promptly distributed via so-called feed services. If you want to test your network against the latest threats, a successful outcome will depend on the quality of the feed service(s) you subscribed to. Although the set of tests provided by openvas-plugins will detect a large range of older, well-known vulnerabilities, it will most probably be outdated by the time you use it and will not be able to detect the most recent vulnerabilities. In order to stay up-to-date with the latest security threats, you will need a feed service that provides you with the most recent tests for these threats. The OpenVAS project maintains a feed of its own: http://www.openvas.org/openvas-nvt-feed.html To evaluate your need for an up-to-date feed service, you should think about the following questions: To what extent do the available feeds and their maintained families cover my audit target? In case you are planning a permanent auditing solution and not just a single shot: How sustainable is the feed service organized? Does the feed deliver signatures on the NVTs with a trust level for quality you are comfortable with?
11
12
3.1.2 Gentoo
OpenVAS packages for Gentoo are available in the Gentoo portage. Please refer to the Gentoo documentation and the OpenVAS website for information on installing these packages.
13
14
3.1.4 FreeBSD
The FreeBSD Ports and Packages Collection provides ports and packages for all OpenVAS modules. The following commands can be used to compile and install the FreeBSD ports on your FreeBSD system:
cd cd cd cd
/usr/ports/security/openvas-libraries/ && make install clean /usr/ports/security/openvas-libnasl/ && make install clean /usr/ports/security/openvas-server/ && make install clean /usr/ports/security/openvas-plugins/ && make install clean
If you would rather use binary packages, you will want to use the following commands: pkg_add pkg_add pkg_add pkg_add -r -r -r -r openvas-libraries openvas-libnasl openvas-server openvas-plugins
15
3.2.2 Most current state of development (directly from the source code management system)
You need subversion to retrieve the code:
$ svn checkout https://svn.wald.intevation.org/svn/openvas/trunk/openvas-libraries $ svn checkout https://svn.wald.intevation.org/svn/openvas/trunk/openvas-libnasl $ svn checkout https://svn.wald.intevation.org/svn/openvas/trunk/openvas-server $ svn checkout https://svn.wald.intevation.org/svn/openvas/trunk/openvas-plugins
Now read the le INSTALL_README inside the directory openvas-libraries for the next steps. Repeat for each module and read the corresponding INSTALL or README les. Although the OpenVAS team is committed to maintaining a high code quality, please be aware that you are using a development state that may be incomplete and unstable and should not be used in production environments.
16
Restricted access rights can be useful to prevent users from scanning arbitrary hosts or networks. You can specify rules that restrict an user to certain hosts or subnets or even prevent him from scanning any host but his own. The correct syntax for user rules is: accept|deny ip/mask and default accept|deny Where mask is the CIDR netmask of the rule. The default statement must be the last rule and denes the policy for the user. The following rule set will allow the user to test 192.168.1.0/24, 192.168.3.0/24 and 172.22.0.0/16, but nothing else: accept 192.168.1.0/24 accept 192.168.3.0/24 accept 172.22.0.0/16 default deny The following rule set will allow the user to test whatever he wants, except the network 192.168.1.0/24: deny 192.168.1.0/24 default accept The keyword client_ip is replaced at runtime by the IP address of the user. If you want to restrict the user to be able to scan only the system he is connecting from, you can use the following ruleset: accept client_ip default deny
17
logle The le used to log activity. If this value is set to syslog, OpenVAS-Server will use syslogd for logging. (default value: /var/log/openvas/openvasd.messages) log_whole_attack This setting controls how detailed the log should be. If this option is set to no, only the start and end time of the scan is logged. If set to yes, OpenVAS-Server will log more information, including the time each plugin took to execute. Be aware that this may cause OpenVAS-Server to use more hard disk space and to access the hard disk more often during the scan. (default value: no) log_plugins_name_at_load This setting controls whether the names of the plugins that are loaded by the server should be logged. (default value: no) dumple This option congures the name of the le that should be used for debugging output. If this option is set to -, debugging output will be written to stdout. (default value: /var/log/openvas/openvasd.dump) rules The lename for the server rules le. (default value: /etc/openvas/openvasd.rules) users The lename for the user database. (default value: /etc/openvas/openvasd.users) cgi_path The default CGI paths to check, separated by colons(:). (default value: /cgi-bin:/scripts) port_range The range of ports that will be scanned by the port scanners. If this setting is set to default, OpenVAS-Server will scan the ports specied in the le found at /var/lib/openvas/openvas-services. (default value: default) optimize_test Security tests may request to be launched if and only if certain information gathered by other tests exists in the knowledge base, or if and only if a given port is open. If this option is set to yes, it will speed up the test, but may cause the OpenVAS server to miss some vulnerabilities. (default value: yes) language The language to use in plugin description. Currently the values english and french are supported. (default value: english) checks_read_timeout The read timeout (in seconds) for the sockets used while scanning. (default value: 5) non_simult_ports This option can be used to specify a list of ports or services against which plugins should not be run simultaneously. (default value: 139, 445) plugins_timeout The maximum lifetime of a plugin (in seconds). (default value: 320) safe_checks Some security checks may harm the target server, by disabling the remote service temporarily or until a reboot. If this option is set to yes, the OpenVAS server will rely on banners instead of actually performing a security check. This will result in a less reliable report, but is less likely to disrupt functionality on the target system during a test. (default value: yes)
18
auto_enable_dependencies If this option is set to yes, OpenVAS-Server will automatically enable plugins which are needed by the plugins selected by the user. (default value: yes) silent_dependencies If this option is set to yes, output from plugins which were enabled automatically will not be send to the client. (default value: yes) use_mac_addr Designate hosts by MAC address, not IP address; this can be useful in DHCP networks. (default value: no) save_knowledge_base This option controls whether the knowledge base created during the scan should be saved to disk. (default value: no) kb_restore This setting controls whether the knowledge base should be restored for each test. (default value: no) only_test_hosts_whose_kb_we_dont_have If this option is set to yes, OpenVAS-Server will only test the hosts that are not yet in the knowledge base. This can be used to scan new hosts once if they appear in a subnet for the rst time, for example. (default value: no) only_test_hosts_whose_kb_we_have If this option is set to yes, OpenVAS-Server will only test the hosts that are already in the knowledge base. This is useful for scanning only a set of host that are already known to the server. (default value: no) kb_dont_replay_scanners If this option is set to yes and the option kb_restore has been enabled, scanner plugins will not be launched if they have already been launched in the past. (default value: no) kb_dont_replay_info_gathering If this option is set to yes and the option kb_restore has been enabled, information gathering plugins will not be launched if they have already been launched in the past. (default value: no) kb_dont_replay_attacks If this option is set to yes and the option kb_restore has been enabled, attack plugins will not be launched if they have already been launched in the past. (default value: no) kb_dont_replay_denials If this option is set to yes and the option kb_restore has been enable, denial of service plugins will not be launched if they have already been launched in the past. (default value: no) kb_max_age This option sets the maximum age of the knowledge base (in seconds). (default value: 864000) slice_network_addresses If this option is set to yes, OpenVAS will not scan a network sequentially (10.0.0.1, 10.0.0.2, 10.0.0.3), but will attempt to slice the workload throughout the whole network (i.e.: 10.0.0.1, 10.0.0.127, 10.0.0.2, 10.0.0.128). (default value: no)
19
nasl_no_signature_check If this option is set to yes, OpenVAS-Server will not check the signatures of the NASL scripts and will run scripts even if they have no or no valid signature. Be aware that setting this option to yes does pose a security risk. However, at the current stage of OpenVAS development, signatures are not yet included in the openvas-plugins releases available from the OpenVAS website. If this option is set to no, you will only be able to use a very limited number of plugins until you have synchronized your plugin collection with an NVT Feed Service providing signatures. For this reason, this option will default to yes until signatures are included with all plugins. (default value: yes)
3.4.1 Prerequisites
Apart from openvas-plugins (version 0.9.1 or higher), which contains the openvas-nvt-sync script, you need to have the standard rsync and md5sum tools available on the system where your OpenVAS server instance is running. If you installed OpenVAS from a binary package, the package management of your distribution should have taken care to meet these dependencies already.
20
# kill -1 PID
Where PID is the process ID of the main openvasd. You may see in the openvas-nvt-sync script how this should work ideally, but currently it does not work. You might consider using the killall openvasd command if you really know what this means.
21
certicate whether a certain key was used to create the signature. Such a key and certicate do always form a pair that relates them to each other. If the signed le has been modied by a third party, the signature will be broken. In this case you should not trust the le. If the signature is not broken, the question remains if you trust the owner of the key. If you decided to do so (and there any many ways and supporting technologies to manage this), you can accept the le as trustworthy. In other words, the checksum ensures the integrity of the le and will change if the le was changed between the NVT feed server and your system. The signature on the other hand indicates the authenticity of the le by signing the checksum, the manager of the Feed Service signies that the le available from the feed server has been tested and is authentic. This way you can verify that the le in your possession is indeed the same le that was tested by the feed manager. It is your responsibility to verify that the manager of the Feed Service is indeed the person he or she claims to be and to make sure the tests performed by this person are sufcient for you.
22
If any of the signatures does not meet all of these criteria, that le is considered untrustworthy and will not be executed at all. If all signatures meet the criteria, the script is trusted fully and may execute all functions. If no signature le exists, the script is not executed at all. Again, please note the difference to Nessus: For Nessus signatures, three levels were distinguished: no signature, a bad signature and a good signature. Plugins with no signature were still executed, but in a restricted mode where no functions that were regarded critical could be executed. OpenVAS explicitly only distinguishes between fully trusted and untrusted les.
This needs to be done only once for an OpenVAS-Server installation. For OpenVAS to trust a signature, the key used to create the signature has to be valid. A certicate corresponding to this key that was just imported has an unknown validity and thus is considered not valid. In order to trust a certicate for your purpose, you have to sign it. The recommended way is to use local signatures that remain only in the keyring of your OpenVAS Server installation. To sign a certicate you need to know its KEY_ID. You can get it either from the OpenVAS website or via a list-keys command. Then you can locally sign:
Before signing you should be absolutely sure that you are signing correct certicate. You may use its ngerprint and other methods to convince yourself.
23
24
25
26
27
28
5.1.2 Gentoo
OpenVAS-Client packages for Gentoo are available in the Gentoo portage. Please refer to the Gentoo documentation and the OpenVAS website for information on installing these packages.
29
30
5.1.5 FreeBSD
The FreeBSD Ports and Packages Collection provides ports and packages for OpenVAS-Client. The following commands can be used to compile and install the FreeBSD port on your FreeBSD system: cd /usr/ports/security/openvas-client/ && make install clean If you would rather use the binary package, you will want to use the following commands: pkg_add -r openvas-client
5.2.2 Most current state of development (directly from the source code management system)
You need subversion to retrieve the code: $ svn checkout https://svn.wald.intevation.org/svn/openvas/trunk/openvas-client Change to the new directory and follow the instructions of the README le. Although the OpenVAS team is committed to maintaining a high code quality, please be aware that you are using a development state that may be incomplete and unstable and should not be used in production environments.
6 Using OpenVAS-Client
(by Jan-Oliver Wagner) This section describes the basic components of OpenVAS-Client and how to use them for day-to-day use as well as more specic features that might be of interest for advanced users. This documentation assumes OpenVAS-Client in version 2.0-beta1. Newer version might offer additional or changed functionality. In this case, please refer to the OpenVAS website for information or support.
When you rst start OpenVAS-Client, you will see only one entry in the list: Global Settings. These settings you see on the rst start-up are the default settings shipped with OpenVAS-Client. They do not cover a specic selection of plugins since a connection to an OpenVAS server is required to make a plugin selection. You can establish a connection with a server and then specify a global default plugin selection for later use.
6.1.1 Tasks
Tasks are intended to cover all activities of a major topic. A task could be Test the machines of our headquarter or Customer XYZ Inc..
31
32
A task can contain a comment that explains the task in more detail. Also any type of additional info or reminder can be entered in the comment area, e.g. when to run the next series of scans or based on which contract the scans are performed. A task has neither options nor a report. Apart from the comment, it just contains a number of scopes. Possible operations for tasks are:
New Adds a new task with the title unnamed. Rename Allows to edit the title in the treelist either by clicking on the title or by selecting the corresponding
menu item.
Remove This means the removal of all scopes associated with this task and thus the removal action prompts
for a conrmation.
6.1.2 Scopes
A scope can be seen as a sub-task. It denes a certain security scan. The title should indicate the scope of this scan, e.g. Careful scan of web server production system, Aggressive scan of web server alpha test system or All Sun workstations. Comments can also be specied for each scope and may explain the scope in more detail as well as contain any other helpful hints regarding the respective scope. The scope is associated with a full set of options for the security scan. When creating a new scope, the general settings are copied. The scan options are explained in detail in a later section. It should be noted that a connection to an OpenVAS server is established within the context of a specic scope. If a scope is connected to the server, a scan based on the settings for this scope can be executed. An icon to the right of the scope title indicates the connection status of this scope. This means a task can contain a selection of scopes that connect to different OpenVAS servers with different plugins. Next, a scope may contain a number of reports. Whenever a scope is successfully executed, the resulting report is added to its list of reports. Also, importing a report from a le or from an OpenVAS server will add the report to the currently selected scope. Please note that changes to a scope are always and only stored when executing a scan. If you make changes to a scope like a new plugin selection and leave OpenVAS-Client without running a scan, these changes will be discarded. Possible operations for scopes are:
Execute The scope conguration is stored to disk and a security scan is executed with the currently specied
options using the currently connected OpenVAS server.
New Adds a new scope entitled unnamed as part of the currently selected task. As a default the global
settings are copied. Note, that only explicitly saved global settings are taken as defaults. If you changed them inside OpenVAS-Client without saving them, they will have no effect.
Rename Allows to edit the title in the treelist either by clicking on the title or by selecting the corresponding
menu item.
33
Remove This means the removal of all associated reports and thus the removal action prompts for a conrmation.
Move to task It is possible to move a scope with all of its reports from one task to another. This menu item
has subitems which represent the other tasks. Select one of them and the scope will be moved.
Open You can load a scope le and add it to the current task with this menu command. Note that here only
the parameter sets are covered but not the reports which are represented by les of their own. So, opening and saving (see below) scopes is a method to transfer your settings to someone else or to create a copy of the current scope for yourself.
Save As Saves the current scope to a le (which is of openvasrc type). Note that only the parameter sets
are stored but not the reports. See the description of Open above for more hints.
6.1.3 Reports
A report is the result of a security scan. It contains the results of the executed plugins associated with the corresponding subnet, host, port and severity. Managed within OpenVAS-Client, additionally a comment and, if available, the scan options leading to the report, can be stored. This additional information is not contained in the plain OpenVAS report les and thus gets lost when being exported. This also means that imported reports have no comments or scan options associated. Possible operations for reports are:
Remove Deletes the report and its comments and options. The user is prompted to conrm the removal.
Import Allows to import a report from a le. The standard exchange format is NBE (les sufxed .nbe).
The le selection dialog allows to select the desired report le. An error hint will be displayed if the le format was not NBE. Else, the report is added to the currently selected scope. Neither comments nor options will be there for a report imported from a NBE le.
Export Allows to export the currently selected report either in a re-importable format (NBE) or in a format
A for further processing or presentation (XML, HTML, HTML with Pies and Graphs, LTEX, ASCII Text and PDF). It is recommended to use NBE if re-importing is planned and to use PDF for creating simple report documents that need no further editing. Use one of the others if you want to further process the report or integrate it into your own document style.
Print Selecting the Print command will create a PDF version of the current report and tries to run a PDF
viewer installed on your system. OpenVAS-Client will try a number of well-known PDF viewers; if there is a PDF viewer installed on your system and this menu item does not work, please check if the executable le for your PDF viewer is available in your system path.
34
6.2 Authentication
OpenVAS-Client needs to connect to an OpenVAS server in order to retrieve the available plugins and to actually execute a security scan. Starting with OpenVAS-Client 2.0.0, the client will display a notication whenever new NVTs are found on the server. OpenVAS-Client can handle multiple connections to different servers. Each scope has a connection of its own. Additionally, the Global Settings can be connected to an OpenVAS server to dene default plugin selections and plugin parameters. Note that only explicitly saved Global Settings are used as defaults for new scopes.
The connection status is indicated with a icon in the tasks/scopes/reports treelist next to the title of the global settings or a scope. Only scopes are connected with the OpenVAS server. More information on the connection status is shown in the statusbar at the bottom of the main window. There, the connection information is displayed, e.g. Connection: [email protected]. At bottom right there is an icon indicating the connection status. The connection dialog allows to specify the following settings for establishing a connection to an OpenVAS server:
Host The hostname or IP address of the server where an OpenVAS server is running. Port The port where the OpenVAS Server waits for connections. Older versions of the OpenVAS server up
to and including version 2.0.0 used port 1241 as the default port. The default port used for communication via the OpenVAS Transfer Protocol (OTP) by more recent versions is 9390. You can reset this option to the default port using the default button.
Login Your username on the selected OpenVAS server. To use an OpenVAS server you have to have an
account on the OpenVAS server. Please contact the administrator of the server if you need an account.
35
Authentication by Certicate: If you use this method you have to have a key/certicate pair created for
you. This is usually done by the administrator of OpenVAS server using the available scripts. The administrator will give you the two les you need to specify (User Certicate File and User Key File). The administrator may create a key without a password or with a password. If you have a password for the User Key File you must enter the password in the corresponding text eld when connecting to the OpenVAS server.
Trusted CA: This certicate denes a certicate authority (CA) you trust. With this certicate you will be
able to check that you are connecting to a trusted OpenVAS server. This is checked if you have the Paranoia Level set to 2 or 3 and is is not checked with a Paranoia Level of 1. Note that you can set the Paranoia Level by hand in the openvasrc les or when rst connecting to an OpenVAS server where you are asked explicitly. The default path for the Trusted CA is the lename used by the OpenVAS server itself. Thus, if you are running OpenVAS-Client on the same machine or have the same volume mounted, you can just use the default. If you are running OpenVAS-Client from a remote machine, you need to have a copy of the CA certicate and set the location of the certicate le manually.
6.3.1 General
This page covers all the general scan options. See the screenshot for the main window in section 6.1.
Port range Ports that will be scanned by the OpenVAS server. You can enter single ports, such as 1-8000
or more complex sets, such as 21,23,25,1024-2048,6000. Put -1 for no portscan, or put default to scan the default ports in the OpenVAS services le.
Consider unscanned ports as closed To save scanning time, you may ask the OpenVAS server to
declare TCP ports it did not scan as closed. This will result in an incomplete audit but it will reduce scanning time and prevent the OpenVAS server from sending packets to ports you did not specify. If this option is disabled, the OpenVAS server will consider ports whose state it does not know as open. Be aware that enabling this option might cause you to miss vulnerabilities in services that available on other ports than the ones you have scanned.
Number of hosts to test at the same time Maximal number of hosts that the OpenVAS server will
test at the same time. Be aware that the OpenVAS server will spawn max_hosts x max_checks processes!
Number of checks to perform at the same time Maximal number of security checks that will
be launched at the same time against each host. Be aware that the OpenVAS server will spawn max_hosts x max_checks processes!
Path to CGIs It is possible to check for the presence of CGIs in multiple paths like /cgi-bin, /cgis,
/home-cgis and so on. In that case, put all your paths here separated by colons. For instance: /cgi-bin:/cgiaws:/cgi.
36
Do a reverse lookup of the IP before testing it If this option is set, the OpenVAS server will do a reverse lookup on the IP addresses before it tests them. This may slow down the whole test. Optimize the test Security tests may ask the OpenVAS server to be launched if and only if some information gathered by other tests exists in the knowledge base, or if and only if a given port is open. This option speeds up the test, but may cause the OpenVAS server to miss some vulnerabilities. If you are paranoid, disable this option.
Safe checks Some security checks may harm the target server, by disabling the remote service temporarily
or until a reboot. If you enable this option, the OpenVAS server will rely on banners instead of actually performing a security check. You will obtain a less reliable report, but you are less likely to disrupt functionality on the target system by doing a test. From a security point of view, we recommend you disable this option; from a system administrator point of view, we recommend you enable it.
Designate hosts by their MAC address If you enable this option, the hosts on the local network will be designated by their ethernet MAC address instead of their IP address. This is especially useful if you are using the OpenVAS server in a DHCP network. If unsure, disable this option. Port Scanner This is the list of available port scanners. Port scanners are a special category of plugins and
therefore presented separately from the other plugins. The list is only available if a connection to an OpenVAS server has been established. You can activate one or more of the scanners. Clicking on an entry shows the details for the respective scanner plugin.
6.3.2 Plugins
The plugins are stored on the OpenVAS server. Thus, to make a selection of the plugins to apply you need to connect to a server. Otherwise this page will remain empty. The Plugins are separated into a number of families which can be activated or deactivated as a whole by checking the box to the right of family name. Also, a family can be expanded to show all of its member plugins where
37
you can rene the selection by activating or deactivating single plugins using the checkbox to the right of the plugin name. The column Warning contains a warning sign for some plugins. The warning sign means that this plugin may harm the target host by disabling the attacked service or by crashing the host. You should be careful when you enable it since it may disrupt functionality on the target server. Below the plugin list the total number of plugins loaded from the server is shown, together with the total number of currently selected plugin as well as the number of plugins shown due to an applied lter. The following actions are possible:
Enable all Enables all plugins. Disable all Disables all plugins. Expand all Expands the plugin tree-list to maximum so that the list contains all plugins. Collapse all Only show the plugin families. Enable dependencies at runtime If you enable this option, the OpenVAS server will automatically enable the plugins needed by the set of plugins you selected. Silent dependencies If you enable this option, the OpenVAS server will not report data coming from
the plugins that you did not specically enable.
Filter The lter dialog lets you select plugins with the characteristics you want. Note that you will erase your previous selection by applying a lter. Automatically enable new plugins Since version 2.0 of OpenVAS-Client the user may choose whether
new plugins should be enabled by default. Directly after fetching any new plugins, a notication will be displayed, showing how many new plugins were found and whether they have been en- or disabled. Earlier versions do automatically enable new plugins and do not show this notication.
Plugin information dialog Double-clicking on a specic plugin title will raise an information dialog
for the respective plugin. The values shown are the ones specied within the corresponding plugin, like its description, copyright information. The following actions are possible in this dialog:
Set plugin timeout Allows you to specify a timeout for the plugin. Show dependencies This lists the dependencies for the selected plugin. It also provides information on
whether the dependencies are currently enabled or disabled.
38
Certicate information Since OpenVAS-Client 2.0.0beta2 (which needs a server version 2.0.0beta2 or newer) the servers certicates can be viewed from within the client. If the plugin that is currently displayed in the plugin information dialog has one or more signatures, the names of and trust relation the signer(s) will be displayed. Next to name and trust level is a button that allows to see the signers certicate.
6.3.3 Credentials
Some of the plugins allow to enter credentials to test certain applications, for example Samba or websites (HTTP). These plugins work the same way as the plugins listed in the Plugin Preferences list. For better handling they are collected under Credentials.
39
Target(s) The rst host(s) that will be attacked by the OpenVAS server. The options below allow you to
extend the test to a larger set of targets. You may dene several targets by separating them with a comma (,). i.e. : host1,host2. A special syntax is le:/some/where/targetlist.txt which means that the actual target names are loaded from that list.
Read from le A textle can be specied that contains the list of targets. This textle may contain commaseparated lists of host and also may contain many of such lines.
Perform a DNS Zone transfer The OpenVAS server will perform an AXFR request (that is, a zone
transfer) to the target name server and will attempt to obtain the list of the hosts in the target domain. Then, it will test each host.
40
The rst two rulesets are sent by the server only to inform the client about possible restrictions and cannot be changed by the client. Only the last ruleset can be changed by the client.
A rule consists of an action and a target. To add a rule to the clientside user rules, select the appropriate action from the drop-down menu, enter the the IP of the target or a netmask and press the Add rule button. You can remove clientside user rules by selecting the rule and pressing the Remove rule button. For more information about rules and the ruleset syntax, please refer to section 3.3.2 which explains the denition of serverside rules.
41
Enable KB saving If you want the server to save the KB after the scan is done, you have to enable this option. Test all hosts If this option is set, the server will not use the KB to determine which hosts should be scanned, but will rather scan all hosts supplied. Only test hosts that have been tested in the past If KB saving is enabled, there is one KB saved on the server for every host the server has scanned in the past. This can be used to restrict the server to scan only hosts that have been scanned before. This might be useful if you want to keep an eye on a certain set of machines and their conguration. Be aware that this setting might cause you to miss new hosts on the network since the server will not scan them. Only test hosts that have never been tested in the past Another way of using the existence of KBs is to exclude all hosts that have already been scanned. This way a scan will automatically discover hosts that have been added to the network since the last scan. Be aware that this setting cause hosts to be scanned only once (the rst time they appear on the network), meaning you will not discover security issues that have recently developed or are only detected by new NVTs. Reuse the knowledge bases about the hosts for the tests This setting controls if the server should restore the KB that was saved for this host during the last scan. The default behavior is to create a new KB every time a host is scanned and to replace an existing KB with the new results. Do not execute scanners that have already been executed If the server has been instructed to reuse the existing KB, this will prevent scanning plugins from running if their results have already been recorded in the KB. Do not execute info gathering plugins that have already been executed If the server has been instructed to reuse the existing KB, this will prevent information gathering plugins from running if their results have already been recorded in the KB. Do not execute attack plugins that have already been executed If the server has been instructed to reuse the existing KB, this will prevent attack plugins from running if their results have already been recorded in the KB. Do not execute DoS plugins that have already been executed If the server has been instructed to reuse the existing KB, this will prevent denial-of-service (DoS) plugins from running if their results have already been recorded in the KB. Max age of a saved KB This setting controls the maximum age of the KB (in seconds). A KB older than this value is automatically discarded.
6.4 Reports
6.4.1 Report Page of OpenVAS-Client
The report page consists of three elements. On the left hand a tree list allows you to browser via hosts, ports and severity to single reports. On top of this treelist is a selection for re-ordering the tree structure. On the right hand the text area contains the actual report text. The whole design is focused on supporting an explorative understanding of the scan results.
42
43
Order by This setting controls how the scan results are sorted in the report window. The default is to sort
the results by host rst, then by port and severity. Depending on your context, it might make more sense to choose the second option and sort the results by port rst; for example, you might be more interested in a quick overview over which hosts are running a service on a certain port than in which ports are open on a certain host.
Protocol version This setting controls which protocol the client will ask the server to use for communication between client and server. Please be aware that the server will close the connection if the client asks for an unsupported protocol.
Use plugin cache with reports Enabling this setting will make OpenVAS-Client attach all Plugin
Information to newly created scan reports. This allows to review the plugin selection and the plugin preferences for a report in the OpenVAS-Client GUI. So, this cache is for increasing transparency not performance. Again, the downside is that several megabytes of cache per report will be generated. Disable this option if you do not have sufcient storage space available. If you want to remove the caches, search for the les nessus_plugin_cache in your Nessus directory (the directory .openvas in your home directory). Simply deleting them is sufcient.
44
Load plugin cache for scopes immediately Disabling this option will cause OpenVAS-Client to
not automatically load a scopes cache when made active. You wont see the plugin selection nor the plugin preferences. So, in fact this option could remove the second effect of the above described option Cache plugin information when connecting for the benet of avoiding to load possibly huge caches once clicking on a scope entry.
6.5.4 Report
Include plugin details in PDF Enabling this setting will make OpenVAS-Client add an appendix to
each PDF Report containing the details of those plugins that produced relevant results for the report. They are linked within the PDF so that the information can easily be browsed. Be aware, however, that this could signicantly increase the size of your PDF le. On average, you can expect two plugin descriptions to consume one page.
Show script origin in report window Enabling this option will cause OpenVAS-Client to show
additional information in the report window regarding the origin of the reported security issue. If this option is enabled, these reports will contain the name and the OID of the NVT that reported the issue.
7.1.1 Prerequisites
To perform local security checks, you need a working OpenVAS-Server installation. Information on setting up and conguring OpenVAS-Server is available in chapter 3 on page 13.
Note: The comment (here: OpenVAS-Local-Security-Checks-Key) must not contain spaces. Currently, you need a rsa pkcs8 key for OpenVAS local security checks. Now, for each target system:
# adduser --disabled-password sshovas Name: OpenVAS Local Security Checks # su - sshovas $ mkdir .ssh $ cp /some/path/id_rsa_sshovas.pub .ssh/authorized_keys $ chmod 500 .ssh $ chmod 400 .ssh/authorized_keys
45
46
Note: It is actually not necessary to submit the public key, but currently this is necessary due to a bug inherited from Nessus. Next, make sure you select at least these plugins: Debian Local Security Checks/* Misc/Determine List of installed packages via SSH login Service Detection/Services Settings/Global variable settings Settings/SSH Authorization or ensure dependencies are resolved at runtime (see checkboxes) if you select only some local security checks.
47
Probably the WLSC is also compatible with other Microsoft Operating Systems. Once the SMB Port of a Windows target is accessible, the Operating System (OS) and SAMBA Version could be detected immediately and will be reported. For deeper tests the following steps are required: You need the Windows credentials for an administrative user. Usually this is the user name (Default is Administrator) and the correct password for this user. There is no default password, this has been dened before during the Windows installation process. These credentials are entered in the OpenVAS-Client GUI as SMB Credentials and are used on every host in the target list. If you plan to scan a whole Windows Domain, you can enter the Domain-Administrative user and password instead of the target host credentials. Make sure the Windows-(personal) Firewall is disabled for the OpenVAS Server host, or a correct rule for the Test-Network is entered.
Additional Note for Windows XP For Windows XP it is important that Easy Filesharing is switched
off. To disable this, the Windows Click-Path is: Windows Explorer/Tools/Folder Options/View (see screenshot below). Without this setting, smbclient is not able to retrieve les from the Windows System shares (C$,D$...).
48
8.1.1 How to use Security Local Auditing Daemon (SLAD) with OpenVAS
If you want to install SLAD on remote machines, you may want to use the sladinstaller tool which will automatically retrieve the latest SLAD release and install it on the target machine. The sladinstaller integration into OpenVAS is currently under development; up-to-date information on installing sladinstaller is available on the OpenVAS website.
chkrootkit
The chkrootkit package is a tool to locally check for signs of installed rootkits.
clamav
The clamav plugin provides a GPLed virus scanner for linux. The options include scanning with or without archive (.zip, .tar.gz, etc) scanning, and removing infected les or putting them into quarantine.
john
John the ripper is a fast password cracker. This tool is meant to nd weak user passwords, which could compromise system security. It comes with three options: Fast crack mode: In this mode, John only tries the usernames and derived words against the hashed passwords. Dictionary mode: In this mode all words from the installed dictionary are tried to attack the hashed passwords. Full crack mode: This slowest mode tries all words from the dictionary, as well as rules generated variations of these, against the users passwords The normal version of John exposes cracked passwords in clear-text. This makes John difcult to operate with in a professional environment. Therefore, SLAD uses a John the Ripper version which has been patched. In this version cracked passwords are not exposed anymore, instead only the user-accounts with crackable passwords are identied.
49
50 lsof
The Unix system utility lsof simply shows a list of les currently open on the system and which programs use them. This can assist an administrator to nd unusual activity on the system.
tiger
The tiger suite is a package to analyze the hosts security. Out of the many checks the suite can perform four groups have been created. These are: Users: The users check covers accounts, checks for mail aliases, FTP login users and the like. Permission: This selection checks users and group access permissions on device nodes, logles and other important les and directories. Cong: This script checks for weaknesses and mistakes in common system and application specic conguration les. System: The system check looks for open deleted les, processes that are waiting for incoming connections, and other unusual things. Full system check: This runs all of the above checks.
tripwire
Tripwire is an open source le integrity checker. It initially stores hashes of system les in a database for comparison on subsequent runs. Modications performed by a potential intruder can be easily spotted this way. The default installation of tripwire contains a rule set for Debian. For details on how to adapt these to a different operating system or distribution, see the SLAD 2 Developers and Administrators Guide.
Snort
Snort is a network intrusion detection and prevention system that provides real time trafc analysis and packet logging on IP networks. It is capable of detecting a large number of attacks such as buffer overows, stealth port scans, CGI attacks, SMB probes or OS ngerprinting attempts by doing both protocol analysis and content checks. Once an attack has been detected Snort is also capable of counteracting it by dropping the according connections. The SLAD plugin selects all relevant Snort messages from a MySQL Database and sends them to the management platform. To use the SLAD Snort plugin, Snort needs to be installed with MySQL support. Information on how to do this is usually provided with the Snort package for your distributions or can be found in the Snort installation itself.
LMSensors
This fetches the events from your hardware monitoring (for example someone opening the chassis of the server). The management system supports hardware sensor logging. An alert will be shown describing the physical incident on the SLAD managed server. This features is supported from the most mid-range server boards like Intel BX440 and newer.
51
Logwatch extracts events from the system log, like the syslog les present at /var/log. All important information like login users, SSH and PAM Sessions, etc. are ltered and aggregated and returned to the calling SLAD. Three different levels of detail are supported: Low Returns logle values in a low detail level and with the highest aggregation. Medium Returns logle values in a medium detail level. High Detailed logle values with the lowest aggregation level.
TrapWatch
TrapWatch is a special version of Logwatch and listens on SNMP hardware traps. The Simple Network Management Protocol (SNMP) is the most common protocol for managing all kinds of network devices and is implemented in almost all currently available network devices. An SNMP trap is a message sent out by a network device to report an incident such as loss of link, failed authentication attempts etc. TrapWatch catches these messages and puts them into the report. This can be useful to detect changes in the network, like machines being unplugged or added to the network. Support for Netscreen rewall traps, HP-Procure switches and Cisco hardware is installed out of the box. If non-standard MIBs are used, it might necessary to congure TrapWatch accordingly. Please note that to enable TrapWatch, you need to install an SNMP trap handler that puts the TRAP results into your syslog le.
8.2 Nikto
(by Michael Wiegand) Nikto is an Open Source (GPL) web server scanner which performs comprehensive tests against web servers for multiple items, including over 3500 potentially dangerous les/CGIs, versions on over 900 servers, and version specic problems on over 250 servers. Scan items and plugins are frequently updated and can be automatically updated (if desired). OpenVAS is able to recognize an installed version of Nikto and can integrate the results of a Nikto scan in the scan results.
8.2.1 Prerequisites
In order to be able to perform a Nikto scan from within OpenVAS, the following requirements must be met: There has to be a version of Nikto that can be found in the system path. The OpenVAS integration of Nikto is optimized for Nikto versions >= 2.0, but will probably work with older versions as well. The OpenVAS plugin for Nikto integration (nikto.nasl) needs to be present and enabled. You can nd the plugin in the section CGI abuses in the plugin section of your client.
52
53
Note that a large number of tests will return unknown until extended OVAL support in OpenVAS has been established. The results of the OVAL denitions will be shown in the same way as the results for other plugins, allowing you to assess the results conveniently from within OpenVAS-Client.
You can nd more information about the OVAL project and the OVAL language at http://oval.mitre.org/. The project page for ovaldi can be found at http://sourceforge.net/projects/ovaldi/.
54
55
56
script_description(english:desc["english"]); summary["english"] = "Check for vulnerability in Foo Bar 2.5"; script_summary(english:summary["english"]); script_copyright(english:"This script is under GPLv2+"); ... exit(0); } ... The plugin description has to be contained in the if (description) block so the OpenVAS server can retrieve it. The rst time the server encounters a new plugin, it will be called with the global variable description set to TRUE. The information provided by the plugin will be cached in the .desc subdirectory in the plugins directory. When the script is called during a scan, it will be called with description set to FALSE. For a complete list of NASL commands that can be used in the script description, please refer to the section 9.3 of the NASL API documentation.
57
58
= >= >< >!< = ! == != > >= < <= ! && || ~ & | ^ << >> >>>
Operator Precedence
59
FTP Operations
ftp_log_in() ftp_get_pasv_port()
HTTP Operations
is_cgi_installed() http_get() http_head() http_post() cgibin() http_delete() http_close_socket() http_open_socket() http_recv_headers() http_put()
60 Packet Manipulation
forge_ip_packet() get_ip_element() set_ip_elements() dump_ip_packet() forge_tcp_packet() set_tcp_elements() send_packet() pcap_next() get_tcp_element() forge_udp_packet() set_udp_elements() get_udp_elements() forge_icmp_packet() get_icmp_element() set_icmp_elements() forge_igmp_packet() dump_tcp_packet() dump_udp_packet()
Utilities
this_host() get_host_name() get_host_ip() get_host_open_port() get_port_state() telnet_init() tcp_ping() getrpcport()
61
Knowledge Base
get_kb_item() set_kb_item() get_kb_list() replace_kb_item() replace_or_set_kb_item()
62 Plugin Description
script_id() script_oid() (by Tim Brown)
This function is intended to replace script_id, the current method of uniquely identifying NASL scripts. The logic behind this is that script_id has only a single global namespace. With plans by several organisations to develop and contribute plugin feeds it was deemed necessary to introduce a new namespace that could be shared between each organisation. The current proposed implementation of this function is as follows. Any plugin that contains a script_id call will automatically be given an OID from the namespace allocated for legacy plugins. Moreover script_oid can only be used on plugins that do not have a script_id set. The OID namespace for legacy plugins has the prex 1.3.6.1.4.1.25623.1.0. The OpenVAS OID namespace is currently administered by Tim Brown. Both the client and server as well as the libraries on which they depend are being updated to support this functionality. You can detect if it is supported by checking OPENVAS_NASL_LEVEL is greater than 2206. script_oid should be called like so: ... if(description) { if (OPENVAS_NASL_LEVEL >= 2206) { script_oid("1.3.6.1.4.1.25623.1.0.90010"); } else { script_id(90010); } ... script_version() script_name() script_description() script_summary() script_category() script_copyright() script_family() script_dependencies() script_cve_id() script_require_ports() script_require_keys() script_exclude_keys() scanner_status()
63
Report Functions
security_warning() security_hole() security_info() security_note() log_message() debug_message()
Crypto Functions
HMAC_DSS() HMAC_MD2() HMAC_MD4() HMAC_MD5() HMAC_RIPEMD160() HMAC_SHA() HMAC_SHA1() MD2() MD4() MD5() RIPEMD160() SHA() SHA1()
64 Miscellaneous Functions
cvsdate2unixtime() defined_func() dump_ctxt() func_has_arg() func_named_args() func_unnamed_args() gettimeofday() isnull() localtime() max_index() mktime() safe_checks() sleep() type_of() usleep() unixtime() make_list() make_array() get_preference()
Unsafe Functions
NB: Under Nessus, these functions were considered unsafe since they access the le system and were only available to a special selection of trusted plugins. Since OpenVAS takes a different approach and will not permit untrusted plugins to run alongside trusted plugins, these functions are available to all plugins. Classifying these functions as unsafe is done purely for legacy reasons. Nevertheless, developers should be aware that these functions could potentially harm the system which is running OpenVAS and are expected to take extra care when using these functions. find_in_path() file_close() file_open() file_read() file_seek() file_stat() file_write() fread() fwrite() get_tmp_dir() unlink() pread()
65
66
smbcl_func.inc bin_dword(), bin_word(), leread(), GetPEFileVersion (), GetPEProductVersion (), get_windir(), is_domain(), PEVersion(), smbclientavail(), smbgetdir(), smbgetle(), smbversion()
smb_hotxes.inc hotx_check_dhcpserver_installed(), hotx_check_domain_controler(), hotx_check_excel_version(), hotx_check_exchange_installed(), hotx_check_iis_installed(), hotx_check_nt_server(), hotx_check_ofce_version(), hotx_check_outlook_version(), hotx_check_powerpoint_version(), hotx_check_sp(), hotx_check_wins_installed(), hotx_check_word_version(), hotx_check_works_installed(), hotx_data_access_version(), hotx_get_commonlesdir() hotx_get_programlesdir(), hotx_get_systemroot(), hotx_missing() smtp_func.inc get_smtp_banner(), smtp_close(), smtp_from_header(), smtp_open(), smtp_recv_banner(), smtp_recv_line(), smtp_send_port(), smtp_send_socket(), smtp_to_header()
ssh_func.inc base64decode(), check_pattern(), crypt(), decrypt(), derive_keys(), dh_gen_key(), dh_valid_key(), get_data_size(), get_ssh_banner(), get_ssh_error(), get_ssh_server_version(), get_ssh_supported_authentication(), getstring(), init(), is_sshd_bugged(), kb_ssh_login(), kb_ssh_passphrase(), kb_ssh_password(), kb_ssh_privatekey(), kb_ssh_publickey(), kb_ssh_transport(), kex_packet(), load_array_from_kb(), load_data_from_kb(), load_intarray_from_k load_int_from_kb(), mac_compute(), ntol(), packet_payload(), putbignum(), putstring(), raw_int32(), raw_int8(), recv_ssh_packet(), register_array_in_kb(), register_data_in_kb(), register_intarray_in_kb(), register_int_in_kb(), reuse_connection_init(), send_ssh_packet(), set_ssh_error(), ssh_close_channel(), ssh_close_connection(), ssh_cmd(), ssh_cmd_error(), ssh_dss_verify(), ssh_exchange_identication(), ssh_hex2raw(), ssh_kex2(), ssh_login(), ssh_login_or_reuse_connection(), ssh_open_channel(), ssh_recv(), ssh_reuse_connection(), ssh_rsa_verify(), ssh_userauth2(), update_window_size() telnet_func.inc get_telnet_banner(), set_telnet_banner() tftp.inc tftp_get(), tftp_put() ubuntu.inc deb_str_cmp(), ubuntu_check(), ubuntu_ver_cmp() uddi.inc create_uddi_xml () version_func.inc nd_bin(), get_bin_version(), get_string_version(), version_is_equal(), version_is_greater(), version_is_greater_equal(), version_is_less(), version_is_less_equal(), version_test()
67
Host/dead (3com_nbx_voip_netset_detection.nasl, blackice_dos.nasl, dont_scan_printers.nasl, ftp_w98_devname_dos.nasl, fw1_udp_DoS.nasl, http_w98_devname_dos.nasl, jolt2.nasl, jolt.nasl, labrea.nasl, linux_icmp_sctp_DoS.nasl, open_all_ports_DoS.nasl, p-smash.nasl, spank.nasl, TLD_wildcard.nasl, vxworks_ftpdDOS.nasl): 1 = The remote host is dead Host/Debian/dpkg-l (ssh_get_info.nasl): Host/rewall (securemote_info_leak.nasl, securemote.nasl): (rewall name) The remote host is a rewall Host/full_scan (amap.nasl, netstat_portscan.nasl, nmap.nasl, snmpwalk_portscan.nasl, openvas_tcp_scanner.nes, synscan.nes):
68
Host/ident_scanned (ident_process_owner.nasl, netstat_portscan.nasl, nmap.nasl): Host/num_ports_scanned (openvas_tcp_scanner.nes, synscan.nes): Host/OS (nmap.nasl, nmap_wrapper.nes): Host/OS/ntp (ntp_open.nasl): Host/ping_failed (nmap.nasl, nmap_wrapper.nes): Host/processor/ntp (ntp_open.nasl): Host/protocol_scanned (ip_protocol_scan.nasl): Host/scanned (amap.nasl, netstat_portscan.nasl, nmap.nasl, snmpwalk_portscan.nasl, nmap_tcp_connect.nes, nmap_wrapper.nes, synscan.nes, openvas_tcp_scanner.nes, ike-scan.nasl): 1 = The remote host has been portscanned Host/scanners/amap (amap.nasl): Host/scanners/netstat (netstat_portscan.nasl): Host/scanners/nmap (nmap.nasl): Host/scanners/openvas_tcp_scanner (openvas_tcp_scanner.nes): Host/scanners/snmpwalk (snmpwalk_portscan.nasl): Host/scanners/synscan (synscan.nes): Host/scanners/ike-scan (ike-scan.nasl): Host/tcp_reverse_lsrr (source_routed.nasl): Host/tcp_seq_idx (nmap.nasl): Host/tcp_seq (nmap.nasl, nmap_wrapper.nes): Host/udp_scanned (amap.nasl, netstat_portscan.nasl, nmap.nasl, snmpwalk_portscan.nasl, nmap_wrapper.nes): http/auth (logins.nasl): login to use when doing HTTP requests http/login (logins.nasl): http/password (logins.nasl): password to use when doing HTTP requests Hydra/cisco-enable/* (hydra_cisco_enable.nasl): Hydra/cisco/* (hydra_cisco.nasl): Hydra/cvs/* (hydra_cvs.nasl): Hydra/ftp/* (hydra_ftp.nasl): Hydra/http/* (hydra_http.nasl): Hydra/http-proxy/* (hydra_http_proxy.nasl): Hydra/icq/* (hydra_icq.nasl): Hydra/imap/* (hydra_imap.nasl): Hydra/ldap/* (hydra_ldap.nasl): Hydra/mssql/* (hydra_mssql.nasl): Hydra/nntp/* (hydra_nntp.nasl): Hydra/pcnfs/* (hydra_pcnfs.nasl): Hydra/rexec/* (hydra_rexec.nasl):
69
70
pop3/password (logins.nasl): /rip/*/broken_source_port (rip_detect.nasl): /rip/*/version (rip_detect.nasl): Secret/hydra/logins_le (hydra_options.nasl): Secret/hydra/passwords_le (hydra_options.nasl): Secret/SSH/login (ssh_authorization.nasl): Secret/SSH/passphrase (ssh_authorization.nasl): Secret/SSH/password (ssh_authorization.nasl): Secret/SSH/privatekey (ssh_authorization.nasl): Secret/SSH/publickey (ssh_authorization.nasl):
Services/data_protector/build (hp_data_protector_installed.nasl): Services/data_protector/version (hp_data_protector_installed.nasl): Services/three_digits (nd_service.nes): Services/unknown (nd_service.nes): Port of unknown service(s) Services/wrapped (nd_service.nes): Services/www/*/broken (http_func.inc, no404.nasl):
Services/www/*/embedded (3com_nbx_voip_netset_detection.nasl, ciscoworks_detect.nasl, clearswift_mimesweeper_smtp_ cobalt_web_admin_server.nasl, DDI_Cabletron_Web_View.nasl, DDI_F5_Default_Support.nasl, embedded_web_server_detect.nasl, imss_detect.nasl, interspect_detect.nasl, intrushield_console_detect.nasl, iwss_detect.nasl, linksys_multiple_vulns.nasl, raptor_detect.nasl, securenet_provider_detect.nasl, sitescope_management_s sun_cobalt_adaptive_rewall_detect.nasl, tmcm_detect.nasl, websense_detect.nasl, xedus_detect.nasl): Services/www/*/kerio_wrf (kerio_wrf_management_detection.nasl): Services/www/*/working (http_func.inc): Settings/disable_cgi_scanning (global_settings.nasl): Settings/ExperimentalScripts (global_settings.nasl): Settings/ThoroughTests (global_settings.nasl): sip/banner/5060 (sip_detection.nasl): SMB/domain_lled/0 (smb_authorization.nasl): SMB/DOMAIN (smbcl_func.inc): SMB/dont_send_in_cleartext (logins.nasl): SMB/dont_send_ntlmv1 (logins.nasl): SMB/ERROR (smbcl_func.inc): SMB/FILEVERSION/* (smbcl_func.inc): SMB/login_lled/0 (smb_authorization.nasl): SMB/name (netbios_name_get.nasl): NetBIOS name of the remote host SMB/OS (smbcl_func.inc): SMB/password_lled/0 (smb_authorization.nasl):
71
SMTP/microsoft_esmtp_5 (smtpscan.nasl, smtpserver_detect.nasl): 1 = The remote SMTP server is MS SMTP 5 smtp/*/broken (check_smtp_helo.nasl): smtp/*/denied (check_smtp_helo.nasl): smtp/*/helo (check_smtp_helo.nasl): smtp/*/real_banner (smtpscan.nasl): smtp/*/temp_denied (check_smtp_helo.nasl): SMTP/postx (smtpscan.nasl, smtpserver_detect.nasl): 1 = The remote SMTP server is Postx SMTP/postofce (smtpscan.nasl): SMTP/qmail (smtpscan.nasl, smtpserver_detect.nasl): 1 = The remote SMTP server is qmail SMTP/sendmail (smtpscan.nasl): 1 = The remote SMTP server is Sendmail SMTP/sendmail (smtpserver_detect.nasl): 1 = The remote SMTP server is Sendmail SMTP/snubby (smtpserver_detect.nasl): SMTP/wrapped (check_smtp_helo.nasl): 1 = The remote sendmail is wrapped SMTP/wrapped (smtpserver_detect.nasl): 1 = The remote sendmail is wrapped SMTP/xmail (smtpscan.nasl, smtpserver_detect.nasl): SMTP/zmailer (smtpserver_detect.nasl): SNMP/community (snmp_default_communities.nasl): Name of a valid SNMP community SNMP/port (snmp_default_communities.nasl): SNMP/running (snmp_detect.nasl): socks/*/auth/* (socks.nasl): SSH/banner/* (ssh_detect.nasl):
72
ssh/login/freebsdpatchlevel (gather-package-list.nasl): ssh/login/freebsdpkg (gather-package-list.nasl): ssh/login/freebsdrel (gather-package-list.nasl): ssh/login/gentoo (gather-package-list.nasl): ssh/login/packages (gather-package-list.nasl): ssh/login/pkg (gather-package-list.nasl): ssh/login/release (gather-package-list.nasl): ssh/login/rpms (gather-package-list.nasl): ssh/login/slackpack (gather-package-list.nasl):
ssh/login/solosversion (gather-package-list.nasl): Solaris OS version as reported by uname -r ssh/login/solhardwaretype (gather-package-list.nasl): Solaris hardware type as reported by uname -p ssh/login/solpackages (gather-package-list.nasl): Solaris packages as repored by pkginfo ssh/login/solpatches (gather-package-list.nasl): Solaris patches as reported by showrev -p ssh/login/uname (gather-package-list.nasl, ssh_get_info.nasl): SSH/supportedauth/* (ssh_detect.nasl): SSH/textbanner/* (ssh_detect.nasl): TCPScanner/NbPasses (openvas_tcp_scanner.nes): TCPScanner/OpenPortsNb (openvas_tcp_scanner.nes): TCPScanner/ClosedPortsNb (openvas_tcp_scanner.nes): TCPScanner/FilteredPortsNb (openvas_tcp_scanner.nes): TCPScanner/RSTRateLimit (openvas_tcp_scanner.nes): tftp/get_le (tftp_grab_le.nes): tftp/backdoor (tftpd_backdoor.nasl): tftp/*/backdoor (tftpd_backdoor.nasl): tftp/*/lecontent/* (tftpd_dir_trav.nasl): tftp/*/lename/* (tftpd_dir_trav.nasl): tftp/*/get_le (tftpd_dir_trav.nasl): tftp/*/overow (tftpd_overow.nasl): tftp/*/smalloverow (tftpd_small_overow.nasl): /tmp/cgibin (DDI_Directory_Scanner.nasl): /tmp/http/auth/* (http_login.nasl): /tmp/hydra/empty_password (hydra_options.nasl): /tmp/hydra/exit_ASAP (hydra_options.nasl): /tmp/hydra/login_password (hydra_options.nasl): /tmp/hydra/tasks (hydra_options.nasl): /tmp/hydra/timeout (hydra_options.nasl):
73
74
www/goahead (http_version.nasl): www/hmap/*/banner_ok (www_ngerprinting_hmap.nasl):
www/hmap/*/banner_regex (www_ngerprinting_hmap.nasl): www/hmap/*/description (www_ngerprinting_hmap.nasl): www/hmap/*/raw_signature (www_ngerprinting_hmap.nasl): www/hmap/*/signature (www_ngerprinting_hmap.nasl): www/ibm-http (http_version.nasl): www/ideawebserver (http_version.nasl): www/iis (http_version.nasl): www/iplanet (http_version.nasl): www/ipswitch-imail (http_version.nasl): www/jetty (http_version.nasl): www/jigsaw (http_version.nasl): www/KFWebServer (http_version.nasl): www/linuxconf (http_version.nasl): www/miniserv (http_version.nasl): www/multiple_get/* (www_multiple_get.nasl): www/ncsa (http_version.nasl): www/netcache (http_version.nasl): www/netscape-commerce (http_version.nasl): www/netscape-fasttrack (http_version.nasl): www/netware (http_version.nasl): www/novell (http_version.nasl): www/omnihttpd (http_version.nasl): www/OracleApache (http_version.nasl): www/oracle-web-listener (http_version.nasl): www/pi3web (http_version.nasl): www/*/generic_xss (cross_site_scripting.nasl): www/*/punBB (punBB_detect.nasl): www/*/vBulletin (vbulletin_detect.nasl): www/*/webmin (webmin.nasl): www/real_banner/* (http_version.nasl): www/resin (http_version.nasl): www/roxen (http_version.nasl): www/sambar (http_version.nasl): www/savant (http_version.nasl):
75
76
The debug output will be written into the debug-lvt.txt le, which in this example will look like this:
[...] NASL:0196> make_list(...) [9831]() NASL> [080c9968] <- "qpkg" [9831]() NASL> [080c9a00] <- "-nc" [9831]() NASL> [080c9f38] <- "-I" [9831]() NASL> [080c9f98] <- "-v" [9831](example-lvt.nasl) NASL> Call make_list(1: "qpkg", 2: "-nc", 3: "-I", 4: "-v") [9831](example-lvt.nasl) NASL> Return make_list: ???? (DYN_ARRAY (64)) [9831]() NASL> [080c9e88] <- (VAR2_ARRAY) [9831](example-lvt.nasl) NASL> Call pread(cmd: "qpkg", argv: ???? (DYN_ARRAY (64))) [9831](example-lvt.nasl) NASL> Return pread: "qpkg: invalid option -- n Usage: qpkg <opt..." [9831]() NASL> [080c95c0] <- "qpkg: invalid option -- n Usage: qpkg <opts> <misc args> : manipulate Gentoo binpkgs Options: -[cpP:vqChV] -c, --clean * clean pkgdir of unused binary files -p, --pretend * pretend only -P, --pkgdir <arg> * alternate package directory -v, --verbose * Make a lot of noise -q, --quiet * Tighter output; suppress warnings -C, --nocolor * Dont output color -h, --help * Print this help and exit -V, --version * Print version and exit " NASL:0199> if (! (qpkg_list)) { ... } [9831](example-lvt.nasl) NASL> [080c95c0] -> "qpkg: invalid option -- n Usage: qpkg <opts> <misc args> : manipulate Gentoo binpkgs Options: -[cpP:vqChV] -c, --clean -p, --pretend -P, --pkgdir <arg> -v, --verbose -q, --quiet -C, --nocolor -h, --help -V, --version "
* * * * * * * *
clean pkgdir of unused binary files pretend only alternate package directory Make a lot of noise Tighter output; suppress warnings Dont output color Print this help and exit Print version and exit
77
NASL:0201> if (((arch) && (my_arch)) && (my_arch >!< arch)) { ... } [9831](example-lvt.nasl) NASL> [080c9948] -> undef NASL:0201> l=egrep(...); NASL:0201> egrep(...) [9831](example-lvt.nasl) NASL> [080c95c0] -> "qpkg: invalid option -- n Usage: qpkg <opts> <misc args> : manipulate Gentoo binpkgs Options: -[cpP:vqChV] -c, --clean * clean pkgdir of unused binary files -p, --pretend * pretend only -P, --pkgdir <arg> * alternate package directory -v, --verbose * Make a lot of noise -q, --quiet * Tighter output; suppress warnings -C, --nocolor * Dont output color -h, --help * Print this help and exit -V, --version * Print version and exit " [9831]() NASL> [080c9890] <- "qpkg: invalid option ? n [...]
The last line tells us that an incorrect syntax for the qpkg tool was given to the LVT.
78
(6), length 52) 127.0.0.1.53655 > 127.0.0.1.24: ., cksum 0x4bd8 (correct), 1:1(0) ack 1 win 513 <nop,nop,timestamp 5466141 5466141> 15:45:52.474797 IP (tos 0x0, ttl 64, id 3431, offset 0, flags [DF], proto TCP (6), length 72) 127.0.0.1.24 > 127.0.0.1.53655: P, cksum 0xfe3c (incorrect (-> 0x941e), 1:21(20) ack 1 win 512 <nop,nop,timestamp 5466141 5466141> 15:45:52.474829 IP (tos 0x0, ttl 64, id 60971, offset 0, flags [DF], proto TCP (6), length 52) 127.0.0.1.53655 > 127.0.0.1.24: ., cksum 0x4bc3 (correct), 1:1(0) ack 21 win 513 <nop,nop,timestamp 5466142 5466141> 15:45:52.475572 IP (tos 0x0, ttl 64, id 60972, offset 0, flags [DF], proto TCP (6), length 68) 127.0.0.1.53655 > 127.0.0.1.24: P, cksum 0xfe38 (incorrect (-> 0xefa4), 1:17(16) ack 21 win 513 <nop,nop,timestamp 5466142 5466141> 15:45:52.475586 IP (tos 0x0, ttl 64, id 3432, offset 0, flags [DF], proto TCP (6), length 52) 127.0.0.1.24 > 127.0.0.1.53655: ., cksum 0x4bb3 (correct), 21:21(0) ack 17 win 512 <nop,nop,timestamp 5466142 5466142> 15:45:57.479223 IP (tos 0x0, ttl 64, id 60973, offset 0, flags [DF], proto TCP (6), length 52) 127.0.0.1.53655 > 127.0.0.1.24: F, cksum 0x46ce (correct), 17:17(0) ack 21 win 513 <nop,nop,timestamp 5467393 5466142> 15:45:57.479279 IP (tos 0x0, ttl 64, id 3433, offset 0, flags [DF], proto TCP (6), length 52) 127.0.0.1.24 > 127.0.0.1.53655: F, cksum 0x41eb (correct), 21:21(0) ack 18 win 512 <nop,nop,timestamp 5467393 5467393> 15:45:57.479296 IP (tos 0x0, ttl 64, id 60974, offset 0, flags [DF], proto TCP (6), length 52) 127.0.0.1.53655 > 127.0.0.1.24: ., cksum 0x41ea (correct), 18:18(0) ack 22 win 513 <nop,nop,timestamp 5467393 5467393>
If a deeper packet analysis is needed, tools like wireshark are able to read such les in pcap format, and perform a close analysis of all type of network communication packets. The openvas-nasl interpreter also provides us with a logle at /tmp/debug-nvt.txt. This le helps us to debug NASL based NVTs:
[...] NASL:0277> register_int_in_kb(...) [9905](ssh_detect24.nasl) NASL> [0811e310] -> 0 [9905]() NASL> [08120328] <- 0 [9905]() NASL> [08120358] <- "Secret/SSH/bugged_sshd" [9905](ssh_detect24.nasl) NASL> Call register_int_in_kb(int: 0, name: "Secret/SSH/bugged_sshd") NASL:0055> if ((! (defined_func(...))) || (! (_reuse_connection))) { ... } NASL:0054> defined_func(...) [9905]() NASL> [081203a8] <- "replace_kb_item" [9905](ssh_detect24.nasl) NASL> Call defined_func(1: "replace_kb_item") [9905](ssh_detect24.nasl) NASL> Return defined_func: 1 [9905](ssh_detect24.nasl) NASL> [0811e2d8] -> undef NASL:0054> return 0; [9905](ssh_detect24.nasl) NASL> Return register_int_in_kb: 0 [9905](ssh_detect24.nasl) NASL> Return init: FAKE NASL:1771> server_version=ssh_exchange_identification(...); NASL:1771> ssh_exchange_identification(...) [9905](ssh_detect24.nasl) NASL> [0811fde0] -> 1000000 [9905]() NASL> [08120688] <- 1000000 [9905](ssh_detect24.nasl) NASL> Call ssh_exchange_identification(socket: 1000000) NASL:0377> local_var ... NASL:0379> buf=recv_line(...); NASL:0379> recv_line(...) [9905](ssh_detect24.nasl) NASL> [08120688] -> 1000000 [9905]() NASL> [081207b0] <- 1000000 [9905]() NASL> [081207d0] <- 1024 [9905](ssh_detect24.nasl) NASL> Call recv_line(socket: 1000000, length: 1024) [9905](ssh_detect24.nasl) NASL> Return recv_line: "SSH-2.0-FreeSSH_9.9 " [9905]() NASL> [081202d0] <- "SSH-2.0-FreeSSH_9.9 " NASL:0388> if (! (buf)) { ... }
79
[9905](ssh_detect24.nasl) NASL> [081202d0] -> "SSH-2.0-FreeSSH_9.9 " NASL:0394> if (! (ereg(...))) { ... } NASL:0388> ereg(...) [9905](ssh_detect24.nasl) NASL> [081202d0] -> "SSH-2.0-FreeSSH_9.9 " [9905]() NASL> [081206a8] <- "SSH-2.0-FreeSSH_9.9 " [9905]() NASL> [081207b0] <- "^SSH-*[0-9]\.*[0-9]-*[^\n]" [9905](ssh_detect24.nasl) NASL> Call ereg(string: "SSH-2.0-FreeSSH_9.9 ", pattern: "^SSH-*[0-9]\.*[0-9]-*[^\n]") [9905](ssh_detect24.nasl) NASL> Return ereg: 1 NASL:0394> sshversion=split(...); NASL:0394> split(...) [9905](ssh_detect24.nasl) NASL> [081202d0] -> "SSH-2.0-FreeSSH_9.9 " [9905]() NASL> [08120638] <- "SSH-2.0-FreeSSH_9.9 " [9905]() NASL> [081207b0] <- "-" [9905]() NASL> [0811fff8] <- 0 [9905](ssh_detect24.nasl) NASL> Call split(1: "SSH-2.0-FreeSSH_9.9 ", sep: "-", keep: 0) [9905](ssh_detect24.nasl) NASL> Return split: ???? (DYN_ARRAY (64)) [9905]() NASL> [081202f0] <- (VAR2_ARRAY) NASL:0395> num=split(...); NASL:0395> split(...) [...]
This information should be sufcient to solve the problem. If not, it might be an OpenVAS bug in the script engine. To detect this, compile OpenVAS NASL with debug symbols and use GDB. More information on GBD can be found at: http://www.gnu.org/software/gdb/gdb.html.
smbclientavail()
This function returns TRUE if smbclient can be used from within openvasd. It also sets the knowledge base item SMB/smbclient. It should be called rst in any WLSC Script. Example: include("smbcl_func.inc"); if(!get_kb_item("SMB/smbclient")) { smbclientavail(); } if(get_kb_item("SMB/smbclient")) { do something; } else {
80
smbversion()
This function returns TRUE if successful and writes the DOMAIN, OS Version and SMB Server version to the knowledge base as items SMB/DOMAIN, SMB/OS and SMB/SERVER.
81
This function returns the standard Windows folder WINNT or WINDOWS, depending on the OS found by smbversion.
9.5.1 Example
This is a complete NASL test for a Windows Local Security Check. It can be found in the OpenVAS plugins as win_CVE-2007-0043.nasl.
# # # # # # # #
This script was written by Carsten Koch-Mauthe <c.koch-mauthe at dn-systems.de> This script is released under the GNU GPLv2 $Revision: 01 $
if(description) { if (OPENVAS_NASL_LEVEL >= 2206) { script_oid("1.3.6.1.4.1.25623.1.0.90010"); } else { script_id(90010); } script_version ("$Revision: 01 $"); script_cve_id("CVE-2007-0043"); name["english"] = ".NET JIT Compiler Vulnerability"; script_name(english:name["english"]); desc["english"] = "The remote host is affected by the vulnerabilities described in CVE-2007-0043 Checking if System.web.dll version is less than 2.0.50727.832 Impact The Just In Time (JIT) Compiler service in Microsoft .NET Framework 1.0, 1.1, and 2.0 for Windows 2000, XP, Server 2003, and Vista allows user-assisted remote attackers to execute arbitrary code via unspecified vectors involving an unchecked buffer, probably a buffer overflow, aka .NET JIT Compiler Vulnerability. Checking if System.web.dll version is less than 2.0.50727.832 References: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0043 Solution: All users should upgrade to the latest version.
Risk factor : High"; script_description(english:desc["english"]); summary["english"] = "Test for .NET JIT Compiler Vulnerability"; script_summary(english:summary["english"]); script_category(ACT_GATHER_INFO); script_copyright(english:"This script is under GPLv2"); family["english"] = "Windows.NET";
82
script_family(english:family["english"]); exit(0); } # # The code starts here # include("version_func.inc"); include("smbcl_func.inc"); if(!get_kb_item("SMB/smbclient")) { smbclientavail(); } test_version = "2.0.50727.832"; if(get_kb_item("SMB/smbclient")) { if(smbversion() == 0) { report = string("Error getting SMB-Data -> " + get_kb_item("SMB/ERROR")); security_note(port:0, proto:"SMBClient", data:report); exit(0); } } else { report = string("SMBClient not found on this host !"); security_note(port:0, proto:"SMBClient", data:report); exit(0); } win_dir = get_windir(); if(!isnull(win_dir)) { path = win_dir+"Microsoft.NET\Framework\"; filespec = "v2*"; r = smbgetdir(share: "C$", dir: path+filespec, typ: 2); if(!isnull(r)) { filespec = r[0] + "\" + "system.web.dll"; r = smbgetdir(share: "C$", dir: path+filespec, typ: 1); if(!isnull(r)) { tmp_filename = get_tmp_dir() + "tmpfile" + rand(); orig_filename = path + filespec; if(smbgetfile(share: "C$", filename: orig_filename, tmp_filename: tmp_filename)) { v = GetPEFileVersion(tmp_filename:tmp_filename, orig_filename:orig_filename); unlink(tmp_filename); if(version_is_less(version: v, test_version: test_version)) { security_hole(port:0, proto:"SMB"); report = report + "Fileversion : C$ " + orig_filename + " "+ v + string("\n"); security_hole(port:0, proto:"SMB", data:report); } } else { report = string("Error getting SMB-File -> " + get_kb_item("SMB/ERROR")) + string("\n");
83
security_note(port:0, proto:"SMB", data:report); } } } else { report = string(".NET V2xx not found/no access -> " + get_kb_item("SMB/ERROR")) + string("\n"); security_note(port:0, proto:"SMB", data:report); } } exit(0);
84
85
86
87
Even though it might be tempting to use the trunk version to get the latest features, be aware that the trunk is under constant development and intended for developers. This means that the trunk version is not recommended for any production use.
88
http://www.openvas.org/code-quality.html
Please be aware that you should make yourself familiar with the tools used for generating these results before interpreting the absolute numbers. While every issue reported by these tools is evaluated by the OpenVAS developers, some of the issues reported do not have a signicant impact on code quality and security.
89
Send your patch as a unied context diff, in the format the GNU diff tool would produce when called with the -u3 parameter. If you are working on a revision you checked out from the SVN repository, the svn diff command will produce the correct output. Please detail your changes in the appropriate ChangeLog. This will help other people (especially other developers) to understand what you changed and why you changed it. Try to keep your patches atomic. That means that each patch should contain only one feature, bugx or addition. Please do not submit a patch containing dozens of features as it is highly unlikely that the developers will want to add all your changes simultaneously. Your patch is far more likely to be accepted if you send in a number of small patches instead and leave it at the discretion of the developers to determine the best time to include your changes. If you have followed these guidelines your patch should now be ready for submission to the OpenVAS project. The best way to do this is to send your patch to the OpenVAS developers mailing list at [email protected] with a short explanation as to what you did and why you did it.
90
91
/** * Defines follow the includes which follow the header, are capitalized and can * be documented.\n * Documentation is done in the source file, not the header file. */ #define SOMEDEFINE "fine"
/** * Static functions do not neccessarily begin with the module name. * @param str Parameters can be described like this. */ static void statfunc (gchar *str) { /* Indentation by 2 blanks, single lines should not exceed 80 chars */ GtkWidget* m = gtk_message_dialog_new (GTK_WINDOW(NULL), (GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, str); /* (If 80 chars per line do not suffice, try to break it up nicely) */ gtk_dialog_run (GTK_DIALOG (m)); gtk_object_destroy (GTK_OBJECT (m)); }
/** * @brief For an overview, I can describe what happens here in one sentence. * * Non-static functions begin with the name of the module + underscore. * @param win Widget to work on.
92
* @param data Data to work with. * @return String that has to be freed. */ char* module_func (GtkWidget* win, gpointer data) { char buf[1024]; pid_t p; FILE* f; /* Structuring by newlines is fine. */ f = popen (SLADINSTALLER " --ping", "r");
/* Conditional and loop intendation same as for functions. */ if (!f) { statfunc (_("Could not check SLAD installer.")); return; } else /* f != NULL */ { statfunc (_("An else")); } fgets (buf, sizeof (buf), f); pclose (f); #ifndef CYGWIN /* Compiled with flag -mwindows, sladinstaller * does not answer on stdout. * Therefore, this test is only performed on * non-CYGWIN systems and simply dropped for * CYGWIN. */ if (strcmp (buf, "pong\n")) { statfunc (_("Could not execute SLAD installer.")); return; } #endif /* CYGWIN */ // Single-line intermediate comments can also start by double slashes. p = fork (); }
Plug-in upload Section 10 of the NTP Extensions describes the ATTACHED_PLUGIN message type. Using this message type, it was possible for a client to upload a plug-in to a server. Due to security considerations described in the OpenVAS change request #4, this message type has been removed from the protocol.
Version information The undocumented NESSUS_VERSION message type has been replaced with the
OPENVAS_VERSION message type. When an OPENVAS_VERSION message is issued by the client, the server is expected to respond with a message containing the current server version.
New message types In addition to the existing message types HOLE, INFO and NOTE two new message
types have been added to the protocol: DEBUG and LOG. Their purpose is to give clients the possibility to display log and debug messages raised by plugins and allow the user to control the verbosity of the messages displayed.
Detached scans This functionality has been dropped due to design decisions. This means the following
commands have been removed from the protocol: DETACHED_SESSIONS_LIST and DETACHED_STOP. The following preferences have been removed from the protocol as well: detached_scan, continuous_scan, delay_between_scan_loops, detached_scan_email_address.
Plugin order information The server command PLUGINS_ORDER was dened for NTP 1.2 but not
implemented in the server. This command has been removed from the protocol.
Starting a scan NTP offered two ways of starting a scan, NEW_ATTACK and LONG_ATTACK. The latter
allowed arbitrary long list of targets while the rst was limited to 4000 bytes. The OpenVAS-Client (and so did NessusClient) used only LONG_ATTACK anyway.
93
94
Reporting preferences errors NTP allowed the reporting of preferences errors with the PREFERENCES_ERRORS
message type. Since this message type was never properly implemented in either server or client and due to design decisions, this message type has been removed from the protocol.
Protocol extensions These protocol extensions have been made standard in the OTP protocol: timestamps, dependencies, plugins_version, plugins_cve_id, plugins_bugtraq_id and plugins_xrefs.
95
11.4.2 BYE
Description: This command is used by the server to indicate that a scan session has nished.
The client is expected to acknowledge this command.
Syntax:
SERVER <|> BYE <|> BYE <|> SERVER CLIENT <|> BYE <|> ACK
11.4.3 CERTIFICATES
Description: This command is used by the client to request certicate information and by the server to
send those. Included are the certicate owners name, the trust level and the public key.
Syntax:
CLIENT <|> CERTIFICATES <|> CLIENT SERVER <|> CERTIFICATES fingerprint <|> owner_name <|> trust_level <|> length_in_bytes <|> pubkey <|> SERVER where ngerprint is a 48 bytes eld containing the ngerprint of the certicate. owner_name denotes the owner name. trust_level is either trusted or notrust. length_in_bytes contains the length of the public key in bytes. pubkey is the ascii-armored public key itself, where newlines have been replaced by semicolons.
11.4.4 COMPLETE_LIST
Description: This command can be used by the client to request the complete list of plugins from the
server. It usually follows the PLUGINS_MD5 commands of the server in case the server side md5sum is not equal to the md5sum of the client side cached NVTs. Alternatively, the client can use the command SEND_PLUGINS_MD5. The server will answer with command PLUGIN_LIST.
Syntax:
CLIENT <|> COMPLETE_LIST <|> CLIENT
11.4.5 DEBUG
Description: With this command the server reports an identied problem of class debug. The general
version is applied if no port relates to the note.
96 Syntax:
SERVER <|> DEBUG <|> host <|> service_name (port_number/protocol_type) <|> description <|> oid <|> SERVER SERVER <|> DEBUG <|> host <|> general <|> description <|> oid <|> SERVER where host the target system service_name the name of the service (like in /etc/services) port_number the port number the problem relates to. protocol_type tcp or udp. description the problem description where newlines have been replaced by semicolons. oid the OID of the NVT that identied the problem.
11.4.6 ERROR
Description: In case of problems the server sends an error message with this command. In case of unrecoverable problems, the server will then close the connection with the BYE command.
Syntax:
SERVER <|> ERROR <|> error description <|> SERVER
11.4.7 FINISHED
Description: The server will send this information each time when a scan of a single host is nished. This
will only be done if requested by the client via setting the preferences option ntp_opt_show_end.
Syntax:
SERVER <|> FINISHED <|> host <|> SERVER
11.4.8 GO ON
Description: This command can be used by the client to conrm that the plugin information has been
received and to signal to the server that it may proceed. It usually follows the PLUGINS_MD5 commands of the server in case the server side md5sum is equal to the md5sum of the client side cached NVTs. The server will answer with command PREFERENCES and communication will continue.
Syntax:
CLIENT <|> GO ON <|> CLIENT
97
11.4.9 HOLE
Description: With this command the server reports an identied problem of class security hole. The
general version is applied if no port relates to the hole.
Syntax:
SERVER <|> HOLE <|> host <|> service_name (port_number/protocol_type) <|> description <|> oid <|> SERVER SERVER <|> HOLE <|> host <|> general <|> description <|> oid <|> SERVER where host the target system service_name the name of the service (like in /etc/services) port_number the port number the problem relates to. protocol_type tcp or udp. description the problem description where newlines have been replaced by semicolons. oid the OID of the NVT that identied the problem.
11.4.10 INFO
Description: With this command the server reports an identied problem of class security info. The
general version is applied if no port relates to the info.
Syntax:
SERVER <|> INFO <|> host <|> service_name (port_number/protocol_type) <|> description <|> oid <|> SERVER SERVER <|> INFO <|> host <|> general <|> description <|> oid <|> SERVER where host the target system service_name the name of the service (like in /etc/services) port_number the port number the problem relates to. protocol_type tcp or udp. description the problem description where newlines have been replaced by semicolons. oid the OID of the NVT that identied the problem.
11.4.11 LOG
Description: With this command the server reports an identied problem of class log. The general
version is applied if no port relates to the note.
98 Syntax:
SERVER <|> LOG <|> host <|> service_name (port_number/protocol_type) <|> description <|> oid <|> SERVER SERVER <|> LOG <|> host <|> general <|> description <|> oid <|> SERVER where host the target system service_name the name of the service (like in /etc/services) port_number the port number the problem relates to. protocol_type tcp or udp. description the problem description where newlines have been replaced by semicolons. oid the OID of the NVT that identied the problem.
11.4.12 LONG_ATTACK
Description: With this command the client requests the server to attack target system(s) hosts. hosts
is one or many (comma-separated) IP or FQDN. length is the number of bytes of hosts. In case this does not match, the server will close the connection. Before the client sends LONG_ATTACK, the commands PREFERENCES and RULES should be applied.
Syntax:
CLIENT <|> LONG_ATTACK length hosts
11.4.13 NOTE
Description: With this command the server reports an identied problem of class security note. The
general version is applied if no port relates to the note.
Syntax:
SERVER <|> NOTE <|> host <|> service_name (port_number/protocol_type) <|> description <|> oid <|> SERVER SERVER <|> NOTE <|> host <|> general <|> description <|> oid <|> SERVER where host the target system service_name the name of the service (like in /etc/services) port_number the port number the problem relates to. protocol_type tcp or udp. description the problem description where newlines have been replaced by semicolons. oid the OID of the NVT that identied the problem.
99
11.4.14 OPENVAS_VERSION
Description: With this command the client asks the server to send its version.
The server will answer as shown in the syntax.
Syntax:
CLIENT <|> OPENVAS_VERSION <|> CLIENT SERVER <|> OPENVAS_VERSION <|> version <|> SERVER
11.4.15 PLUGINS_DEPENDENCIES
Description: The PLUGINS_DEPENDENCIES message is sent after the RULES messages. Syntax:
SERVER <|> PLUGINS_DEPENDENCIES nvt_name1 <|> dependency1 <|> dependency2 <|> ... <|> nvt_name2 <|> dependency1 <|> dependency2 <|> ... <|> ... <|> SERVER
11.4.16 PLUGINS_MD5
Description: Attention: This command occurs in two ways.
1. This command can be used instead of the PLUGIN_LIST command. md5sum is the MD5 sum over all NVTs. 2. This command follows the SEND_PLUGINS_MD5 command of the client and delivers the md5sums for each NVT.
Syntax:
1. SERVER <|> PLUGINS_MD5 <|> md5sum <|> SERVER 2. SERVER <|> PLUGINS_MD5 nvt_oid1 <|> md5sum1 nvt_oid2 <|> md5sum2 ... <|> SERVER
11.4.17 PLUGIN_INFO
Description: This command is issued by the client to request information of the NVT specied by its oid.
100 Syntax:
CLIENT <|> PLUGIN_INFO <|> oid <|> CLIENT
The server answers with this line (analogous to PLUGIN_LIST command): oid <|> name <|> category <|> copyright <|> description <|> summary <|> family <|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs <|> fprs The last eld, fprs is a comma-separated list of ngerprints of signatures, if any. In case no plugin with OID=oid is found, the server will not answer at all. For cve_id, bugtraq_id, xrefs and fprs symbolic values (NOCVE, NOBID, NOXREFS, NOSIGNKEYS) are sent, if no cve_id, bugtrac_id etc. is known.
11.4.18 PLUGIN_LIST
Description: With this command the server sends detailed information about the available NVTs.
The server will send PREFERENCES and RULES right after this command. The client might request individual NVT information via the PLUGIN_INFO command.
Syntax:
SERVER <|> PLUGIN_LIST <|> oid <|> name <|> category <|> <|> plugin_version <|> cve_id oid <|> name <|> category <|> <|> plugin_version <|> cve_id ... <|> SERVER copyright <|> description <|> summary <|> family <|> bugtraq_id <|> xrefs <|> fprs copyright <|> description <|> summary <|> family <|> bugtraq_id <|> xrefs <|> fprs
In this case, fprs is a comma-separated list of ngerprints of signatures, if any. For cve_id, bugtraq_id, xrefs and fprs symbolic values (NOCVE, NOBID, NOXREFS, NOSIGNKEYS) are sent, if no cve_id, bugtrac_id etc. is known.
11.4.19 PORT
Description: With this command the server reports on open port port_number on target system host. Syntax:
SERVER <|> PORT <|> host <|> port_number <|> SERVER
11.4.20 PREFERENCES
Description: With this command the values for the preferences are communicated. The server uses the
command to inform about defaults, the client uses the command to send the user selections. Note that besides some general preferences, the syntax denition describes also per-NVT preferences and its special way of applying these.
101
ntp_save_sessions If set to yes, the server will support server-side saving of scan sessions and the following commands will be available: SESSIONS_LIST, SESSION_DELETE and SESSION_RESTORE. save_session If set to yes, the server will save the scan as a session. save_empty_sessions Only considered if save_session is set to yes. If set to yes even empty scans will be saved as a session. max_threads test_le ping_hosts reverse_lookup outside_rewall host_expansion port_range max_hosts save_knowledge_base Activates KB saving when set to yes only_test_hosts_whose_kb_we_have Only scans host for which the KB is lled when set to yes. only_test_hosts_whose_kb_we_dont_have Only scans host for which the KB is empty when set to yes. kb_restore Restore the KB contents for tested hosts when when set to yes. kb_dont_replay_scanners Dont run scanners in case kb_restore is set to yes and there is contents in the KB when set to yes. kb_dont_replay_info_gathering Dont run gatherers in case kb_restore is set to yes and there is contents in the KB when set to yes. kb_dont_replay_attacks Dont run attack scripts in case kb_restore is set to yes and there is contents in the KB when set to yes. kb_dont_replay_denials Dont run DoS attack scripts in case kb_restore is set to yes and there is contents in the KB when set to yes. kb_max_age This sets the maximum age (in seconds) of a KB until it gets disregarded. timeout.<nvt_id> = <timeout> Set the timeout <timeout> for NVT <nvt_id>. Timeout of -1 means no specic timeout. Only sent by CLIENT: plugin_set empty means all NVTs ntp_opt_show_end Tell server to send FINISHED messages ntp_keep_communication_alive Tell server to keep the connection even after a scan was nished. ntp_short_status Tell server send shorter STATUS message in order to save bandwidth.
102 Syntax:
SERVER <|> PREFERENCES <|> pref_name <|> value pref_name <|> value pref_name <|> value ... <|> SERVER CLIENT <|> PREFERENCES <|> pref_name <|> value pref_name <|> value pref_name <|> value ... <|> CLIENT
For preference of individual NVTs these lines can occur inside the list:
where nvt_name This references the NVT for which the preferences are set pref_type Denes the variable type of the preference which ultimately determines the widget type in the client GUI. pref_name This references the Preference and at the same time is used as the visible string for the user in the GUI. value The default value for this preference when sent by SERVER, the user selected value if send by CLIENT and pref_type is one of these: checkbox value is yes or no entry value is a text string password value is a text string but should not be shown in GUI or in cleartext in local les radio value is a list of semicolon-separated options when sent by SERVER and only the user-selected option name when sent by CLIENT le value is <none> when sent by SERVER and a le path when sent by CLIENT. The client has to submit the le under the very same path name using the command ATTACHED_FILE.
11.4.21 RULES
Description: Rules dene restrictions for target systems. Client-side rules self-restrict target host patterns,
server-side rules are just for information to the client. These rule sets are independent of each other.
103
11.4.22 SEND_PLUGINS_MD5
Description: This command usually follows the PLUGINS_MD5 commands of the server in case the server
side md5sum is not equal to the md5sum of the client side cached NVTs. Alternatively, the client can use the command COMPLETE_LIST. The server will answer with command PLUGINS_MD5.
Syntax:
CLIENT <|> SEND_PLUGINS_MD5 <|> CLIENT
11.4.23 SESSIONS_LIST
Description: The CLIENT requests with this command the list of sessions stored on the server side for the
logged in user. The SERVER will answer with the same command and provide the list of sessions. The session names are derived from time stamps. The hosts are the targets applied for the respective session. The hosts are just there to help identify the sessions. It is cut after 4000 bytes of length.
Syntax:
CLIENT <|> SESSIONS_LIST <|> CLIENT SERVER <|> SESSIONS_LIST session_name1 hosts1 session_name2 hosts2 ... <|> SERVER
11.4.24 SESSION_DELETE
Description: With this command the client deletes the session identied with session_name from the
server-side storage. The server will not answer in case of success, else it will answer with an ERROR command.
104 Syntax:
11.4.25 SESSION_RESTORE
Description: With this command the client tells the server to pick up again the session identied with
session_name. The server will act as if a LONG_ATTACK command has issued and will send all results that were collected so far for this session immediately (and naturally rapidly) and then continue the scan where it stopped.
Syntax:
CLIENT <|> SESSION_RESTORE <|> session_name <|> CLIENT
11.4.26 STATUS
Description: With this command, the server informs the client about the progress of the scan for target
system host. attack_state is either portscan or attack. (or just p and a in case the client has set preferences option ntp_short_status). current is the currently processed port and max the last port number to be tested.
Syntax:
SERVER <|> STATUS <|> host <|> attack_state <|> current/max <|> SERVER In case the client has set ntp_short_status. SERVER <|> STATUS <|> attack_state:host:current:max <|> SERVER
11.4.27 STOP_ATTACK
Description: With this command, the client tells the server to stop scanning target host. Syntax:
CLIENT <|> STOP_ATTACK <|> host <|> CLIENT
11.4.28 STOP_WHOLE_TEST
Description: With this command the client tells to stop the currently running test. Syntax:
CLIENT <|> STOP_WHOLE_TEST <|> CLIENT
105
11.4.29 TIME
Description: The TIME messages are sent by the server to inform about the duration of scanning a host
and of the whole scan.
106
12 Document License: CC by SA
Creative Commons Attribution-ShareAlike 3.0 Unported You are free to copy, distribute and transmit the work under the following conditions: Attribution. You must give the original author credit. Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. For any reuse or distribution, you must make clear to others the license terms of this work. Any of the above conditions can be waived if you get permission from the copyright holder. Nothing in this license impairs or restricts the authors moral rights. To view the full licensing agreement, visit http://creativecommons.org/licenses/by-sa/3.0/ or mail to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.
107