vscweb-commit Mailing List for Vulnerability Scanning Cluster (Page 2)
Brought to you by:
cirrusrex
You can subscribe to this list here.
2004 |
Jan
|
Feb
(41) |
Mar
(44) |
Apr
(94) |
May
(14) |
Jun
|
Jul
(1) |
Aug
(31) |
Sep
(18) |
Oct
(27) |
Nov
(44) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(1) |
Feb
(15) |
Mar
(7) |
Apr
(18) |
May
(23) |
Jun
(25) |
Jul
(13) |
Aug
(23) |
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2006 |
Jan
(2) |
Feb
|
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(14) |
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <wi...@bi...> - 2005-12-13 03:56:54
|
Author: wirges Date: 2005-12-12 22:59:19 -0500 (Mon, 12 Dec 2005) New Revision: 433 Modified: branches/vsc-2.0/Main/tpl/Reports/single_scan_csv.tpl Log: Fixed single_scan_csv reports - added missing severity field, and put con= tents inside of pre tags so it can be properly cut and pasted. Modified: branches/vsc-2.0/Main/tpl/Reports/single_scan_csv.tpl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/tpl/Reports/single_scan_csv.tpl 2005-11-16 12:5= 3:30 UTC (rev 432) +++ branches/vsc-2.0/Main/tpl/Reports/single_scan_csv.tpl 2005-12-13 03:5= 9:19 UTC (rev 433) @@ -1,6 +1,8 @@ -"IP Address", "Hostname", "Plugin ID", "Port Info", "Family", "Risk Fact= or", "Description"<br> +<pre> +"IP Address", "Hostname", "Plugin ID", "Port Info", "Family", "Risk Fact= or", "Description" {foreach name=3Dhostid item=3Dhostd from=3D$result_data.hosts} - {foreach item=3Dvuln from=3D$hostd.results} - {$hostd.address},{$host.dns_name},{$vuln.plugin_id},{$vuln.prot}/{= $vuln.port} {$vuln.service},{$vuln.family},"{$vuln.body|replace:"\"":"'"}= "<br> - {/foreach} +{foreach item=3Dvuln from=3D$hostd.results} +{$hostd.address},{$host.dns_name},{$vuln.plugin_id},{$vuln.prot}/{$vuln.= port} {$vuln.service},{$vuln.family},{$vuln.severity},"{$vuln.body|replac= e:"\"":"'"|replace:"\n":" "}" {/foreach} +{/foreach} +</pre> |
From: <wi...@bi...> - 2005-11-16 12:51:24
|
Author: wirges Date: 2005-11-16 07:53:30 -0500 (Wed, 16 Nov 2005) New Revision: 432 Modified: trunk/pyvscd/libvscmt/scan.py Log: Fixed a bug found by Billy Meyers at OK State. PLUGIN_PREFS should be PL= UGINS_PREFS Modified: trunk/pyvscd/libvscmt/scan.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/libvscmt/scan.py 2005-09-06 22:24:49 UTC (rev 431) +++ trunk/pyvscd/libvscmt/scan.py 2005-11-16 12:53:30 UTC (rev 432) @@ -258,7 +258,7 @@ """ c =3D db.cursor() __sql__ =3D "SELECT name,value FROM nessus_config " +\ - "WHERE section =3D 'PLUGIN_PREFS'" + "WHERE section =3D 'PLUGINS_PREFS'" c.execute(__sql__) rdict =3D {} for (name,value) in c: |
From: <wi...@bi...> - 2005-08-31 23:49:08
|
Author: wirges Date: 2005-08-31 18:50:23 -0500 (Wed, 31 Aug 2005) New Revision: 430 Modified: branches/vsc-2.0/CHANGELOG branches/vsc-2.0/INSTALL branches/vsc-2.0/UPDATE Log: Updated documentation Modified: branches/vsc-2.0/CHANGELOG =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/CHANGELOG 2005-08-31 23:34:06 UTC (rev 429) +++ branches/vsc-2.0/CHANGELOG 2005-08-31 23:50:23 UTC (rev 430) @@ -1,6 +1,11 @@ CHANGELOG ------------ =20 +Changes to the VSC are now tracked using the VSC Trac interface at=20 + http://bishop.itsp.purdue.edu/cgi-bin/trac.cgi/timeline + +-- + - Temporarily disabled netbios lookups and plugin updates from the daemo= n. -- =20 Modified: branches/vsc-2.0/INSTALL =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/INSTALL 2005-08-31 23:34:06 UTC (rev 429) +++ branches/vsc-2.0/INSTALL 2005-08-31 23:50:23 UTC (rev 430) @@ -81,6 +81,9 @@ =20 Second, choose a location for the VSC daemon module, daemon. =20 E.g. $ mv daemon /usr/local/vsc2/daemon +(Note: the VSC daemon in the 'daemon' directory is deprecated. It is st= rongly suggested + that you use the pyvscd located in the 'pyvscd' directory in the root o= f this archive. =20 + Consult the pyvscd/README for more details.) =20 Third, choose a location within your Apache server's web root to place t= he Main module. E.g. $ mv Main /usr/local/apache/htdocs/vsc-2.0 @@ -216,6 +219,10 @@ 4. VSC Daemon installation ------- =20 +NOTICE: The VSC Perl Daemon, or vscd is deprecated and has been replace= d with the pyVscd. =20 + For more information on using the pyVscd, please see the pyvscd= /README file in + this distribution. + Now you should switch to the location where you moved the daemon module.= In order for the=20 vscd to run properly, you will need to make a couple of modifications to= appropriate files. Open the "vscd" file in your favorite text editor. First you will want = to change the interpreter Modified: branches/vsc-2.0/UPDATE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/UPDATE 2005-08-31 23:34:06 UTC (rev 429) +++ branches/vsc-2.0/UPDATE 2005-08-31 23:50:23 UTC (rev 430) @@ -1,8 +1,36 @@ Updating the VSC ---------------------- =20 -This document applies to the VSC 2.0 beta release candidates. +Migrating from 2.0 Beta 2 to 2.0 +--------------------------------- +=20 +No changes have been made to the VSC database definition since Beta 2. T= o upgrade +VSC 2.0 Beta 2 to VSC 2.0 Final, perform the following actions: =20 + - Untar the VSC 2.0b2 archive in a temp directory + - Preserve your .htaccess and .mysql files from your existing installat= ion=20 + (you will need to values later) + - Reinstall the templates (tpl), Main, and daemon directories per the i= nstallation + document. Ideally, this just means that you will copy the 2.0b2 file= s over the + existing files. + - In the main web root, change .htaccess.tpl to .htaccess and edit it t= o reflect=20 + your previous configuration values. + + - The Perl vscd daemon has been deprecated. You are strongly encourage= d to use the + pyVscd daemoin in the pyvscd/ directory in this distribution. To use= this, follow + the instructions in the pyvscd/README file. Note: you will need to m= ake the modifications + mentioned in the pyvscd/UPGRADE file. + + If you decide not to use the pyvscd, be aware that there are several = known bugs with the + perl vscd that have not been fixed and may cause stability problems. = If you still=20 + decide to run the perl vscd, follow these last two instructions: + + - Make sure you set your VSCD_ROOT values in the daemon/vscd and=20 + daemon/utils/load_plugins.pl files. + - Restart the vscd and bring up the VSC web interface in your web=20 + browser and make sure everything works as expected. + + Migrating from 2.0 Beta 1 to 2.0 Beta 2 ---------------------------------------- =20 |
From: <wi...@bi...> - 2005-08-31 22:52:29
|
Author: wirges Date: 2005-08-31 17:53:44 -0500 (Wed, 31 Aug 2005) New Revision: 428 Modified: branches/vsc-2.0/Main/People/Session/include/libsession.inc Log: Auth type "STD" changed to SUPA for libsession redirect Modified: branches/vsc-2.0/Main/People/Session/include/libsession.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/People/Session/include/libsession.inc 2005-08-3= 1 03:26:53 UTC (rev 427) +++ branches/vsc-2.0/Main/People/Session/include/libsession.inc 2005-08-3= 1 22:53:44 UTC (rev 428) @@ -68,8 +68,9 @@ list($void, $path) =3D explode($_SERVER['HTTP_HOST'], $IMAGE_PA= TH); $r_path =3D str_replace($path, "", $_SERVER['PHP_SELF']); $return =3D base64_encode($r_path); - $login =3D $IMAGE_PATH."/People/Session/".str_replace("AUTH_", "",$= _CONFIG['use_auth'])."/login_proc.php"; - #$login =3D $IMAGE_PATH."/People/Session/".$_CONFIG['use_auth']."/l= ogin_proc.php"; + $auth_url =3D str_replace("AUTH_", "",$_CONFIG['use_auth']); + if ($auth_url =3D=3D "STD") $auth_url =3D 'SUPA'; + $login =3D $IMAGE_PATH."/People/Session/".$auth_url."/login_proc.ph= p"; =20 header("Location: $login?target=3D$return"); } else { @@ -113,7 +114,9 @@ list($void, $path) =3D explode($_SERVER['HTTP_HOST'], $IMAGE_PA= TH); $r_path =3D str_replace($path, "", $_SERVER['PHP_SELF']); $return =3D base64_encode($r_path); - $login =3D $IMAGE_PATH."/People/Session/".str_replace("AUTH_", "",$= _CONFIG['use_auth'])."/login_proc.php"; + $auth_url =3D str_replace("AUTH_", "",$_CONFIG['use_auth']); + if ($auth_url =3D=3D "STD") $auth_url =3D 'SUPA'; + $login =3D $IMAGE_PATH."/People/Session/".$auth_url."/login_proc.ph= p"; =20 header("Location: $login?target=3D$return"); } else { |
From: <wi...@bi...> - 2005-08-31 03:25:41
|
Author: wirges Date: 2005-08-30 22:26:53 -0500 (Tue, 30 Aug 2005) New Revision: 427 Modified: trunk/pyvscd/CHANGELOG trunk/pyvscd/README trunk/pyvscd/UPGRADE trunk/pyvscd/libvscmt/nessusmt.py trunk/pyvscd/libvscmt/scan.py trunk/pyvscd/pyvscd.conf.example trunk/pyvscd/pyvscd.py Log: libvscmt/* changes - added a host.resolve method to resolve hosts by dns = or mac address when IP is not returned. This function has not been teste= d and its use has been commented out of the caller handler in libvscmt.ne= ssusmt library. Otherwise, just a little bit of housekeeping for the pyvscd 1.0 release (= bundled with VSC 2.0 Final) Modified: trunk/pyvscd/CHANGELOG =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/CHANGELOG 2005-08-31 02:50:15 UTC (rev 426) +++ trunk/pyvscd/CHANGELOG 2005-08-31 03:26:53 UTC (rev 427) @@ -1,6 +1,8 @@ CHANGELOG ------------ =20 +30AUG05 - Released pyssus version 1.0, which is bundled with pyvscd. + 16AUG05 - Made changes to libvscmt.nessusmt: Added try/except blocks to nessus message handlers Fixed a bug in the Note handler which caused database connecti= on objects Modified: trunk/pyvscd/README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/README 2005-08-31 02:50:15 UTC (rev 426) +++ trunk/pyvscd/README 2005-08-31 03:26:53 UTC (rev 427) @@ -52,8 +52,8 @@ ------ =20 The pyvscd is meant to be a drop-in replacement for the current vscd. W= hile not -distributed with vsc-2.0b2, (or VSC 2.0 Final, when it is released). It= is developed -for and against this version. Later releases of the pyvscd will be deve= loped=20 +distributed with vsc-2.0b2, it is developed for and against version 2.0 = and will be=20 +bundled with 2.0 Final. Later releases of the pyvscd will be developed=20 specifically for the VSC 3.0 development branch (currently, the trunk). = A tagged=20 release of the current working vsc 2.0 compatible pyvscd will be made. =20 Modified: trunk/pyvscd/UPGRADE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/UPGRADE 2005-08-31 02:50:15 UTC (rev 426) +++ trunk/pyvscd/UPGRADE 2005-08-31 03:26:53 UTC (rev 427) @@ -1,6 +1,8 @@ UPGRADE NOTES ------------- =20 +*Note: when upgrading from the perl vscd or pyvscd before August 1st, 20= 05* + In order for the pyvscd to work correctly, you will need to make some ch= anges: =20 1) System Configuration Changes Modified: trunk/pyvscd/libvscmt/nessusmt.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/libvscmt/nessusmt.py 2005-08-31 02:50:15 UTC (rev 426) +++ trunk/pyvscd/libvscmt/nessusmt.py 2005-08-31 03:26:53 UTC (rev 427) @@ -250,6 +250,7 @@ args - Tuple, db conx pool, scan_id, host_map(dict) """ (dbq, scan_id, host_map, log) =3D args + #self.host =3D host.resolve(self.host) if not host_map.has_key(self.host): return None try: Modified: trunk/pyvscd/libvscmt/scan.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/libvscmt/scan.py 2005-08-31 02:50:15 UTC (rev 426) +++ trunk/pyvscd/libvscmt/scan.py 2005-08-31 03:26:53 UTC (rev 427) @@ -4,6 +4,7 @@ import MySQLdb import logging import time +import re =20 def promoteNextRecurScans(db): """promote a recurring scan date to full scan. @@ -502,6 +503,31 @@ c.close() return rlist =20 +def resolve(db, host): + """Try to find the IP address of a host from either + its hostname or its mac address. + + Keyword Arguments: + db - MySQLdb.connections.Connection + scan_id - integer + + Returns: list + """ + c =3D db.cursor() + if not re.compile("[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}").m= atch(host):=20 + return host + if not re.compile("[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a= -fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}").match(host): + __sql__ =3D "SELECT address FROM Host WHERE mac_address=3D%s" + else: + __sql__ =3D "SELECT address FROM Host WHERE dns_name=3D%s" + + if c.execute(__sql__) > 0: + (addr,) =3D c.fetchone() + else: + addr =3D host + c.close() + return addr + def getHostsProcessing(db, scan_id): """Return a list of hostids that are currently marked as processing for the current scan_id. Modified: trunk/pyvscd/pyvscd.conf.example =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyvscd.conf.example 2005-08-31 02:50:15 UTC (rev 426) +++ trunk/pyvscd/pyvscd.conf.example 2005-08-31 03:26:53 UTC (rev 427) @@ -10,12 +10,12 @@ #Logfile logging is broken right now. It is recommended that you #not use it unless you like deadlocks :-) logfile_enable: no -logfile_level: 10 +logfile_level: 30 logfile: pyvscd.log =20 #console logging must be enabled, but you can #set the severity -logcons_level: 20 +logcons_level: 40 #this is overriden by the cli option -D daemon: yes=20 =20 Modified: trunk/pyvscd/pyvscd.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyvscd.py 2005-08-31 02:50:15 UTC (rev 426) +++ trunk/pyvscd/pyvscd.py 2005-08-31 03:26:53 UTC (rev 427) @@ -1,9 +1,22 @@ #!/usr/bin/env python2.4 """ +{{{ +This library is made available under the +University of Illinois/NCSA Open Source License.=20 +See the LICENSE file in the distribution or=20 +http://mother.itsp.purdue.edu/~wirges/LICENSE +}}} + The Vulnerability Scanning Cluster=20 scan management daemon """ +__version__ =3D '1.0' +__author__ =3D """Matthew L Wirges, et al.""" +__credits__ =3D 'Copyright (C) 2005 Purdue University' +__date__ =3D '30 AUG 2005' +__todo__ =3D 'libvscmt needs its host.resolve method tested' =20 + from ConfigParser import ConfigParser from optparse import OptionParser from Queue import Queue |
From: <wi...@bi...> - 2005-08-31 02:49:01
|
Author: wirges Date: 2005-08-30 21:50:15 -0500 (Tue, 30 Aug 2005) New Revision: 426 Modified: trunk/pyvscd/pyssus/setup.py Log: Forgot to change version in setup.py script Modified: trunk/pyvscd/pyssus/setup.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/setup.py 2005-08-31 02:49:38 UTC (rev 425) +++ trunk/pyvscd/pyssus/setup.py 2005-08-31 02:50:15 UTC (rev 426) @@ -3,7 +3,7 @@ from distutils.core import setup =20 setup(name=3D'pyssus', - version=3D'0.1', + version=3D'1.0', description=3D'Python Nessus Library', package_dir=3D{'pyssus':''}, packages=3D['pyssus'], |
From: <wi...@bi...> - 2005-08-31 02:48:25
|
Author: wirges Date: 2005-08-30 21:49:38 -0500 (Tue, 30 Aug 2005) New Revision: 425 Modified: trunk/pyvscd/pyssus/__init__.py trunk/pyvscd/pyssus/comm.py trunk/pyvscd/pyssus/commands.py trunk/pyvscd/pyssus/data.py trunk/pyvscd/pyssus/handlers.py trunk/pyvscd/pyssus/message.py Log: Changed version number from 0.1 to 1.0.=20 Official final first release as it is being distributed with VSC 2.0 Fina= l. Modified: trunk/pyvscd/pyssus/__init__.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/__init__.py 2005-08-31 02:38:46 UTC (rev 424) +++ trunk/pyvscd/pyssus/__init__.py 2005-08-31 02:49:38 UTC (rev 425) @@ -8,6 +8,7 @@ =20 pyssus "pie-suss" Nessus Library for Python + Version 1.0 =20 Copyright (C) 2005 - Purdue University =20 Modified: trunk/pyvscd/pyssus/comm.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/comm.py 2005-08-31 02:38:46 UTC (rev 424) +++ trunk/pyvscd/pyssus/comm.py 2005-08-31 02:49:38 UTC (rev 425) @@ -17,7 +17,7 @@ non-SSL. """ =20 -__version__ =3D '0.1' +__version__ =3D '1.0' __author__ =3D """Matthew L Wirges <wi...@pu...> IT Security and Privacy Analyst Office of the Vice President for Information Technology Modified: trunk/pyvscd/pyssus/commands.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/commands.py 2005-08-31 02:38:46 UTC (rev 424) +++ trunk/pyvscd/pyssus/commands.py 2005-08-31 02:49:38 UTC (rev 425) @@ -16,7 +16,7 @@ =20 """ =20 -__version__ =3D '0.1' +__version__ =3D '1.0' __credits__ =3D 'Copyright (C) 2005 Purdue University' __date__ =3D '27 Jun 2005' __author__ =3D """Matthew Wirges <wi...@pu...> Modified: trunk/pyvscd/pyssus/data.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/data.py 2005-08-31 02:38:46 UTC (rev 424) +++ trunk/pyvscd/pyssus/data.py 2005-08-31 02:49:38 UTC (rev 425) @@ -19,7 +19,7 @@ server. """ =20 -__version__ =3D '0.1' +__version__ =3D '1.0' __credits__ =3D 'Copyright (C) 2005 Purdue University' __date__ =3D '27 Jun 2005' __author__ =3D """Matthew Wirges <wi...@pu...> Modified: trunk/pyvscd/pyssus/handlers.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/handlers.py 2005-08-31 02:38:46 UTC (rev 424) +++ trunk/pyvscd/pyssus/handlers.py 2005-08-31 02:49:38 UTC (rev 425) @@ -22,7 +22,7 @@ store data in a data.NessusResult object. """ =20 -__version__ =3D '0.1' +__version__ =3D '1.0' __credits__ =3D 'Copyright (C) 2005 Purdue University' __date__ =3D '27 Jun 2005' __author__ =3D """Matthew Wirges <wi...@pu...> Modified: trunk/pyvscd/pyssus/message.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/message.py 2005-08-31 02:38:46 UTC (rev 424) +++ trunk/pyvscd/pyssus/message.py 2005-08-31 02:49:38 UTC (rev 425) @@ -18,7 +18,7 @@ by Nessus (NessusServerMessage, and NessusClientMessage). """ =20 -__version__ =3D '0.1' +__version__ =3D '1.0' __author__ =3D """Matthew L Wirges <wi...@pu...> IT Security and Privacy Analyst Office of the Vice President for Information Technology |
From: <wi...@bi...> - 2005-08-31 02:37:33
|
Author: wirges Date: 2005-08-30 21:38:46 -0500 (Tue, 30 Aug 2005) New Revision: 424 Added: trunk/pyvscd/pyssus/test/pyssus-cli.py Modified: trunk/pyvscd/pyssus/MANIFEST.in trunk/pyvscd/pyssus/__init__.py trunk/pyvscd/pyssus/comm.py trunk/pyvscd/pyssus/commands.py trunk/pyvscd/pyssus/data.py trunk/pyvscd/pyssus/docs/pyssus.comm.html trunk/pyvscd/pyssus/docs/pyssus.handlers.html trunk/pyvscd/pyssus/docs/pyssus.html trunk/pyvscd/pyssus/docs/pyssus.message.html trunk/pyvscd/pyssus/handlers.py trunk/pyvscd/pyssus/message.py trunk/pyvscd/pyssus/test/pyssus-test.py Log: Added license tag to all relevant files, rebuilt documentation for all fi= les except pyssus.commands which is failing at the moment. Also added pyssus-cli.py script to the test dir Modified: trunk/pyvscd/pyssus/MANIFEST.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/MANIFEST.in 2005-08-30 14:17:05 UTC (rev 423) +++ trunk/pyvscd/pyssus/MANIFEST.in 2005-08-31 02:38:46 UTC (rev 424) @@ -1,2 +1,2 @@ include *.py -include INSTALL USAGE docs/* test/* +include INSTALL LICENSE USAGE docs/* test/* Modified: trunk/pyvscd/pyssus/__init__.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/__init__.py 2005-08-30 14:17:05 UTC (rev 423) +++ trunk/pyvscd/pyssus/__init__.py 2005-08-31 02:38:46 UTC (rev 424) @@ -1,4 +1,11 @@ """ +{{{ +This library is made available under the +University of Illinois/NCSA Open Source License.=20 +See the LICENSE file in the distribution or +http://mother.itsp.purdue.edu/~wirges/LICENSE +}}} + pyssus "pie-suss" Nessus Library for Python =20 Modified: trunk/pyvscd/pyssus/comm.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/comm.py 2005-08-30 14:17:05 UTC (rev 423) +++ trunk/pyvscd/pyssus/comm.py 2005-08-31 02:38:46 UTC (rev 424) @@ -1,4 +1,11 @@ """ +{{{ +This library is made available under the +University of Illinois/NCSA Open Source License.=20 +See the LICENSE file in the distribution or=20 +http://mother.itsp.purdue.edu/~wirges/LICENSE +}}} + pyssus: a nessus communicate library in python =20 pyssus.comm: Modified: trunk/pyvscd/pyssus/commands.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/commands.py 2005-08-30 14:17:05 UTC (rev 423) +++ trunk/pyvscd/pyssus/commands.py 2005-08-31 02:38:46 UTC (rev 424) @@ -1,4 +1,10 @@ """ +{{{ +This library is made available under the=20 +University of Illinois/NCSA Open Source License. =20 +See the LICENSE file in the distribution or=20 +http://mother.itsp.purdue.edu/~wirges/LICENSE +}}} pyssus: a nessus communicate library in python =20 pyssus.commands: Modified: trunk/pyvscd/pyssus/data.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/data.py 2005-08-30 14:17:05 UTC (rev 423) +++ trunk/pyvscd/pyssus/data.py 2005-08-31 02:38:46 UTC (rev 424) @@ -1,4 +1,11 @@ """ +{{{ +This library is made available under the +University of Illinois/NCSA Open Source License.=20 +See the LICENSE file in the distribution or +http://mother.itsp.purdue.edu/~wirges/LICENSE +}}} + pyssus: a nessus communicate library in python =20 pyssus.data: Modified: trunk/pyvscd/pyssus/docs/pyssus.comm.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/docs/pyssus.comm.html 2005-08-30 14:17:05 UTC (re= v 423) +++ trunk/pyvscd/pyssus/docs/pyssus.comm.html 2005-08-31 02:38:46 UTC (re= v 424) @@ -8,9 +8,16 @@ <td valign=3Dbottom> <br> <font color=3D"#ffffff" face=3D"helvetica, arial"> <br><big><big><s= trong><a href=3D"pyssus.html"><font color=3D"#ffffff">pyssus</font></a>.c= omm</strong></big></big> (version 0.1, 15 Jun 2005)</font></td ><td align=3Dright valign=3Dbottom -><font color=3D"#ffffff" face=3D"helvetica, arial"><a href=3D".">index</= a><br><a href=3D"file:/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus= /docs/pyssus/comm.py">/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus= /docs/pyssus/comm.py</a></font></td></tr></table> - <p><tt>pyssus: a nessus communicate library = ;in python<br> +><font color=3D"#ffffff" face=3D"helvetica, arial"><a href=3D".">index</= a><br><a href=3D"file:/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus= /comm.py">/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus/comm.py</a>= </font></td></tr></table> + <p><tt>{{{<br> +This library is made available under the<b= r> +University of Illinois/NCSA Open Source License= . <br> +See the LICENSE file in the distribution&n= bsp;or <br> +<a href=3D"http://mother.itsp.purdue.edu/~wirges/LICENSE">http://mother.= itsp.purdue.edu/~wirges/LICENSE</a><br> +}}}<br> <br> +pyssus: a nessus communicate library in py= thon<br> + <br> pyssus.comm:<br> <br> Nessus communications library <br> @@ -25,13 +32,14 @@ <font color=3D"#fffff" face=3D"helvetica, arial"><big><strong>Modules</s= trong></big></font></td></tr> =20 <tr><td bgcolor=3D"#aa55cc"><tt> </tt= ></td><td> </td> -<td width=3D"100%"><table width=3D"100%" summary=3D"list"><tr><td width=3D= "25%" valign=3Dtop><a href=3D"logging.html">logging</a><br> -<a href=3D"pyssus.message.html">pyssus.message</a><br> -</td><td width=3D"25%" valign=3Dtop><a href=3D"select.html">select</a><b= r> -<a href=3D"socket.html">socket</a><br> -</td><td width=3D"25%" valign=3Dtop><a href=3D"sys.html">sys</a><br> -<a href=3D"time.html">time</a><br> -</td><td width=3D"25%" valign=3Dtop></td></tr></table></td></tr></table>= <p> +<td width=3D"100%"><table width=3D"100%" summary=3D"list"><tr><td width=3D= "25%" valign=3Dtop><a href=3D"OpenSSL.SSL.html">OpenSSL.SSL</a><br> +<a href=3D"logging.html">logging</a><br> +</td><td width=3D"25%" valign=3Dtop><a href=3D"pyssus.message.html">pyss= us.message</a><br> +<a href=3D"select.html">select</a><br> +</td><td width=3D"25%" valign=3Dtop><a href=3D"socket.html">socket</a><b= r> +<a href=3D"sys.html">sys</a><br> +</td><td width=3D"25%" valign=3Dtop><a href=3D"time.html">time</a><br> +</td></tr></table></td></tr></table><p> <table width=3D"100%" cellspacing=3D0 cellpadding=3D2 border=3D0 summary= =3D"section"> <tr bgcolor=3D"#ee77aa"> <td colspan=3D3 valign=3Dbottom> <br> @@ -130,6 +138,11 @@ port (int) --&= nbsp;Nessus server port (default: 1241)<br> log (Logger) -- loggi= ng facility [logging module] (default: None)</tt= ></dd></dl> =20 +<dl><dt><a name=3D"NessusConx-close"><strong>close</strong></a>(self)</d= t><dd><tt>Closes the <a href=3D"#NessusConx">NessusConx</a>'s&n= bsp;socket<br> + <br> +Returns: True<br> +Raises: socket.error</tt></dd></dl> + <dl><dt><a name=3D"NessusConx-login"><strong>login</strong></a>(self, us= er, passwd)</dt><dd><tt>logs into the nessus server.<= br> After successful protocol negotiation, the ness= us server will<br> request the user's name and password.<br> @@ -202,9 +215,22 @@ <font color=3D"#000000" face=3D"helvetica, arial"><a name=3D"NessusSSLCo= nx">class <strong>NessusSSLConx</strong></a>(<a href=3D"pyssus.comm.html#= NessusConx">NessusConx</a>)</font></td></tr> =20 <tr bgcolor=3D"#ffc8d8"><td rowspan=3D2><tt> </tt></td> -<td colspan=3D2><tt># SSL version of the conx&n= bsp;<a href=3D"__builtin__.html#object">object</a><br> </tt></td></t= r> +<td colspan=3D2><tt>SSL version of <a href=3D"#NessusConx= ">NessusConx</a> <br> +Added by Jeremy Baumgartner <baumgart@cae.wisc.ed= u><br> </tt></td></tr> <tr><td> </td> -<td width=3D"100%">Methods inherited from <a href=3D"pyssus.comm.html#Ne= ssusConx">NessusConx</a>:<br> +<td width=3D"100%">Methods defined here:<br> +<dl><dt><a name=3D"NessusSSLConx-close"><strong>close</strong></a>(self)= </dt><dd><tt>Closes the <a href=3D"#NessusConx">NessusConx</a>'= s socket<br> + <br> +Returns: True<br> +Raises: socket.error</tt></dd></dl> + +<dl><dt><a name=3D"NessusSSLConx-open"><strong>open</strong></a>(self)</= dt><dd><tt>Opens the <a href=3D"#NessusConx">NessusConx</a>'s&n= bsp;socket to the Nessus server<br> + <br> +Returns: true on success<br> +Raises: <a href=3D"#NessusConnectionError">NessusConnectionError</a= ></tt></dd></dl> + +<hr> +Methods inherited from <a href=3D"pyssus.comm.html#NessusConx">NessusCon= x</a>:<br> <dl><dt><a name=3D"NessusSSLConx-__init__"><strong>__init__</strong></a>= (self, server, port<font color=3D"#909090">=3D1241</font>, log<font color= =3D"#909090">=3DNone</font>)</dt><dd><tt>Creates a new <a = href=3D"#NessusConx">NessusConx</a> <a href=3D"__builtin__.html#obje= ct">object</a> and sets up defaults.<br> <br> Keyword arguments:<br> @@ -225,11 +251,6 @@ <br> Note: we need to better handle the au= thentication failed bit.</tt></dd></dl> =20 -<dl><dt><a name=3D"NessusSSLConx-open"><strong>open</strong></a>(self)</= dt><dd><tt>Opens the <a href=3D"#NessusConx">NessusConx</a>'s&n= bsp;socket to the Nessus server<br> - <br> -Returns: true on success<br> -Raises: <a href=3D"#NessusConnectionError">NessusConnectionError</a= ></tt></dd></dl> - <dl><dt><a name=3D"NessusSSLConx-readMessage"><strong>readMessage</stron= g></a>(self)</dt><dd><tt>read the next message from&n= bsp;the Nessus server<br> <br> Returns: NessusServerMessage or None<br> Modified: trunk/pyvscd/pyssus/docs/pyssus.handlers.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/docs/pyssus.handlers.html 2005-08-30 14:17:05 UTC= (rev 423) +++ trunk/pyvscd/pyssus/docs/pyssus.handlers.html 2005-08-31 02:38:46 UTC= (rev 424) @@ -8,9 +8,16 @@ <td valign=3Dbottom> <br> <font color=3D"#ffffff" face=3D"helvetica, arial"> <br><big><big><s= trong><a href=3D"pyssus.html"><font color=3D"#ffffff">pyssus</font></a>.h= andlers</strong></big></big> (version 0.1, 27 Jun 2005)</font></td ><td align=3Dright valign=3Dbottom -><font color=3D"#ffffff" face=3D"helvetica, arial"><a href=3D".">index</= a><br><a href=3D"file:/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus= /docs/pyssus/handlers.py">/home/wirges/www/devel/vscrepos/trunk/pyvscd/py= ssus/docs/pyssus/handlers.py</a></font></td></tr></table> - <p><tt>pyssus: a nessus communicate library = ;in python<br> +><font color=3D"#ffffff" face=3D"helvetica, arial"><a href=3D".">index</= a><br><a href=3D"file:/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus= /handlers.py">/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus/handler= s.py</a></font></td></tr></table> + <p><tt>{{{<br> +This library is made available under the<b= r> +University of Illinois/NCSA Open Source License= . <br> +See the LICENSE file in the distribution&n= bsp;or<br> +<a href=3D"http://mother.itsp.purdue.edu/~wirges/LICENSE">http://mother.= itsp.purdue.edu/~wirges/LICENSE</a><br> +}}}<br> <br> +pyssus: a nessus communicate library in py= thon<br> + <br> pyssus.handlers:<br> This module of the package pr= ovides handler objects<br> for handling data sent by the= Nessus server.<br> Modified: trunk/pyvscd/pyssus/docs/pyssus.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/docs/pyssus.html 2005-08-30 14:17:05 UTC (rev 423= ) +++ trunk/pyvscd/pyssus/docs/pyssus.html 2005-08-31 02:38:46 UTC (rev 424= ) @@ -8,11 +8,18 @@ <td valign=3Dbottom> <br> <font color=3D"#ffffff" face=3D"helvetica, arial"> <br><big><big><s= trong>pyssus</strong></big></big></font></td ><td align=3Dright valign=3Dbottom -><font color=3D"#ffffff" face=3D"helvetica, arial"><a href=3D".">index</= a><br><a href=3D"file:/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus= /docs/pyssus/__init__.py">/home/wirges/www/devel/vscrepos/trunk/pyvscd/py= ssus/docs/pyssus/__init__.py</a></font></td></tr></table> - <p><tt>pyssus "pie-suss"<br> -Nessus Library for Python<br> +><font color=3D"#ffffff" face=3D"helvetica, arial"><a href=3D".">index</= a><br><a href=3D"file:/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus= /__init__.py">/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus/__init_= _.py</a></font></td></tr></table> + <p><tt>{{{<br> +This library is made available under the<b= r> +University of Illinois/NCSA Open Source License= . <br> +See the LICENSE file in the distribution&n= bsp;or<br> +<a href=3D"http://mother.itsp.purdue.edu/~wirges/LICENSE">http://mother.= itsp.purdue.edu/~wirges/LICENSE</a><br> +}}}<br> <br> -Copyright (C) 2005 - Purdue University</tt></p> + pyssus "pie-suss"<br> + Nessus Library for Python<br> + <br> + Copyright (C) 2005 - Purdue U= niversity</tt></p> <p> <table width=3D"100%" cellspacing=3D0 cellpadding=3D2 border=3D0 summary= =3D"section"> <tr bgcolor=3D"#aa55cc"> Modified: trunk/pyvscd/pyssus/docs/pyssus.message.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/docs/pyssus.message.html 2005-08-30 14:17:05 UTC = (rev 423) +++ trunk/pyvscd/pyssus/docs/pyssus.message.html 2005-08-31 02:38:46 UTC = (rev 424) @@ -8,9 +8,16 @@ <td valign=3Dbottom> <br> <font color=3D"#ffffff" face=3D"helvetica, arial"> <br><big><big><s= trong><a href=3D"pyssus.html"><font color=3D"#ffffff">pyssus</font></a>.m= essage</strong></big></big> (version 0.1, 14 Jun 2005)</font></td ><td align=3Dright valign=3Dbottom -><font color=3D"#ffffff" face=3D"helvetica, arial"><a href=3D".">index</= a><br><a href=3D"file:/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus= /docs/pyssus/message.py">/home/wirges/www/devel/vscrepos/trunk/pyvscd/pys= sus/docs/pyssus/message.py</a></font></td></tr></table> - <p><tt>pyssus: a nessus communicate library = ;in python<br> +><font color=3D"#ffffff" face=3D"helvetica, arial"><a href=3D".">index</= a><br><a href=3D"file:/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus= /message.py">/home/wirges/www/devel/vscrepos/trunk/pyvscd/pyssus/message.= py</a></font></td></tr></table> + <p><tt>{{{<br> +This library is made available under the<b= r> +University of Illinois/NCSA Open Source License= . <br> +See the LICENSE file in the distribution&n= bsp;or<br> +<a href=3D"http://mother.itsp.purdue.edu/~wirges/LICENSE">http://mother.= itsp.purdue.edu/~wirges/LICENSE</a><br> +}}}<br> <br> +pyssus: a nessus communicate library in py= thon<br> + <br> pyssus.message:<br> NTP Message Classes<br> <br> Modified: trunk/pyvscd/pyssus/handlers.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/handlers.py 2005-08-30 14:17:05 UTC (rev 423) +++ trunk/pyvscd/pyssus/handlers.py 2005-08-31 02:38:46 UTC (rev 424) @@ -1,4 +1,11 @@ """ +{{{ +This library is made available under the +University of Illinois/NCSA Open Source License.=20 +See the LICENSE file in the distribution or +http://mother.itsp.purdue.edu/~wirges/LICENSE +}}} + pyssus: a nessus communicate library in python =20 pyssus.handlers: Modified: trunk/pyvscd/pyssus/message.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/message.py 2005-08-30 14:17:05 UTC (rev 423) +++ trunk/pyvscd/pyssus/message.py 2005-08-31 02:38:46 UTC (rev 424) @@ -1,4 +1,11 @@ """ +{{{ +This library is made available under the +University of Illinois/NCSA Open Source License.=20 +See the LICENSE file in the distribution or +http://mother.itsp.purdue.edu/~wirges/LICENSE +}}} + pyssus: a nessus communicate library in python =20 pyssus.message: Added: trunk/pyvscd/pyssus/test/pyssus-cli.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/test/pyssus-cli.py 2005-08-30 14:17:05 UTC (rev 4= 23) +++ trunk/pyvscd/pyssus/test/pyssus-cli.py 2005-08-31 02:38:46 UTC (rev 4= 24) @@ -0,0 +1,105 @@ +#!/usr/bin/python2.4 +""" +{{{ +This library is made available under the +University of Illinois/NCSA Open Source License.=20 +See the LICENSE file in the distribution or +http://mother.itsp.purdue.edu/~wirges/LICENSE +}}} +""" +import sys +sys.path.append('../../') + +from pyssus import * +from optparse import OptionParser +from socket import error as socket_error +import logging + + +class myHandler(handlers.NessusStatusHandler): + def handle(self, args): + (prefix) =3D args + egads("%s: %s --> %s (%s)" % (prefix, self.type, self.host, self.s= tatus)) + +def egads(arg): + print arg + +def __main__(): + =20 + usage =3D "usage: %prog [options] [hosts]" + parser =3D OptionParser(usage=3Dusage) + parser.add_option('-N', '--nessus', dest=3D'nessus', help=3D'nessus s= erver:port:user:pass') + parser.add_option('-d', '--debug', action=3D'store_true', dest=3D'deb= ug', help=3D'enable debugging') + parser.add_option('-P', '--plugins', dest=3D'plugins', help=3D'plugin= s to scan') + parser.add_option('-p', '--prefs',dest=3D'preferences', help=3D'nessu= sd preferences') + (options, args) =3D parser.parse_args() + if not options.nessus: + parser.print_help() + sys.exit(-1) + + logging.basicConfig() + log =3D logging.getLogger('libnessus') + if options.debug: + log.setLevel(logging.DEBUG) + log.debug('Debugging enabled') + + if options.plugins: + plugin_list =3D options.plugins.split(",") + else: + plugin_list =3D [] + =20 + prefs =3D {} + if options.preferences: + t_prefs =3D options.preferences.split(":") + for t_opt in t_prefs: + (key,value) =3D t_opt.split("=3D") + prefs[key] =3D value + + (nhost, nport, nuser, npass) =3D options.nessus.split(":") + cx_log =3D logging.getLogger('NessusConx') + if options.debug: + cx_log.setLevel(logging.DEBUG) + cx =3D comm.NessusConx(nhost, nport, cx_log) + cx.setOpts([ comm.CommOpt_FastLogin, comm.CommOpt_Timestamps ]) + log.debug("Opening connection to nhost:nport...") + if cx.open(): + log.debug("Connection to Nessus opened, logging in...") + try: + cx.login("vscan","sc4nm3") + except comm.NessusLoginException, nle: + print "Error logging in: " + nle + sys.exit(-1) + + log.debug("Logged in, processing..") + =20 + #let's send our preferences + try: + prefs =3D commands.NessusSendPreferences(cx, \ + prefs, \ + plugin_list, {}) + res =3D prefs.sendPreferences() + if not res: + log.warn("There was an error sending our preferences - shoul= d we bail?") + except commands.NessusCommandError, nce: + log.warn("error processing pref command: %s", str(nce)) + try: + attack =3D commands.NessusAttack(cx, args, log) + attack.registerHandler(message.Server.STATUS, myHandler, ("stat= us")) + attack.attack() + except socket_error,se: + log.warn(se) + log.warn("Scan cxmay have ended prematurely") + =20 + + #print attack.getData().__str__() + =20 + for host in attack.getData().hosts.itervalues(): + #if type(host) !=3D type(data.NessusHost): + # continue + ip =3D host.getIP() + results =3D [r.getPlugin() for r in host.results] + print "%s|%s" % (ip, ",".join(results)) + + +if __name__ =3D=3D '__main__': + __main__() Property changes on: trunk/pyvscd/pyssus/test/pyssus-cli.py ___________________________________________________________________ Name: svn:executable + * Modified: trunk/pyvscd/pyssus/test/pyssus-test.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/test/pyssus-test.py 2005-08-30 14:17:05 UTC (rev = 423) +++ trunk/pyvscd/pyssus/test/pyssus-test.py 2005-08-31 02:38:46 UTC (rev = 424) @@ -1,5 +1,12 @@ #!/usr/bin/python2.4 - +""" +{{{ +This library is made available under the +University of Illinois/NCSA Open Source License.=20 +See the LICENSE file in the distribution or +http://mother.itsp.purdue.edu/~wirges/LICENSE +}}} +""" import sys sys.path.append('../../') =20 |
From: <wi...@bi...> - 2005-08-30 14:15:55
|
Author: wirges Date: 2005-08-30 09:17:05 -0500 (Tue, 30 Aug 2005) New Revision: 423 Added: trunk/pyvscd/pyssus/LICENSE Log: Added license to release Added: trunk/pyvscd/pyssus/LICENSE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/LICENSE 2005-08-29 21:04:46 UTC (rev 422) +++ trunk/pyvscd/pyssus/LICENSE 2005-08-30 14:17:05 UTC (rev 423) @@ -0,0 +1,28 @@ + Copyright (c) 2002-2005 Purdue University + All rights reserved. +=20 + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal with the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: +=20 + Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + Neither the names of Matthew Wirges, ITaP Security and Policy, CERIAS,=20 + Purdue University, nor the names of its contributors may be used to=20 + endorse or promote products derived from this Software without specific= =20 + prior written permission.=20 +=20 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT= , + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. Property changes on: trunk/pyvscd/pyssus/LICENSE ___________________________________________________________________ Name: svn:executable + * |
From: <wi...@bi...> - 2005-08-29 21:03:34
|
Author: wirges Date: 2005-08-29 16:04:46 -0500 (Mon, 29 Aug 2005) New Revision: 422 Modified: branches/vsc-2.0/Main/index.php branches/vsc-2.0/Main/tpl/Host_Scan-host_select_widget.tpl Log: Addressed ticket #102 and fixed that pesky issue that caused host list to start in the middle o= f the textarea in quickrequest Modified: branches/vsc-2.0/Main/index.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/index.php 2005-08-29 20:39:54 UTC (rev 421) +++ branches/vsc-2.0/Main/index.php 2005-08-29 21:04:46 UTC (rev 422) @@ -43,6 +43,11 @@ $INC_PATH=3D'.'; require $INC_PATH."/include/core.inc"; =20 + if (isset($_COOKIE[$_CONFIG['COOKIE']])) { + header("Location: ./main.php"); + exit(0); + } + UI_Header("Welcome"); =20 echo "<img src=3D'$IMAGE_PATH/image/title_vsc.gif' alt=3D'Vulnerability= Scanning Cluster'>";=09 Modified: branches/vsc-2.0/Main/tpl/Host_Scan-host_select_widget.tpl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/tpl/Host_Scan-host_select_widget.tpl 2005-08-29= 20:39:54 UTC (rev 421) +++ branches/vsc-2.0/Main/tpl/Host_Scan-host_select_widget.tpl 2005-08-29= 21:04:46 UTC (rev 422) @@ -16,9 +16,7 @@ {/foreach} </ul> </td> - <td><textarea name=3D'host_string' value=3D'{$host_string}' rows=3D= '6' cols=3D'40'> - {$host_string} - </textarea> + <td><textarea name=3D'host_string' value=3D'{$host_string}' rows=3D= '6' cols=3D'40'>{$host_string}</textarea> <input type=3D'submit' name=3D'process' value=3D'Add'> <br /> Examples: |
From: <wi...@bi...> - 2005-08-29 20:38:42
|
Author: wirges Date: 2005-08-29 15:39:54 -0500 (Mon, 29 Aug 2005) New Revision: 421 Modified: branches/vsc-2.0/Main/Host/Scan/request.php Log: Addressed trivial #96 Modified: branches/vsc-2.0/Main/Host/Scan/request.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/Host/Scan/request.php 2005-08-29 16:25:30 UTC (= rev 420) +++ branches/vsc-2.0/Main/Host/Scan/request.php 2005-08-29 20:39:54 UTC (= rev 421) @@ -537,7 +537,7 @@ </script> <table> <tr> - <td>Enter a date in the form Month/Day/year:</td> + <td>Enter a date in the form Month/Day/Year:</td> <td align=3D'left'><input type=3D'text' name=3D'start_dat= e' value=3D'<?=3D$tmp_date?>'></td> <td align=3D'left'>or <A HREF=3D"#" onClick=3D"cal.select= (document.dateform.start_date,'anchor','MM/dd/yyyy'); return false;" TITL= E=3D"cal.select(document.dateform.start_date,'anchor','MM/dd/yyyy'); retu= rn false;" NAME=3D"anchor" ID=3D"anchor">select from calendar</A></td> </tr> |
From: <wi...@bi...> - 2005-08-29 16:24:18
|
Author: wirges Date: 2005-08-29 11:25:30 -0500 (Mon, 29 Aug 2005) New Revision: 420 Modified: branches/vsc-2.0/Main/Host/Scan/Metric/include/libmetric.inc branches/vsc-2.0/Main/Host/Scan/quickscan.php branches/vsc-2.0/Main/Host/Scan/request.php branches/vsc-2.0/Main/People/Privilege/request_form.php branches/vsc-2.0/Main/tpl/People_Privilege-request_form.tpl Log: Addressed tickets #109 and #90 Replaced domain creation request formmail on priv request page with instr= uctions to send email to $_CONFIG['sys_email'] with the appropriate infor= mation. Also made the privilege request submit form button stand out bet= ter. Finally, after privilege reuqest is made, the user is told what an= d where they requested privileges. No invalid Policy IDs should be added to scan requests from now one. Als= o modified scan request wizard to use new policy display template. Modified: branches/vsc-2.0/Main/Host/Scan/Metric/include/libmetric.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/Host/Scan/Metric/include/libmetric.inc 2005-08-= 26 16:36:38 UTC (rev 419) +++ branches/vsc-2.0/Main/Host/Scan/Metric/include/libmetric.inc 2005-08-= 29 16:25:30 UTC (rev 420) @@ -23,6 +23,7 @@ function normalizeSeverityText($severity_text) { // one possible feature later is to allow a user to specify these disti= nctions switch(strtolower($severity_text)) { + case "critical": case "serious": case "high": case "severe": Modified: branches/vsc-2.0/Main/Host/Scan/quickscan.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/Host/Scan/quickscan.php 2005-08-26 16:36:38 UTC= (rev 419) +++ branches/vsc-2.0/Main/Host/Scan/quickscan.php 2005-08-29 16:25:30 UTC= (rev 420) @@ -36,7 +36,7 @@ $i =3D new CORE_FormInput($input); =20 /* processing */ -if ($i->policy_id =3D=3D "") { +if ($i->policy_id =3D=3D "" || $i->policy_id =3D=3D 0) { $i->policy_id =3D POLICY_GetIDByName('Full Scan', $_CONFIG['ROOT_DOMA= IN']); } $hostids =3D array(); Modified: branches/vsc-2.0/Main/Host/Scan/request.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/Host/Scan/request.php 2005-08-26 16:36:38 UTC (= rev 419) +++ branches/vsc-2.0/Main/Host/Scan/request.php 2005-08-29 16:25:30 UTC (= rev 420) @@ -281,7 +281,7 @@ =20 case 6: =20 - if ($i->policy =3D=3D "" or $i->policy =3D=3D "--")=20 + if ($i->policy =3D=3D "" or $i->policy =3D=3D "--" or $i->po= licy =3D=3D 0)=20 UI_Style("Please select a policy.", STY_BOLD); else { $__scan['policy_id'] =3D $i->policy; @@ -726,6 +726,11 @@ =20 UI_Form(); echo "<input type=3D'hidden' name=3D'step' value=3D'6'>"; + /* + Removed in favor of simple code; POLICY_GetAggregateDisplayable= s=20 + performs the bulk of the operations in this chunk, and the Smar= ty + template gives the user a better list of policies. + $domain_list =3D Domain_ReverseMakeList($_USER['domain'], $_USE= R['dominate']); if (DEBUG_ME) UI_print_r($domain_list); if (!in_array($_CONFIG['ROOT_DOMAIN'], $domain_list)) $domain_l= ist[] =3D $_CONFIG['ROOT_DOMAIN']; @@ -753,6 +758,13 @@ } } echo "</select><br>"; + */ + $policies =3D POLICY_GetAggregateDisplayables($_USER['domain'],= $_USER['dominate']); + $smarty->assign('element_name', 'policy'); + #$smarty->assign('selected_pol', ''); + $smarty->assign('policies', $policies); + $smarty->display('Host_Scan-domain_policy_list.tpl'); + =20 ?> <input type=3D'submit' name=3D'action' value=3D'Back'> <input type=3D'submit' name=3D'action' value=3D'Next'> Modified: branches/vsc-2.0/Main/People/Privilege/request_form.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/People/Privilege/request_form.php 2005-08-26 16= :36:38 UTC (rev 419) +++ branches/vsc-2.0/Main/People/Privilege/request_form.php 2005-08-29 16= :25:30 UTC (rev 420) @@ -96,7 +96,7 @@ Error("You did not supply a domain request!", ERR_FATAL); } =20 -} else if ($i->action =3D=3D 'Request Privilege') { +} else if ($i->action =3D=3D 'Submit Privilege Request') { //process request //look for vodka induced vulnerabilities here :-) =20 @@ -111,7 +111,7 @@ =20 Priv_MailRequestNotice($_USER['userid'], $i->privilege, $i->cdomain); =20 - echo "<h4>Your privilege request has been sent. You will be notified= of its approval or denial via email after an administrator has reviewed = it.</h4>"; + echo "<h4>Your privilege request for `{$i->privilege}' privileges in = domain `{$i->cdomain}' has been sent. You will be notified of its approv= al or denial via email after an administrator has reviewed it.</h4>"; UI_Footer(); die(); =20 @@ -131,6 +131,7 @@ $smarty->assign('priority', $i->priority); $smarty->assign('cdomains',$cdomains); $smarty->assign('cdomain',$i->cdomain); +$smarty->assign('sys_email', $_CONFIG['SYS_EMAIL']); =20 $smarty->display('People_Privilege-request_form.tpl'); UI_Footer(); Modified: branches/vsc-2.0/Main/tpl/People_Privilege-request_form.tpl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/tpl/People_Privilege-request_form.tpl 2005-08-2= 6 16:36:38 UTC (rev 419) +++ branches/vsc-2.0/Main/tpl/People_Privilege-request_form.tpl 2005-08-2= 9 16:25:30 UTC (rev 420) @@ -45,17 +45,21 @@ <input type=3D'submit' name=3D'action' value=3D'Show Parent'> <br /> <input type=3D'submit' name=3D'action' value=3D'Show Child Doma= ins'> - <br /> - <input type=3D'submit' name=3D'action' value=3D'Request Privile= ge'> + <br /><br /> + <input type=3D'submit' name=3D'action' value=3D'Submit Privileg= e Request '> </td> </tr> <tr> <td colspan=3D'2'> <br /> - <h4>Or Request a New Domain</h4> + If you were unable to locate an adequate domain, you may reques= t that a + domain be created for you. To do so, please send email to=20 + <a href=3D'mailto:{$sys_email}?Subject=3DDomain+Request'>{$sys_= email}</a> + and include the name you would like for your domain, your depar= tment,=20 + and all IP network ranges which contain systems under your cont= rol. </td> </tr> - <tr> + <!--tr> <td> <textarea name=3D'new_domain' cols=3D'40' rows=3D'8'> Domain: @@ -75,7 +79,7 @@ <li>The subnets (in CIDR notation, e.g. 128.210.11.0/24) uti= lized by your department <li>Reason for the request. </ul> <p>Once we have received this information, we will contact you = once the domain has been created so you can request privileges in it. = </td> - </tr> + </tr--> =20 </table> </form> |
From: <wi...@bi...> - 2005-08-26 16:35:28
|
Author: wirges Date: 2005-08-26 11:36:38 -0500 (Fri, 26 Aug 2005) New Revision: 419 Modified: branches/vsc-2.0/Main/People/Session/logout.php Log: Fixed logout such that headers aren't sent before the user is actually lo= gged out.. #117 Modified: branches/vsc-2.0/Main/People/Session/logout.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/People/Session/logout.php 2005-08-25 20:15:18 U= TC (rev 418) +++ branches/vsc-2.0/Main/People/Session/logout.php 2005-08-26 16:36:38 U= TC (rev 419) @@ -48,13 +48,14 @@ header("Set-Cookie: {$_CONFIG['COOKIE']}=3D; path=3D{$_CONFIG['PATH']};=20 expires=3DThu, 01-Jan-1970 00:00:01 GMT"); =20 -UI_Header("Logged out..."); DB_GetResult(" UPDATE session_log SET ended=3D '" .time()=20 ."', status =3D 'closed'=20 WHERE sessionid=3D'{$_USER["sid"]}' "); +$_USER =3D array(); +UI_Header("Logged out..."); echo "You are now logged out, thank you for visiting the VSC.<br>"; echo "<A HREF=3D'$IMAGE_PATH/index.php'>login </A><br><br>"; =20 |
From: <wi...@bi...> - 2005-08-25 20:14:11
|
Author: wirges Date: 2005-08-25 15:15:18 -0500 (Thu, 25 Aug 2005) New Revision: 418 Modified: branches/vsc-2.0/Main/Domain/include/public.inc branches/vsc-2.0/Main/Domain/ui/public.inc Log: Merged in patches from Warren @ UIUC to add quick navigation to domains i= n which a user has explicit privileges. See #119 Modified: branches/vsc-2.0/Main/Domain/include/public.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/Domain/include/public.inc 2005-08-16 16:15:46 U= TC (rev 417) +++ branches/vsc-2.0/Main/Domain/include/public.inc 2005-08-25 20:15:18 U= TC (rev 418) @@ -80,6 +80,7 @@ AND userid=3D'$username' "); $_USER['domain'] =3D $domain; + $_USER['priv'] =3D $ret['priv']; return $ret; } } @@ -157,4 +158,19 @@ } return $rarr; } + +function Domain_PrivDomain($username) { + $privdom =3D array(); + $priv_res =3D DB_GetResult("SELECT domain_name + FROM privilege + WHERE userid =3D '$username' + ORDER BY domain_name ASC + "); + + while ($priv_arr =3D DB_FetchArray($priv_res)) { + $privdom[] =3D $priv_arr['domain_name']; + } + return $privdom; + +} ?> Modified: branches/vsc-2.0/Main/Domain/ui/public.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/Domain/ui/public.inc 2005-08-16 16:15:46 UTC (r= ev 417) +++ branches/vsc-2.0/Main/Domain/ui/public.inc 2005-08-25 20:15:18 UTC (r= ev 418) @@ -70,6 +70,7 @@ Domain_ChangeDomain($i->newdomain, $_USER['userid'], $_USER['sid']); } $chld_d =3D Domain_GetChildren($_USER['domain']); + $priv_d =3D Domain_PrivDomain($_USER['userid']); /* if ($chld_d =3D=3D NULL) { UI_Style("No domain available.", STY_ITALIC|STY_BOLD); @@ -97,7 +98,22 @@ } else {=09 echo "1px 1px 1px 1px"; }=09 - echo "; border-color: black; border-style: solid;'>{$_USER['domain']}<= /td>"; + #echo "; border-color: black; border-style: solid;'>{$_USER['domain']}= </td>"; + #start + echo "; border-color: black; border-style: solid;'>"; + echo "<form action=3D'{$_SERVER['PHP_SELF']}' method=3D'POST'>"; + echo "<select name=3D'newdomain' onChange=3D'this.form.submit()'>"= ; + foreach ($priv_d as $cd) { + echo "<option value=3D'$cd' "; + if ($cd =3D=3D $_USER['domain']) echo "SELECTED=3DSELECTED"; + echo ">$cd</option>"; + } + echo "</select>"; + echo "<input type=3D'submit' value=3D'Switch'>"; + echo "</form>"; + echo "</td>"; + + #end echo "<td style=3D'border-width: 1px 1px 1px 1px; border-style: solid;= border-color: black;'>"; echo "<form action=3D'{$_SERVER['PHP_SELF']}' method=3D'POST'>"; echo "<select name=3D'newdomain' onChange=3D'this.form.submit()'>"= ; |
From: <wi...@bi...> - 2005-08-16 16:14:42
|
Author: wirges Date: 2005-08-16 11:15:46 -0500 (Tue, 16 Aug 2005) New Revision: 417 Modified: trunk/pyvscd/CHANGELOG trunk/pyvscd/libvscmt/nessusmt.py trunk/pyvscd/libvscmt/scan.py Log: 16AUG05 - Made changes to libvscmt.nessusmt: Added try/except blocks to nessus message handlers Fixed a bug in the Note handler which caused database connectio= n objects to be consumed without replacement thus causing some good ol'fa= shioned thread starvation. Applied a patch from Jeremy Baumgartner at UW to address an iss= ue with SCANNER_SET options.=20 Modified: trunk/pyvscd/CHANGELOG =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/CHANGELOG 2005-08-09 14:36:45 UTC (rev 416) +++ trunk/pyvscd/CHANGELOG 2005-08-16 16:15:46 UTC (rev 417) @@ -1,6 +1,15 @@ CHANGELOG ------------ =20 +16AUG05 - Made changes to libvscmt.nessusmt: + Added try/except blocks to nessus message handlers + Fixed a bug in the Note handler which caused database connecti= on objects + to be consumed without replacement thus causing some good ol'f= ashioned + thread starvation. + + Applied a patch from Jeremy Baumgartner at UW to address an is= sue with + SCANNER_SET options. + 07AUG05 - Made changes to nessus_plugins table to account for new/malfor= med severities in nessus plugins. pyssus library updated to properly strip whitespace from plugi= ns severities Modified: trunk/pyvscd/libvscmt/nessusmt.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/libvscmt/nessusmt.py 2005-08-09 14:36:45 UTC (rev 416) +++ trunk/pyvscd/libvscmt/nessusmt.py 2005-08-16 16:15:46 UTC (rev 417) @@ -148,11 +148,11 @@ #let's actually attack the host log.debug("attacking hosts: " + (",".join(host_map.keys()))) attack =3D commands.NessusAttack(cx, host_map.keys()) - attack.registerHandler(message.Server.TIME, VSCTimeHandler, = (self._dbq, self.scan_id, host_map)) - attack.registerHandler(message.Server.PORT, VSCPortHandler, = (self._dbq, self.scan_id, host_map)) - attack.registerHandler(message.Server.NOTE, VSCNoteHandler, = (self._dbq, self.scan_id, host_map)) - attack.registerHandler(message.Server.INFO, VSCInfoHandler, = (self._dbq, self.scan_id, host_map)) - attack.registerHandler(message.Server.HOLE, VSCHoleHandler, = (self._dbq, self.scan_id, host_map)) + attack.registerHandler(message.Server.TIME, VSCTimeHandler, = (self._dbq, self.scan_id, host_map, log)) + attack.registerHandler(message.Server.PORT, VSCPortHandler, = (self._dbq, self.scan_id, host_map, log)) + attack.registerHandler(message.Server.NOTE, VSCNoteHandler, = (self._dbq, self.scan_id, host_map, log)) + attack.registerHandler(message.Server.INFO, VSCInfoHandler, = (self._dbq, self.scan_id, host_map, log)) + attack.registerHandler(message.Server.HOLE, VSCHoleHandler, = (self._dbq, self.scan_id, host_map, log)) attack.attack() #log.info(attack.getData().__str__()) #db =3D self._dbq.get() @@ -249,20 +249,23 @@ Keyword Arguments: args - Tuple, db conx pool, scan_id, host_map(dict) """ - (dbq, scan_id, host_map) =3D args + (dbq, scan_id, host_map, log) =3D args if not host_map.has_key(self.host): return None - db =3D dbq.get() - c =3D db.cursor() - c.execute("BEGIN") try: + db =3D dbq.get() + c =3D db.cursor() + c.execute("BEGIN") host.saveNessusResult(db, scan_id, host_map[self.host], \ - (self.plugin, self.p_type, self.port, self.prot, self.messag= e)) - except: - db.rollback() - db.commit() - c.close() - dbq.put(db) + (self.plugin, self.p_type, self.port, self.prot, self.message)) + db.commit() + c.close() + dbq.put(db) + except Exception, e: + log.warn("Exception encountered while storing results!") + log.warn("Exception: %s" % (str(e))) + dbq.put(db) + =20 return True =20 #class VSCHoleHandler(handlers.NessusHoleHandler): @@ -280,18 +283,24 @@ Keyword Arguments: args - Tuple, db conx pool, scan_id, host_map(dict) """ - (dbq, scan_id, host_map) =3D args + (dbq, scan_id, host_map, log) =3D args if not host_map.has_key(self.host): return None #self.port, self.prot, self.service, self.host - db =3D dbq.get() - c =3D db.cursor() - c.execute("BEGIN") - if not host.hasPortOpen(db, scan_id, host_map[self.host], self.por= t, self.prot): - host.saveNessusResult(db, scan_id, host_map[self.host], ("10335= ", "INFO", self.port, self.prot, ["TCP Port Scan",])) - db.commit() - c.close() - dbq.put(db) + try: + db =3D dbq.get() + c =3D db.cursor() + c.execute("BEGIN") + if not host.hasPortOpen(db, scan_id, host_map[self.host], self.= port, self.prot): + host.saveNessusResult(db, scan_id, host_map[self.host], ("10= 335", "INFO", self.port, self.prot, ["TCP Port Scan",])) + db.commit() + c.close() + dbq.put(db) + except Exception, e: + log.warn("Exception while storing port data!") + log.warn("Exception: %s " % (str(e))) + dbq.put(db) + =20 return True =20 =20 @@ -304,18 +313,23 @@ """ #we only care if the host has finished scanning if self.type =3D=3D self.Time_HostEnd: - (dbq, scan_id, host_map) =3D args - db =3D dbq.get() + (dbq, scan_id, host_map, log) =3D args if not host_map.has_key(self.host.strip()): return None - c =3D db.cursor() - c.execute("BEGIN") - host.markHostFinished(db, scan_id, host_map[self.host]) - db.commit() - c.close() - dbq.put(db) - #remove this from the host_map because we are done with it - host_map.pop(self.host) + try: + db =3D dbq.get() + c =3D db.cursor() + c.execute("BEGIN") + host.markHostFinished(db, scan_id, host_map[self.host]) + db.commit() + c.close() + dbq.put(db) + #remove this from the host_map because we are done with it + host_map.pop(self.host) + except Exception, e: + log.warn("Exception encountered while storing host end data!= ") + log.warn("Exception: %s " % (str(e))) + dbq.put(db) return True else: return None @@ -332,15 +346,15 @@ """Processes plugin data """ (dbq,) =3D args - db =3D dbq.get() - c =3D db.cursor() - c.execute("BEGIN") + #db =3D dbq.get() + #c =3D db.cursor() + #c.execute("BEGIN") =20 for p in self.plugins: print "\t".join(p) =20 - db.commit() - c.close() - dbq.put(db) + #db.commit() + #c.close() + #dbq.put(db) return True =20 Modified: trunk/pyvscd/libvscmt/scan.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/libvscmt/scan.py 2005-08-09 14:36:45 UTC (rev 416) +++ trunk/pyvscd/libvscmt/scan.py 2005-08-16 16:15:46 UTC (rev 417) @@ -136,10 +136,15 @@ __sql__ =3D "SELECT name,value FROM nessus_config " + \ "WHERE section=3D'SCANNER_SET'" c.execute(__sql__) + log =3D logging.getLogger('libvscmt.scan.getPlugins') + log.debug("Executed SCANNER_SET query") for (name,value) in c: - if name not in rlist and value =3D=3D 'yes': + log.debug("Checking %s (%s)", name, value) + if name not in rlist and value =3D=3D 'Yes': + log.debug("Enabling %s", name) rlist.append(name) - elif name in rlist and value =3D=3D 'no': + elif name in rlist and value =3D=3D 'No': + log.debug("Disabling %s", name) rlist.remove(name) c.close() return rlist |
From: <wi...@bi...> - 2005-08-09 19:28:47
|
Author: wirges Date: 2005-08-09 09:36:45 -0500 (Tue, 09 Aug 2005) New Revision: 416 Modified: trunk/pyvscd/pyvscd.py Log: Added some additional try/except blocks for dealing with db.commit errors= during scan setup. Modified: trunk/pyvscd/pyvscd.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyvscd.py 2005-08-08 00:31:55 UTC (rev 415) +++ trunk/pyvscd/pyvscd.py 2005-08-09 14:36:45 UTC (rev 416) @@ -180,77 +180,85 @@ llog.debug("locking tables") =20 #lets prepare requets for scanning by batching hosts - c =3D db.cursor() - c.execute("BEGIN") - scan_id =3D scan.getNextScan(db) - scan_proc_count =3D scan.countScansProcessing(db) - if time_loops_recur >=3D 6: - llog.info("loading upcoming recurring scans") - ids =3D scan.promoteNextRecurScans(db) - if ids is not None: - llog.debug("The following new recurring scans have been load= ed: %s", ",".join(ids)) + try: + c =3D db.cursor() + c.execute("BEGIN") + scan_id =3D scan.getNextScan(db) + scan_proc_count =3D scan.countScansProcessing(db) + if time_loops_recur >=3D 6: + llog.info("loading upcoming recurring scans") + ids =3D scan.promoteNextRecurScans(db) + if ids is not None: + llog.debug("The following new recurring scans have been l= oaded: %s", ",".join(ids)) + #end if + time_loops_recur =3D 0 + else: + time_loops_recur +=3D 1 #end if - time_loops_recur =3D 0 - else: - time_loops_recur +=3D 1 - #end if - db.commit() - #llog.debug("max slots allowed: %s", slots_max) - while (scan_id is not None) and (scan_proc_count < __config__['max= _requests']): - c.execute("BEGIN") - llog.debug("Scan to process: %s (%s scans currently processing)= " % (scan_id, scan_proc_count)) - #retrieve necessary scan information (hosts, policy, etc...) - scan_hosts =3D scan.getScanHosts(db, scan_id) - scan_pol_id =3D scan.getPolicyID(db, scan_id) - llog.debug("[scan %s] %s hosts, using policy %s" % (scan_id, le= n(scan_hosts), scan_pol_id)) - #calculate scan batch sizing - pol_weight =3D scan.getPolicyWeight(db, scan_pol_id) - scan_batch_size =3D int(__config__['base_batch_size']) * int(po= l_weight) - #a batch can never be bigger than the maxium slots available - if scan_batch_size > int(__config__['node_max_hosts']): - scan_batch_size =3D int(__config__['node_max_hosts']) - llog.debug("batch size is %s =3D (%s * %s)" % (scan_batch_size,= __config__['base_batch_size'], pol_weight)) + db.commit() + #llog.debug("max slots allowed: %s", slots_max) + while (scan_id is not None) and (scan_proc_count < __config__['= max_requests']): + c.execute("BEGIN") + llog.debug("Scan to process: %s (%s scans currently processi= ng)" % (scan_id, scan_proc_count)) + #retrieve necessary scan information (hosts, policy, etc...) + scan_hosts =3D scan.getScanHosts(db, scan_id) + scan_pol_id =3D scan.getPolicyID(db, scan_id) + llog.debug("[scan %s] %s hosts, using policy %s" % (scan_id,= len(scan_hosts), scan_pol_id)) + #calculate scan batch sizing + pol_weight =3D scan.getPolicyWeight(db, scan_pol_id) + scan_batch_size =3D int(__config__['base_batch_size']) * int= (pol_weight) + #a batch can never be bigger than the maxium slots available + if scan_batch_size > int(__config__['node_max_hosts']): + scan_batch_size =3D int(__config__['node_max_hosts']) + llog.debug("batch size is %s =3D (%s * %s)" % (scan_batch_si= ze, __config__['base_batch_size'], pol_weight)) =20 - #okay, lets mark the scan queued - try: - scan.markScanQueued(db, scan_id) + #okay, lets mark the scan queued + try: + scan.markScanQueued(db, scan_id) =20 - #scan marked as queued, batching hosts - llog.debug("Batching hosts...") - host_count =3D 1 - batch_id =3D 1 - for host_id in scan_hosts: - if host_count > scan_batch_size: - batch_id +=3D 1 - host_count =3D 1 - llog.debug("new batch: %s" % (batch_id)) - else: - llog.debug("%s(%s) is not greater than %s (%s)", host_= count,type(host_count), scan_batch_size,type(scan_batch_size)) - #end if=20 - scan.setBatchID(db, scan_id, host_id, batch_id) - llog.debug("[scan %s](%s) assigned %s to batch %s" % (sca= n_id, host_count, host_id, batch_id)) - host_count +=3D 1 - #end for loop + #scan marked as queued, batching hosts + llog.debug("Batching hosts...") + host_count =3D 1 + batch_id =3D 1 + for host_id in scan_hosts: + if host_count > scan_batch_size: + batch_id +=3D 1 + host_count =3D 1 + llog.debug("new batch: %s" % (batch_id)) + else: + llog.debug("%s(%s) is not greater than %s (%s)", ho= st_count,type(host_count), scan_batch_size,type(scan_batch_size)) + #end if=20 + scan.setBatchID(db, scan_id, host_id, batch_id) + llog.debug("[scan %s](%s) assigned %s to batch %s" % (= scan_id, host_count, host_id, batch_id)) + host_count +=3D 1 + #end for loop =20 =20 - except MySQLdb.connections.Error, myerr: - llog.warn("There was an error operating on the database: ") - llog.warn(myerr.__str__()) + except MySQLdb.connections.Error, myerr: + llog.warn("There was an error operating on the database: = ") + llog.warn(myerr.__str__()) + db.rollback() + c.execute("BEGIN") + scan.markScanFinished(db, scan_id, 5) + db.commit() + #end try-except + =20 + scan_id =3D scan.getNextScan(db) + scan_proc_count =3D scan.countScansProcessing(db) + db.commit() + #end while + #no more scans to process + llog.info("finished initial scan processing") + llog.debug("unlocking tables.") + c.close() + dbq.put(db) + except Exception, e: + llog.warning("Error encountered while setting up scan batches!"= ) + llog.warning("Exception: %s " % (str(e))) + try: db.rollback() - c.execute("BEGIN") - scan.markScanFinished(db, scan_id, 5) - db.commit() - #end try-except - =20 - scan_id =3D scan.getNextScan(db) - scan_proc_count =3D scan.countScansProcessing(db) - db.commit() - #end while - #no more scans to process - llog.info("finished initial scan processing") - llog.debug("unlocking tables.") - c.close() - dbq.put(db) + except: + llog.warning("Could not rollback database!") =20 #poll database to see if there are any batches that #need to be processing @@ -259,148 +267,163 @@ # # new NessusThread(dbq, scan_id, batch_id) # # most of this logic will exist within the # # NessusThread class - llog.info("begin processing batches...") - db =3D dbq.get() - c =3D db.cursor() - c.execute("BEGIN") + try: + llog.info("begin processing batches...") + db =3D dbq.get() + c =3D db.cursor() + c.execute("BEGIN") =20 - #calculate available scanning slots and retrieve the next, best - #batch job to process - slots_max =3D int(__config__['node_max_hosts']) * int(__config__['= scan_nodes']) - llog.debug("max slots allowed: %s", slots_max) - slots_avail =3D slots_max - scan.getHostProcessingTotal(db) - llog.debug("max slots available: %s", slots_avail) - batch =3D scan.getScanBatch(db,slots_avail) - db.commit() - lpct =3D 0 - while batch !=3D None: - #lpct +=3D 1 - #if lpct > 2: - # break - (batch_id, scan_id, host_count) =3D batch - llog.debug("[scan %s] batch #%s (%s hosts)", scan_id, batch_id,= host_count) - c.execute("BEGIN") - host_list =3D scan.getBatchHosts(db, scan_id, batch_id) - - scan.markScanProcessing(db, scan_id) - llog.debug("marking scan processing: %s" % (scan_id)) - #scan.markHostsProcessing(db, scan_id, host_list) - scan.markBatchProcessing(db, scan_id, batch_id) - #llog.debug("marking hosts processing: %s:%s" % (scan_id, ",".j= oin(host_list))) - db.commit() - #now we spawn a new thread to handle the scan - scan_thread =3D nessusmt.NessusScanThread(dbq, __config__, scan= _id, batch_id, host_list) - scan_thread.start() =20 - - #add thread to the global list - thread_list.append(scan_thread) #calculate available scanning slots and retrieve the next, best - #batch job to process - batch should never be larger than the m= ax for - #a single host - c.execute("BEGIN") + #batch job to process slots_max =3D int(__config__['node_max_hosts']) * int(__config_= _['scan_nodes']) llog.debug("max slots allowed: %s", slots_max) slots_avail =3D slots_max - scan.getHostProcessingTotal(db) llog.debug("max slots available: %s", slots_avail) batch =3D scan.getScanBatch(db,slots_avail) db.commit() - #end while - c.close() - dbq.put(db) - llog.info("finished processing batches") - =20 - =20 - #cleanup currently running scans - db =3D dbq.get() - c =3D db.cursor() - c.execute("BEGIN") - c.close() - scans =3D scan.getScansProcessing(db) - # #foreach running scan - for (scan_id, count) in scans.iteritems(): - llog.debug("checking scan: %s", scan_id) - # if scan runtime has exceeded our max, let's close up - # all currently running scans - if scan.scanIsFinished(db, scan_id): - llog.debug("scan %s is finished", scan_id) - #scan.markScanFinished(db, scan_id) - #notify_thread =3D nessusmt.NessusFinishedNotificationThread= (dbq,scan_id, __config__) - #notify_thread.start() - #thread_list.append(notify_thread) - #scan is finished, but some hosts may have errors - if scan.scanIsFinishedWithoutErrors(db, scan_id): - llog.debug("scan %s is finished without errors", scan_id) - #scan is completely finished - scan.markScanFinished(db, scan_id) - notify_thread =3D nessusmt.NessusFinishedNotificationThre= ad(dbq, scan_id, __config__) - notify_thread.start() - thread_list.append(notify_thread) - try: - trackScans.pop(scan_id) - except KeyError, ke: - llog.warning("Could not remove %s from trackScans: %s"= % (scan_id, str(ke))) + lpct =3D 0 + while batch !=3D None: + #lpct +=3D 1 + #if lpct > 2: + # break + (batch_id, scan_id, host_count) =3D batch + llog.debug("[scan %s] batch #%s (%s hosts)", scan_id, batch_= id, host_count) + c.execute("BEGIN") + host_list =3D scan.getBatchHosts(db, scan_id, batch_id) =20 - elif scan.scanExceedsRuntime(db, scan_id, __config__['max_ru= ntime']) \ - or trackScans.has_key(scan_id): + scan.markScanProcessing(db, scan_id) + llog.debug("marking scan processing: %s" % (scan_id)) + #scan.markHostsProcessing(db, scan_id, host_list) + scan.markBatchProcessing(db, scan_id, batch_id) + #llog.debug("marking hosts processing: %s:%s" % (scan_id, ",= ".join(host_list))) + db.commit() + #now we spawn a new thread to handle the scan + scan_thread =3D nessusmt.NessusScanThread(dbq, __config__, s= can_id, batch_id, host_list) + scan_thread.start() =20 + + #add thread to the global list + thread_list.append(scan_thread) + #calculate available scanning slots and retrieve the next, b= est + #batch job to process - batch should never be larger than th= e max for + #a single host + c.execute("BEGIN") + slots_max =3D int(__config__['node_max_hosts']) * int(__conf= ig__['scan_nodes']) + llog.debug("max slots allowed: %s", slots_max) + slots_avail =3D slots_max - scan.getHostProcessingTotal(db) + llog.debug("max slots available: %s", slots_avail) + batch =3D scan.getScanBatch(db,slots_avail) + db.commit() + #end while + c.close() + dbq.put(db) + llog.info("finished processing batches") + except Exception, e: + dbq.put(db) + llog.warning("Exception caught while starting batches; rollback= not possible.") + llog.warning("Exception: %s " % (str(e))) + =20 + try: + #cleanup currently running scans + db =3D dbq.get() + c =3D db.cursor() + c.execute("BEGIN") + c.close() + scans =3D scan.getScansProcessing(db) + # #foreach running scan + for (scan_id, count) in scans.iteritems(): + llog.debug("checking scan: %s", scan_id) + # if scan runtime has exceeded our max, let's close up + # all currently running scans + if scan.scanIsFinished(db, scan_id): + llog.debug("scan %s is finished", scan_id) + #scan.markScanFinished(db, scan_id) + #notify_thread =3D nessusmt.NessusFinishedNotificationThr= ead(dbq,scan_id, __config__) + #notify_thread.start() + #thread_list.append(notify_thread) + #scan is finished, but some hosts may have errors + if scan.scanIsFinishedWithoutErrors(db, scan_id): + llog.debug("scan %s is finished without errors", scan_= id) + #scan is completely finished + scan.markScanFinished(db, scan_id) + notify_thread =3D nessusmt.NessusFinishedNotificationT= hread(dbq, scan_id, __config__) + notify_thread.start() + thread_list.append(notify_thread) + try: + trackScans.pop(scan_id) + except KeyError, ke: + llog.warning("Could not remove %s from trackScans: = %s" % (scan_id, str(ke))) + + elif scan.scanExceedsRuntime(db, scan_id, __config__['max= _runtime']) \ + or trackScans.has_key(scan_id): =20 - llog.debug("scan %s finished, but with errors that are re= currant", scan_id) - #scan has been checked for errors before, assume - #errored hosts cannot be scanned and officially end it - scan.markScanFinished(db, scan_id) - notify_thread =3D nessusmt.NessusFinishedNotificationThre= ad(dbq, scan_id, __config__) - notify_thread.start() - thread_list.append(notify_thread) - try: - trackScans.pop(scan_id) - except KeyError, ke: - llog.warning("Could not remove %s from trackScans: %s"= % (scan_id, str(ke))) + llog.debug("scan %s finished, but with errors that are= recurrant", scan_id) + #scan has been checked for errors before, assume + #errored hosts cannot be scanned and officially end it + scan.markScanFinished(db, scan_id) + notify_thread =3D nessusmt.NessusFinishedNotificationT= hread(dbq, scan_id, __config__) + notify_thread.start() + thread_list.append(notify_thread) + try: + trackScans.pop(scan_id) + except KeyError, ke: + llog.warning("Could not remove %s from trackScans: = %s" % (scan_id, str(ke))) =20 - else: - llog.debug("scan %s finished, but with errors. requeuing= errored hosts", scan_id) - # #scan has finished, but with errors.. lets try to rescan - # #errored hosts - try: - scan.setErrorHostsRequested(db, scan_id) - trackScans[scan_id] =3D True - except Exception, e: - llog.warning("encountered an error during sql operatio= ns") - llog.warning("error: %s " % (str(e))) - # #these hosts should get rescanned next time around - #end if - else: - llog.debug("Scan %s is not finished", scan_id) - #scan is not finished - let's make sure it still has some th= reads=20 - #processing if it has hosts marked processing - scan_thread_ct =3D 0 - for thread in thread_list: - if thread.scan_id =3D=3D scan_id and thread.isAlive: - scan_thread_ct +=3D 1 - =20 - if scan_thread_ct =3D=3D 0: - llog.debug("scan %s not finished but has no running threa= ds!" % (scan_id)) - #okay, that means we don't have any threads processing th= e current - #scan - this is only a big deal if we have hosts marked p= rocessing - if scan.scanExceedsRuntime(db, scan_id, __config__['max_r= untime']): - llog.warning("scan has exceeded maximum runtime limit"= ) - try: - scan.changeScanHostStatus(db, scan_id, 'PROC', 'ERR= ') - except: - llog.warning("encountered an error during sql opera= tions") - llog.warning("error: %s " % (str(e))) else: - llog.info("Scan is within accepted runtime limit") + llog.debug("scan %s finished, but with errors. requeu= ing errored hosts", scan_id) + # #scan has finished, but with errors.. lets try to res= can + # #errored hosts try: - proc_hosts =3D scan.getHostsProcessing(db, scan_id) - scan.flushScanHostResults(db, scan_id, proc_hosts) - scan.changeScanHostStatus(db, scan_id, 'PROC','REQ'= ) + scan.setErrorHostsRequested(db, scan_id) + trackScans[scan_id] =3D True except Exception, e: llog.warning("encountered an error during sql opera= tions") llog.warning("error: %s " % (str(e))) + # #these hosts should get rescanned next time around #end if - #end if=20 + else: + llog.debug("Scan %s is not finished", scan_id) + #scan is not finished - let's make sure it still has some= threads=20 + #processing if it has hosts marked processing + scan_thread_ct =3D 0 + for thread in thread_list: + if thread.scan_id =3D=3D scan_id and thread.isAlive: + scan_thread_ct +=3D 1 + =20 + if scan_thread_ct =3D=3D 0: + llog.debug("scan %s not finished but has no running th= reads!" % (scan_id)) + #okay, that means we don't have any threads processing= the current + #scan - this is only a big deal if we have hosts marke= d processing + if scan.scanExceedsRuntime(db, scan_id, __config__['ma= x_runtime']): + llog.warning("scan has exceeded maximum runtime lim= it") + try: + scan.changeScanHostStatus(db, scan_id, 'PROC', '= ERR') + except: + llog.warning("encountered an error during sql op= erations") + llog.warning("error: %s " % (str(e))) + else: + llog.info("Scan is within accepted runtime limit") + try: + proc_hosts =3D scan.getHostsProcessing(db, scan_= id) + scan.flushScanHostResults(db, scan_id, proc_host= s) + scan.changeScanHostStatus(db, scan_id, 'PROC','R= EQ') + except Exception, e: + llog.warning("encountered an error during sql op= erations") + llog.warning("error: %s " % (str(e))) + #end if + #end if=20 =20 - db.commit() - dbq.put(db) + db.commit() + dbq.put(db) + except Exception, e: + llog.warn("Error encountered while cleaning up scan requests") + llog.warn("Exception: %s" % (str(e))) + llog.warn("Attempting to rollback...") + try: + db.rollback() + except: + llog.warn("Could not rollback database!") + dbq.put(db) + #temporarily llog.info("checking if any of our threads are finished") for thread in thread_list: |
From: <wi...@bi...> - 2005-08-08 00:31:07
|
Author: wirges Date: 2005-08-07 19:31:55 -0500 (Sun, 07 Aug 2005) New Revision: 415 Modified: trunk/Main/People/include/public.inc trunk/Main/tpl/Host_Scan-domain_policy_list.tpl Log: Merged in changes from VSC 2.0 branch, and modified the people name funct= ion to=20 return $userid instead of 'unknown' in the case that no first/last name i= s present. Modified: trunk/Main/People/include/public.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/Main/People/include/public.inc 2005-08-08 00:27:31 UTC (rev 414= ) +++ trunk/Main/People/include/public.inc 2005-08-08 00:31:55 UTC (rev 415= ) @@ -252,7 +252,7 @@ $sql =3D "SELECT first_name, last_name FROM people WHERE userid=3D'$u= serid'"; $arr =3D DB_GetArray($sql); if ($arr['first_name'] =3D=3D "" && $arr['last_name'] =3D=3D "") { - return "unknown"; + return $userid; } else { return $arr['first_name']." ".$arr['last_name']; } =20 Modified: trunk/Main/tpl/Host_Scan-domain_policy_list.tpl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/Main/tpl/Host_Scan-domain_policy_list.tpl 2005-08-08 00:27:31 U= TC (rev 414) +++ trunk/Main/tpl/Host_Scan-domain_policy_list.tpl 2005-08-08 00:31:55 U= TC (rev 415) @@ -10,10 +10,9 @@ <td> <select name=3D'{$element_name}' size=3D'10'> {foreach key=3Ddomain item=3Dpols from=3D$policies} - <option value=3D''>-- Domain {$domain} --</option> {foreach item=3Dpol from=3D$pols} <option value=3D'{$pol.policy_id}' {if $pol.policy_id eq $se= lected_pol}SELECTED=3D'SELECTED'{/if}> - {$pol.name} created by {$pol.creator} + {$domain}: {$pol.name} created by {$pol.creato= r} </option> {/foreach} {/foreach} |
From: <wi...@bi...> - 2005-08-08 00:26:38
|
Author: wirges Date: 2005-08-07 19:27:31 -0500 (Sun, 07 Aug 2005) New Revision: 414 Modified: branches/vsc-2.0/Main/tpl/Host_Scan-domain_policy_list.tpl Log: Applied policy display patch from Warren Raquel @ UIUC Modified: branches/vsc-2.0/Main/tpl/Host_Scan-domain_policy_list.tpl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/vsc-2.0/Main/tpl/Host_Scan-domain_policy_list.tpl 2005-08-08= 00:05:41 UTC (rev 413) +++ branches/vsc-2.0/Main/tpl/Host_Scan-domain_policy_list.tpl 2005-08-08= 00:27:31 UTC (rev 414) @@ -10,10 +10,9 @@ <td> <select name=3D'{$element_name}' size=3D'10'> {foreach key=3Ddomain item=3Dpols from=3D$policies} - <option value=3D''>-- Domain {$domain} --</option> {foreach item=3Dpol from=3D$pols} <option value=3D'{$pol.policy_id}' {if $pol.policy_id eq $se= lected_pol}SELECTED=3D'SELECTED'{/if}> - {$pol.name} created by {$pol.creator} + {$domain}: {$pol.name} created by {$pol.creato= r} </option> {/foreach} {/foreach} |
From: <wi...@bi...> - 2005-08-08 00:04:44
|
Author: wirges Date: 2005-08-07 19:05:41 -0500 (Sun, 07 Aug 2005) New Revision: 413 Modified: trunk/pyvscd/CHANGELOG Log: Updated changelog Modified: trunk/pyvscd/CHANGELOG =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/CHANGELOG 2005-08-07 23:56:02 UTC (rev 412) +++ trunk/pyvscd/CHANGELOG 2005-08-08 00:05:41 UTC (rev 413) @@ -1,6 +1,16 @@ CHANGELOG ------------ =20 +07AUG05 - Made changes to nessus_plugins table to account for new/malfor= med severities + in nessus plugins. + pyssus library updated to properly strip whitespace from plugi= ns severities + (both changes thanks to Warren Raquel) + + Changed _vsc:max_hosts option to _vsc:node_max_hosts, because = max_hosts is a + nessusd option that is important to have control over. + + Updated README to discuss cluster performance optimizations. + 31JUL05 - Fixed some bugs with rescanning code, and added a max_runtime = option to prevent a stubborn scan from utilizing the entire queue. =20 |
From: <wi...@bi...> - 2005-08-07 23:55:05
|
Author: wirges Date: 2005-08-07 18:56:02 -0500 (Sun, 07 Aug 2005) New Revision: 412 Added: trunk/pyvscd/UPGRADE Modified: trunk/pyvscd/README trunk/pyvscd/libvscmt/plugins.py trunk/pyvscd/libvscmt/scan.py trunk/pyvscd/pyssus/handlers.py trunk/pyvscd/pyvscd.py Log: Changed pyvscd.py to use _vsc:node_max_hosts instead of `max_hosts' which= is a nessusd option. Please see UPGRADE about this change. Modified the pyssus library to properly strip white-space off of plugin s= everities. Modified: trunk/pyvscd/README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/README 2005-08-05 14:24:38 UTC (rev 411) +++ trunk/pyvscd/README 2005-08-07 23:56:02 UTC (rev 412) @@ -1,6 +1,9 @@ pyvscd - README ---------------- =20 +** PLEASE SEE the file UPGRADE, if you are upgrading from an existing ve= rsion of + the VSC. ** + ABOUT ------ =20 @@ -83,6 +86,68 @@ output. If anyone has any suggestions on fixing this, or has alternativ= es, please let me know. =20 +CLUSTER PERFORMANCE/SETTINGS +---------------------------- + +The cluster won't give you faster scans, per se. Rather, its to allow y= ou to handle=20 +a large volume of scans at a single time. This is mostly because many o= f the operations +that the Nessus scanner performs rely not on the power of the scanner, b= ut rather the=20 +target systems, and the network over which it is scanning. + +The following is the current default configuration used by Purdue in our= 5-node*=20 +VSC cluster. +(* Each node is a 1GHz Pentium M blade server w/ 512MB of RAM) + +System Configuration options: + + Section | Option | Value + --------------------------------------------------- + _vsc | max_requests | 10 + _vsc | scan_nodes | 5 + _vsc | base_batch_size | 10 + _vsc | node_max_hosts | 100 + SERVER_PREFS | max_hosts | 40 + SERVER_PREFS | max_checks | 10 + SERVER_PREFS | optimize_test | no + SERVER_PREFS | plugins_timeout | 60 + SERVER_PREFS | checks_read_timeout | 5 + +Descriptions: + max_requests - maximum number of scan requests the pyvscd will process = at one time + scan_nodes - number of nessusd nodes in your LVS cluster + base_batch_size - minimum number of hosts sent to an individual node fo= r scanning + node_max_hosts - maximum number of hosts a node can handle at one time + max_hosts - [nessus] maximum number of hosts scanned at one time by ser= ver + max_checks - [nessus] maximum number of plugins per host run at one tim= e + optimize_test - [nessus] optimize vulnerability scans (e.g., plugins fo= r SMTP + vulnerabilities are only run if the port scan finds an = open + SMTP server on the target host) + plugins_timeout - [nessus] maximum execution time for a plugin + checks_read_timeout - [nessus] maximum time a plugin will wait for a re= sponse from=20 + the target host + + +Usage: + Some of the following are examples of how the above data is used. + + When the VSC finds a scan request whose requested_for time is equal to= or greater + than the current time, it will batch up the hosts in the scan like so: + batch size =3D base_batch_size * policy_weight + So, in the case of a full scan, whose policy weight is 1, the base_b= atch_size + (using our defaults) is 10. + Therefore a scan of 100 hosts will yield 10 batches of 10 hosts, and= a scan of + 5 hosts will yield one batch of 5 hosts. + + Batching is only the first step. After the batches have been created,= we have to + determine if there is space on the cluster for the batches. To do thi= s, we first + have to know how much the cluster can handle. This is determined simp= ly by=20 + multiplying scan_nodes by node_max_hosts. As each batch is processed,= its total + number of hosts is subtracted from the cluster host total until it has= finished + processing. However, the pyvscd will always try to keep this full whe= n there are + waiting batches. For example, in our cluster, tf there are 500 total = hosts, and 490=20 + are processing, and we have two batches of different size (50 and 10, = for example),=20 + the batch that fits will be run (batch of 10). + NOTES ------ The pyvscd has been tested on Debian GNU/Linux (unstable) using Python 2= .4 with=20 Added: trunk/pyvscd/UPGRADE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/UPGRADE 2005-08-05 14:24:38 UTC (rev 411) +++ trunk/pyvscd/UPGRADE 2005-08-07 23:56:02 UTC (rev 412) @@ -0,0 +1,20 @@ +UPGRADE NOTES +------------- + +In order for the pyvscd to work correctly, you will need to make some ch= anges: + +1) System Configuration Changes + + In the _vsc section of the configuration, you should change "max_hosts= " to + "node_max_hosts". + + You should also add "max_hosts" to the SERVER_PREFS section. + + +2) modification to the nessus_plugins table + =20 + ALTER TABLE `nessus_plugins` CHANGE `severity` `severity` VARCHAR( 30= )=20 + DEFAULT 'Unknown' NOT NULL=20 + + This prevents loadplugins.py from encountering errors when nessus plu= gins + contain new severity levels. Modified: trunk/pyvscd/libvscmt/plugins.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/libvscmt/plugins.py 2005-08-05 14:24:38 UTC (rev 411) +++ trunk/pyvscd/libvscmt/plugins.py 2005-08-07 23:56:02 UTC (rev 412) @@ -2,6 +2,8 @@ Plugin SQL interface methods """ =20 +import logging + POLICY_USER =3D "auto" =20 def flushTempPlugins(db): @@ -81,6 +83,8 @@ db - MySQLdb.connections.Connection plugin - dict """ + log =3D logging.getLogger('libvscmt.plugins') + if plug.has_key('plugin'): c =3D db.cursor() #we can do stuff (host estute!) @@ -89,21 +93,30 @@ __sql__ =3D "UPDATE nessus_plugins SET name=3D%s,description=3D= %s,family=3D%s, " +\ "developer=3D%s,short_desc=3D%s,revision=3D%s,CVE=3D%= s,severity=3D%s " +\ "WHERE plugin_id=3D%s " - c.execute(__sql__, (plug['name'], plug['description'], plug['fa= mily'], - plug['copyright'], plug['summary'], plug['ve= rsion'], - plug['cve'], plug['severity'], plug['plugin'= ] - ) - ) + try: + c.execute(__sql__, (plug['name'], plug['description'], plug[= 'family'], + plug['copyright'], plug['summary'], plug[= 'version'], + plug['cve'], plug['severity'], plug['plug= in'] + ) + ) + except Exception, e: + log.warn("Could not update plugin %s: %s" % (plug['plugin'],= str(e))) + else: #insert __sql__ =3D "INSERT INTO nessus_plugins (plugin_id, name, descr= iption, " +\ "family,developer,short_desc,revision,CVE,severity) "= +\ "VALUES(%s, %s,%s,%s,%s,%s,%s,%s,%s) " - c.execute(__sql__, (plug['plugin'], plug['name'], plug['descrip= tion'], - plug['family'], plug['copyright'], plug['su= mmary'], - plug['version'], plug['cve'], plug['severit= y'] - ) - ) + try: + =20 + c.execute(__sql__, (plug['plugin'], plug['name'], plug['desc= ription'], + plug['family'], plug['copyright'], plug[= 'summary'], + plug['version'], plug['cve'], plug['seve= rity'] + ) + ) + except Exception, e: + log.warn("Could not add plugin %s: %s" % (plug['plugin'], st= r(e))) + addTempPlugin(db, plug['plugin'], plug['name'], plug['family']) #db.commit() c.close() Modified: trunk/pyvscd/libvscmt/scan.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/libvscmt/scan.py 2005-08-05 14:24:38 UTC (rev 411) +++ trunk/pyvscd/libvscmt/scan.py 2005-08-07 23:56:02 UTC (rev 412) @@ -38,7 +38,6 @@ __sql__ =3D "INSERT INTO nessus_scan_hosts (scan_id, host_id) V= ALUES(%s,%s) " c.execute(__sql__, (scan_id, host_id)) #end for - c.close() r_ids.append(str(scan_id)) #end if c.close() Modified: trunk/pyvscd/pyssus/handlers.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyssus/handlers.py 2005-08-05 14:24:38 UTC (rev 411) +++ trunk/pyvscd/pyssus/handlers.py 2005-08-07 23:56:02 UTC (rev 412) @@ -396,7 +396,7 @@ sev =3D "Very low" elif sev =3D=3D "From None to High": sev =3D "Medium" - return sev + return sev.strip() =20 def __str__(self): r_str =3D "" Modified: trunk/pyvscd/pyvscd.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyvscd.py 2005-08-05 14:24:38 UTC (rev 411) +++ trunk/pyvscd/pyvscd.py 2005-08-07 23:56:02 UTC (rev 412) @@ -207,8 +207,8 @@ pol_weight =3D scan.getPolicyWeight(db, scan_pol_id) scan_batch_size =3D int(__config__['base_batch_size']) * int(po= l_weight) #a batch can never be bigger than the maxium slots available - if scan_batch_size > int(__config__['max_hosts']): - scan_batch_size =3D int(__config__['max_hosts']) + if scan_batch_size > int(__config__['node_max_hosts']): + scan_batch_size =3D int(__config__['node_max_hosts']) llog.debug("batch size is %s =3D (%s * %s)" % (scan_batch_size,= __config__['base_batch_size'], pol_weight)) =20 #okay, lets mark the scan queued @@ -266,7 +266,7 @@ =20 #calculate available scanning slots and retrieve the next, best #batch job to process - slots_max =3D int(__config__['max_hosts']) * int(__config__['scan_= nodes']) + slots_max =3D int(__config__['node_max_hosts']) * int(__config__['= scan_nodes']) llog.debug("max slots allowed: %s", slots_max) slots_avail =3D slots_max - scan.getHostProcessingTotal(db) llog.debug("max slots available: %s", slots_avail) @@ -298,7 +298,7 @@ #batch job to process - batch should never be larger than the m= ax for #a single host c.execute("BEGIN") - slots_max =3D int(__config__['max_hosts']) * int(__config__['sc= an_nodes']) + slots_max =3D int(__config__['node_max_hosts']) * int(__config_= _['scan_nodes']) llog.debug("max slots allowed: %s", slots_max) slots_avail =3D slots_max - scan.getHostProcessingTotal(db) llog.debug("max slots available: %s", slots_avail) |
From: <wi...@bi...> - 2005-08-05 14:23:45
|
Author: wirges Date: 2005-08-05 09:24:38 -0500 (Fri, 05 Aug 2005) New Revision: 411 Modified: trunk/pyvscd/pyvscd.conf.example Log: Fixed example config, which breaks when it is edited and lines are left w= ith comments on the end Modified: trunk/pyvscd/pyvscd.conf.example =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyvscd.conf.example 2005-08-04 22:18:03 UTC (rev 410) +++ trunk/pyvscd/pyvscd.conf.example 2005-08-05 14:24:38 UTC (rev 411) @@ -16,15 +16,21 @@ #console logging must be enabled, but you can #set the severity logcons_level: 20 -daemon: yes #this is overriden by the cli option -D +#this is overriden by the cli option -D +daemon: yes=20 =20 -max_runtime: 21600 #the maximum amount of time a scan can run (def: 5 ho= urs) -max_db_connections: 10 #the maximum number of shared mysql connections f= or all threads -var_dir: /var/local/tmp/vsc/logs/ #equivalent to the var_dir config opti= on in the vsc db -root_domain: ROOT_DOMAIN #your VSC root domain -report_base: https://server.tld/path/to/vsc/main #path to your VSC web i= nterface for scan - #notifications -smtp_server: smtp.yourorg.tld #smtp server to use for scan completion em= ails +#the maximum amount of time a scan can run (def: 5 hours) +max_runtime: 21600=20 +#the maximum number of shared mysql connections for all threads +max_db_connections: 10=20 +#equivalent to the var_dir config option in the vsc db +var_dir: /var/local/tmp/vsc/logs/=20 +#your VSC root domain +root_domain: ROOT_DOMAIN=20 +#path to your VSC web interface for scan notifications +report_base: https://server.tld/path/to/vsc/main=20 +#smtp server to use for scan completion emails +smtp_server: smtp.yourorg.tld=20 =20 [mysql] database: vsc |
From: <wi...@bi...> - 2005-08-04 22:17:12
|
Author: wirges Date: 2005-08-04 17:18:03 -0500 (Thu, 04 Aug 2005) New Revision: 410 Modified: trunk/pyvscd/README trunk/pyvscd/libvscmt/scan.py trunk/pyvscd/pyvscd.py trunk/pyvscd/util/loadplugins.py Log: Added a missing prerequisite to the README file Added SSL support to loadplugins.py Added recurring scan scheduling to pyvscd; tested and appears to work Modified: trunk/pyvscd/README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/README 2005-08-04 03:07:40 UTC (rev 409) +++ trunk/pyvscd/README 2005-08-04 22:18:03 UTC (rev 410) @@ -42,6 +42,9 @@ PyOpenSSL - OpenSSL interface for Python: http://pyopenssl.sourceforge.n= et/ This module is optional if you do not wish to use OpenSSL =20 +DateUtil extentions - Extensions to Python's Dateutil module needed by t= he VSC: + https://moin.conectiva.com.br/DateUtil#head-a479c9c34e878d07b4d67a73a= 48f432ad7dc53c8 + USING ------ =20 Modified: trunk/pyvscd/libvscmt/scan.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/libvscmt/scan.py 2005-08-04 03:07:40 UTC (rev 409) +++ trunk/pyvscd/libvscmt/scan.py 2005-08-04 22:18:03 UTC (rev 410) @@ -5,6 +5,48 @@ import logging import time =20 +def promoteNextRecurScans(db): + """promote a recurring scan date to full scan. + + Keyword Arguments: + db - MySQLdb.connections.Connection + parent_scan_id - integer + scan_ts - integer + """ + + c =3D db.cursor() + =20 + __sql__ =3D "SELECT t2.scan_id, t2.policy_id, t2.domain, t2.userid, "= +\ + "t2.requested_on, t1.scheduled_for, t2.priority " +\ + "FROM scan_recur_calendar AS t1, nessus_scan_request AS t2 = " +\ + "WHERE t1.scheduled_for < ADDDATE(NOW(), INTERVAL 1 HOUR) "= +\ + "AND NOT t1.scan_id AND t2.scan_id =3D t1.parent_scan_id " + r_ids =3D [] + c.execute(__sql__) + for (parent_scan_id, policy_id, domain, userid, requested_on, schedul= ed_for, priority) in c:=20 + __sql__ =3D "INSERT INTO nessus_scan_request (policy_id, domain, "= +\ + "userid, requested_on,scheduled_for, priority) " +\ + "VALUES(%s,%s,%s,%s,%s,%s) " + c.execute(__sql__, (policy_id, domain, userid, requested_on, sched= uled_for, priority)) + scan_id =3D db.insert_id() + __sql__ =3D "UPDATE scan_recur_calendar SET scan_id=3D%s " +\ + "WHERE scheduled_for=3D%s AND parent_scan_id=3D%s " + c.execute(__sql__, (scan_id, scheduled_for, parent_scan_id)) + __sql__ =3D "SELECT host_id FROM nessus_scan_hosts WHERE scan_id=3D= %s " + c.execute(__sql__, (parent_scan_id,)) + for (host_id,) in c: + __sql__ =3D "INSERT INTO nessus_scan_hosts (scan_id, host_id) V= ALUES(%s,%s) " + c.execute(__sql__, (scan_id, host_id)) + #end for + c.close() + r_ids.append(str(scan_id)) + #end if + c.close() + if len(r_ids) =3D=3D 0: + return None + else: + return r_ids + def resetBatches(db, scan_id=3DNone): """reset batches marked as processing to requested for scans which are still marked as 'processing'. @@ -325,8 +367,9 @@ c =3D db.cursor() __sql__ =3D "SELECT COUNT(*) FROM nessus_scan_hosts " +\ "WHERE scan_id=3D%s AND status NOT " +\ - "IN ( CONVERT(_utf8'FIN' USING latin1) COLLATE latin1_swedi= sh_ci, " +\ - " CONVERT(_utf8'ERR' USING latin1) COLLATE latin1_swedish_c= i) " + "IN ('FIN','ERR') " + #"IN ( CONVERT(_utf8'FIN' USING latin1) COLLATE latin1_swed= ish_ci, " +\ + #" CONVERT(_utf8'ERR' USING latin1) COLLATE latin1_swedish_= ci) " if c.execute(__sql__, (scan_id,)) =3D=3D 0: c.close() return False Modified: trunk/pyvscd/pyvscd.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyvscd.py 2005-08-04 03:07:40 UTC (rev 409) +++ trunk/pyvscd/pyvscd.py 2005-08-04 22:18:03 UTC (rev 410) @@ -155,6 +155,7 @@ =20 llog.debug("Entering main program loop.") count =3D 0 + time_loops_recur =3D 0 while 1: #if count =3D=3D 1: # break @@ -183,6 +184,16 @@ c.execute("BEGIN") scan_id =3D scan.getNextScan(db) scan_proc_count =3D scan.countScansProcessing(db) + if time_loops_recur >=3D 6: + llog.info("loading upcoming recurring scans") + ids =3D scan.promoteNextRecurScans(db) + if ids is not None: + llog.debug("The following new recurring scans have been load= ed: %s", ",".join(ids)) + #end if + time_loops_recur =3D 0 + else: + time_loops_recur +=3D 1 + #end if db.commit() #llog.debug("max slots allowed: %s", slots_max) while (scan_id is not None) and (scan_proc_count < __config__['max= _requests']): @@ -311,7 +322,7 @@ # if scan runtime has exceeded our max, let's close up # all currently running scans if scan.scanIsFinished(db, scan_id): - #llog.debug("scan %s is finished", scan_id) + llog.debug("scan %s is finished", scan_id) #scan.markScanFinished(db, scan_id) #notify_thread =3D nessusmt.NessusFinishedNotificationThread= (dbq,scan_id, __config__) #notify_thread.start() Modified: trunk/pyvscd/util/loadplugins.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/util/loadplugins.py 2005-08-04 03:07:40 UTC (rev 409) +++ trunk/pyvscd/util/loadplugins.py 2005-08-04 22:18:03 UTC (rev 410) @@ -22,6 +22,7 @@ parser.add_option('-d', '--debug', action=3D'store_true', dest=3D'deb= ug',help=3D'enable debugging') parser.add_option('-v', '--verbose', action=3D'store_true', dest=3D'v= erbose',help=3D'enable debugging') parser.add_option('-c', '--config', dest=3D'conf', help=3D'pyvscd con= fig file') + parser.add_option('-S', '--ssl',action=3D'store_true', dest=3D'ssl',h= elp=3D'enable ssl for nessus connection') =20 (options, args) =3D parser.parse_args() if not options.nessus and not options.conf: @@ -60,7 +61,10 @@ db =3D MySQLdb.connect(host=3Ddbhost, user=3Ddbuser, passwd=3Ddbpassw= d, db=3Ddbname) =20 (nhost, nport, nuser, npass) =3D options.nessus.split(":") - cx =3D comm.NessusConx(nhost, nport) + if options.ssl: + cx =3D comm.NessusSSLConx(nhost, nport)=20 + else: + cx =3D comm.NessusConx(nhost, nport) opt_list =3D [ comm.CommOpt_PluginsVersion, comm.CommOpt_PluginsCVE,=20 comm.CommOpt_PluginsXrefs, comm.CommOpt_PluginsBugtraq ] cx.setOpts(opt_list) |
From: <wi...@bi...> - 2005-08-04 03:06:46
|
Author: wirges Date: 2005-08-03 22:07:40 -0500 (Wed, 03 Aug 2005) New Revision: 409 Modified: trunk/pyvscd/README trunk/pyvscd/libvscmt/nessusmt.py Log: Fixed a spelling mistake in README, fixed a semantic mistake in nessusmt.= py Modified: trunk/pyvscd/README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/README 2005-08-03 21:29:23 UTC (rev 408) +++ trunk/pyvscd/README 2005-08-04 03:07:40 UTC (rev 409) @@ -9,7 +9,7 @@ and a sloppy, hard to debug code base, there was a need for a from-scrat= ch rewrite of the VSC, and Python was the perfect fit (Write one way, the right way.) =20 =20 -The pyvscd boasts better usage of researches by sharing a small, fixed s= ize MySQL database +The pyvscd boasts better usage of resources by sharing a small, fixed si= ze MySQL database connection pool among a set of threads which perform scanning and comple= tion notification duties. The pyvscd includes scan recovery code, wherein the pyvscd will= attempt to rescan errored hosts once, or detect scans that are supposedly still processing= , but have no Modified: trunk/pyvscd/libvscmt/nessusmt.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/libvscmt/nessusmt.py 2005-08-03 21:29:23 UTC (rev 408) +++ trunk/pyvscd/libvscmt/nessusmt.py 2005-08-04 03:07:40 UTC (rev 409) @@ -288,7 +288,7 @@ c =3D db.cursor() c.execute("BEGIN") if not host.hasPortOpen(db, scan_id, host_map[self.host], self.por= t, self.prot): - host.saveNessusResult(db, scan_id, host_map[self.host], ("10335= ", "INFO", self.port, self.prot, "TCP Port Scan")) + host.saveNessusResult(db, scan_id, host_map[self.host], ("10335= ", "INFO", self.port, self.prot, ["TCP Port Scan",])) db.commit() c.close() dbq.put(db) |
From: <wi...@bi...> - 2005-08-03 21:28:29
|
Author: wirges Date: 2005-08-03 16:29:23 -0500 (Wed, 03 Aug 2005) New Revision: 408 Added: trunk/pyvscd/util/ trunk/pyvscd/util/loadplugins.py Modified: trunk/pyvscd/pyvscd.py Log: Added the loadplugins.py utility Modified: trunk/pyvscd/pyvscd.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyvscd.py 2005-07-31 20:50:34 UTC (rev 407) +++ trunk/pyvscd/pyvscd.py 2005-08-03 21:29:23 UTC (rev 408) @@ -1,4 +1,4 @@ -#!/usr/bin/python2.4 +#!/usr/bin/env python2.4 """ The Vulnerability Scanning Cluster=20 scan management daemon Added: trunk/pyvscd/util/loadplugins.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/util/loadplugins.py 2005-07-31 20:50:34 UTC (rev 407) +++ trunk/pyvscd/util/loadplugins.py 2005-08-03 21:29:23 UTC (rev 408) @@ -0,0 +1,145 @@ +#!/usr/bin/env python2.4 + +""" +Python script for importing plugins from the Nessus server. +""" + +import sys +sys.path.append('../') +from ConfigParser import ConfigParser +from pyssus import * +import libvscmt.plugins +from optparse import OptionParser +from socket import error as socket_error +import time +import logging +import MySQLdb + +def __main__(): + usage =3D "usage: %prog [options] [hosts]" + parser =3D OptionParser(usage=3Dusage) + parser.add_option('-N', '--nessus', dest=3D'nessus', help=3D'nessus s= erver:port:user:pass') + parser.add_option('-d', '--debug', action=3D'store_true', dest=3D'deb= ug',help=3D'enable debugging') + parser.add_option('-v', '--verbose', action=3D'store_true', dest=3D'v= erbose',help=3D'enable debugging') + parser.add_option('-c', '--config', dest=3D'conf', help=3D'pyvscd con= fig file') + + (options, args) =3D parser.parse_args() + if not options.nessus and not options.conf: + parser.print_help() + sys.exit(-1) + =20 + logging.basicConfig() + if options.verbose: + logging.getLogger('').setLevel(logging.INFO) + + if options.debug: + #set root logger to DEBUG + logging.getLogger('').setLevel(logging.DEBUG) + #our logger should inherit the root logging level + log =3D logging.getLogger('loadplugins') + =20 + if options.debug: + log.debug('Debugging enabled') + elif options.verbose: + log.debug('Verbose enabled') +=20 + #read our config file + config =3D ConfigParser() + config.read(options.conf) + if not config.has_section('mysql') or not config.has_section('general= '): + log.error("The config file must contain a [mysql] and [general] se= ction!") + sys.exit(-1) + =20 + dbhost =3D config.get('mysql','host') + dbuser =3D config.get('mysql','username') + dbpasswd =3D config.get('mysql','password') + dbname =3D config.get('mysql','database') + root_domain =3D config.get('general', 'root_domain') + =20 + #open MySQL Connection + db =3D MySQLdb.connect(host=3Ddbhost, user=3Ddbuser, passwd=3Ddbpassw= d, db=3Ddbname) + + (nhost, nport, nuser, npass) =3D options.nessus.split(":") + cx =3D comm.NessusConx(nhost, nport) + opt_list =3D [ comm.CommOpt_PluginsVersion, comm.CommOpt_PluginsCVE,=20 + comm.CommOpt_PluginsXrefs, comm.CommOpt_PluginsBugtraq ] + cx.setOpts(opt_list) + log.info("connecting to Nessus server") + if cx.open(): + log.debug("Connection to nessus opened, logging in") + try: + cx.login(nuser, npass) + except comm.NessusLoginException, nle: + log.error("Error logging in: %s", str(nle)) + sys.exit(-1) + else: + log.error("Could not connect to the Nessus server.") + sys.exit(-1) + + + #handle plugin lists + msg =3D cx.readMessage() + while msg =3D=3D None: + msg =3D cx.readMessage() + msg.unpack() + #we need to replace this with our plugins handler + pluginData =3D VSCPluginsHandler(msg, opt_list) + logging.info("Received %s plugins", str(pluginData.plugins.__len__())= ) + pluginData.handle(args=3D(db,root_domain))=20 + log.debug("disconnecting from server.") + cx.close() +#end main + +class VSCPluginsHandler(handlers.NessusPluginsHandler): + =20 + def handle(self, args): + log =3D logging.getLogger('plugins handler') + (db,root_domain) =3D args + libvscmt.plugins.flushTempPlugins(db) + for p in self.plugins: + libvscmt.plugins.addPlugin(db, p) + log.debug("added %s: %s", p['plugin'], p['name']) + + families =3D libvscmt.plugins.getFamilies(db) + if "Full Scan" not in families: + families.append("Full Scan") + + policies_added =3D [] + for family in families: + log.info("rebuilding policies for family %s", family) + polid =3D libvscmt.plugins.policyExists(db, family, libvscmt.pl= ugins.POLICY_USER, root_domain) + if polid is None: + log.debug("policy |%s| not found!", family) + libvscmt.plugins.addPolicy(db, (family, "Automagically gener= ated by the VSC.", + 1, root_domain, libvscmt.plugins.POLIC= Y_USER + ) + ) + policies_added.append(family) + polid =3D libvscmt.plugins.policyExists(db, family, libvscmt= .plugins.POLICY_USER, root_domain) + log.info("Added %s policy (#%s)", family, polid) + else: + log.info("%s policy already exists", family) + =20 + plugin_list =3D [] + if family =3D=3D "Full Scan": + plugin_list =3D libvscmt.plugins.getAllPlugins(db) + else: + plugin_list =3D libvscmt.plugins.getPluginsByFamily(db, fami= ly) + + log.debug("mapping plugins to policy %s[%s]", family,polid) + for pl in plugin_list: + #log.debug("mapping plugin [#%s] to policy [%s]" % (pl, poli= d)) + if not libvscmt.plugins.isMapped(db,polid, pl): + libvscmt.plugins.mapPlugin(db,polid, pl) + + log.info("finished mapping plugins for this policy.") + total_count =3D libvscmt.plugins.getPluginCount(db) + finish_time =3D time.time() + new_plugins =3D libvscmt.plugins.getTempPlugins(db) + db.commit() + print """%s new plugins added""" % (len(new_plugins)) + =20 + +if __name__ =3D=3D '__main__': + __main__() + Property changes on: trunk/pyvscd/util/loadplugins.py ___________________________________________________________________ Name: svn:executable + * |
From: <wi...@bi...> - 2005-08-01 01:45:34
|
Author: wirges Date: 2005-07-31 15:50:34 -0500 (Sun, 31 Jul 2005) New Revision: 407 Added: trunk/pyvscd/README Modified: trunk/pyvscd/CHANGELOG trunk/pyvscd/pyvscd.conf.example Log: Added readme, updated pyvscd.conf.example with addtl options and explanat= ions,=20 updated the CHANGELOG Modified: trunk/pyvscd/CHANGELOG =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/CHANGELOG 2005-07-31 19:34:10 UTC (rev 406) +++ trunk/pyvscd/CHANGELOG 2005-07-31 20:50:34 UTC (rev 407) @@ -1,6 +1,11 @@ CHANGELOG ------------ =20 +31JUL05 - Fixed some bugs with rescanning code, and added a max_runtime = option + to prevent a stubborn scan from utilizing the entire queue. + + Also completed the README file. + 29JUL05 - Applied ssl.patch provided by Jeremy Baumgartner from the University of Wisconsin at Madison (bau...@ca...) =20 Added: trunk/pyvscd/README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/README 2005-07-31 19:34:10 UTC (rev 406) +++ trunk/pyvscd/README 2005-07-31 20:50:34 UTC (rev 407) @@ -0,0 +1,88 @@ +pyvscd - README +---------------- + +ABOUT +------ + +The pyvscd, or Python VSCd, is a python rewrite of the VSC backend scan = scheduler=20 +daemon originally written in perl. Due to scalability, reliability, per= formance issues, +and a sloppy, hard to debug code base, there was a need for a from-scrat= ch rewrite of the +VSC, and Python was the perfect fit (Write one way, the right way.) =20 + +The pyvscd boasts better usage of researches by sharing a small, fixed s= ize MySQL database +connection pool among a set of threads which perform scanning and comple= tion notification +duties. The pyvscd includes scan recovery code, wherein the pyvscd will= attempt to rescan +errored hosts once, or detect scans that are supposedly still processing= , but have no +corresponding running threads. The pyvscd will attempt to process these= scans until +a maximum scan runtime threshold is reached (default, 5 hours). + +If you have any questions, or contributions please send email to: + vsc...@li... + +Bug reports can be filed at: https://vsc-dev.itsp.purdue.edu + +The latest SVN exports of the pyvscd can be retrieved via https/webdav: + % svn co https://bishop.itsp.purdue.edu:8443/vscrepos/trunk/pyvscd + +PREREQUISITES +-------------- + +Python2.4 - Python 2.4 is currently needed due to the pyvscd's reliance = on the=20 +`logging` module supplied with the base Python distribution. The loggin= g module +changed quite a bit in terms of usage between Python2.3 and Python2.4 - = it may=20 +work in Python2.3 just fine, but it has not been tested. Please use at = your own +peril. + +pyssus - Python Nessus Client library (included with the distribution). = Provides a + Python native implementation of a Nessus (NTP 1.2) client libra= ry. + +MySQLdb - aka mysql-python: http://sourceforge.net/projects/mysql-python= - Python=20 + DB API 2.0 compliant MySQL client library. + =20 +PyOpenSSL - OpenSSL interface for Python: http://pyopenssl.sourceforge.n= et/ + This module is optional if you do not wish to use OpenSSL + +USING +------ + +The pyvscd is meant to be a drop-in replacement for the current vscd. W= hile not +distributed with vsc-2.0b2, (or VSC 2.0 Final, when it is released). It= is developed +for and against this version. Later releases of the pyvscd will be deve= loped=20 +specifically for the VSC 3.0 development branch (currently, the trunk). = A tagged=20 +release of the current working vsc 2.0 compatible pyvscd will be made. + +Preparation: + +Usage of pyvscd should be straight forward. Retrieve the latest copy of= the pyvscd +and make sure you have the libraries mentioned in the PREREQUISITES sect= ion satisified. +As mentioned previously, our Nessus client library Pyssus is included wi= th the pyvscd +distribution. + +Also, make sure you have cleaned stopped your current operating copy of = the vscd, if=20 +you are using it. =20 + +Configuration:=20 +Locate the file pyvscd.conf.example, and copy it to 'pyvscd.conf' in the= current=20 +directory, and then edit it with your favorite editor. The conf file ex= ample +should give you appropriate explanation to configuration options and wha= t they mean. + +Running pyvscd: + +Once the pyvscd has been configured, you should be ready to give it a te= st run: + +% python2.4 pyvscd.py -D -c pyvscd.conf + +The pyvscd should begin to operate. If you wish to run it in daemonized= mode, leave off +the -D option. + +CAVEAT: There is currently a thread-starvation issue with the python log= ger module and +logging to a file. If you run the vscd as a daemon, you may not be able= to capture its +output. If anyone has any suggestions on fixing this, or has alternativ= es, please let me +know. + +NOTES +------ +The pyvscd has been tested on Debian GNU/Linux (unstable) using Python 2= .4 with=20 +the VSC 2.0 development branch. =20 + +SSL support courtesy of Jeremy Baumgartner of the University of Wisconsi= n/Madison. Modified: trunk/pyvscd/pyvscd.conf.example =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/pyvscd/pyvscd.conf.example 2005-07-31 19:34:10 UTC (rev 406) +++ trunk/pyvscd/pyvscd.conf.example 2005-07-31 20:50:34 UTC (rev 407) @@ -7,7 +7,8 @@ # 10 - DEBUG # #configuration of file logging -#Logfile logging is broken right now +#Logfile logging is broken right now. It is recommended that you +#not use it unless you like deadlocks :-) logfile_enable: no logfile_level: 10 logfile: pyvscd.log @@ -15,13 +16,15 @@ #console logging must be enabled, but you can #set the severity logcons_level: 20 -daemon: yes +daemon: yes #this is overriden by the cli option -D =20 -max_db_connections: 10 -var_dir: /var/local/tmp/vsc/logs/ -root_domain: ROOT_DOMAIN -report_base: https://server.tld/path/to/vsc/main -smtp_server: smtp.yourorg.tld +max_runtime: 21600 #the maximum amount of time a scan can run (def: 5 ho= urs) +max_db_connections: 10 #the maximum number of shared mysql connections f= or all threads +var_dir: /var/local/tmp/vsc/logs/ #equivalent to the var_dir config opti= on in the vsc db +root_domain: ROOT_DOMAIN #your VSC root domain +report_base: https://server.tld/path/to/vsc/main #path to your VSC web i= nterface for scan + #notifications +smtp_server: smtp.yourorg.tld #smtp server to use for scan completion em= ails =20 [mysql] database: vsc |