[Openvas-commits] r3616 - in trunk/openvas-plugins: . scripts
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Jun 4 12:55:02 CEST 2009
Author: felix
Date: 2009-06-04 12:55:01 +0200 (Thu, 04 Jun 2009)
New Revision: 3616
Modified:
trunk/openvas-plugins/ChangeLog
trunk/openvas-plugins/scripts/ssh_detect.nasl
Log:
* scripts/ssh_detect.nasl:
Fixed several issues:
Require only a found ssh service instead of the service at default port 22.
Removed requirement of bn_random, as it is part of openvas.
Be more verbose (at least log in all cases, no silent exits).
Close the socket.
Added a final exit(0).
Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog 2009-06-04 09:59:08 UTC (rev 3615)
+++ trunk/openvas-plugins/ChangeLog 2009-06-04 10:55:01 UTC (rev 3616)
@@ -1,3 +1,14 @@
+2009-06-04 Felix Wolfsteller <felix.wolfsteller at intevation.de>
+
+ * scripts/ssh_detect.nasl:
+ Fixed several issues:
+ Require only a found ssh service instead of the service at default port
+ 22.
+ Removed requirement of bn_random, as it is part of openvas.
+ Be more verbose (at least log in all cases, no silent exits).
+ Close the socket.
+ Added a final exit(0).
+
2009-06-04 Chandan S <schandan at secpod.com>
* scripts/gb_ms_win2k3_dos_vuln.nasl,
Modified: trunk/openvas-plugins/scripts/ssh_detect.nasl
===================================================================
--- trunk/openvas-plugins/scripts/ssh_detect.nasl 2009-06-04 09:59:08 UTC (rev 3615)
+++ trunk/openvas-plugins/scripts/ssh_detect.nasl 2009-06-04 10:55:01 UTC (rev 3616)
@@ -32,7 +32,7 @@
script_copyright(english:"This script is Copyright (C) 1999 SecuriTeam");
family["english"] = "General";
script_family(english:family["english"]);
- script_require_ports("Services/ssh", 22);
+ script_require_keys("Services/ssh");
script_dependencies("find_service.nes", "find_service2.nasl", "external_svc_ident.nasl");
exit(0);
}
@@ -50,22 +50,21 @@
if (get_port_state(port))
{
soc = open_sock_tcp(port);
- if ( ! soc ) exit(0);
- if ( defined_func("bn_random") )
- {
+ if ( ! soc ){
+ log_message (data:"An ssh server was discovered running on " + port + ", but now no socket to it could be opened.", port:port);
+ exit(0);
+ }
+
ssh_login (socket:soc, login:"n3ssus", password:"n3ssus", pub:NULL, priv:NULL, passphrase:NULL);
version = get_ssh_server_version ();
- banner = get_ssh_banner ();
+ banner = get_ssh_banner ();
supported = get_ssh_supported_authentication ();
- }
- else
- {
- version = recv_line(socket:soc, length:4096);
- if ( !ereg(pattern:"^SSH-", string:version ) ) exit(0);
- }
+ text = "";
- if (version)
+ if (!version)
+ text = "An ssh server with unknown version was found running on this port.";
+ else
{
set_kb_item(name:"SSH/banner/" + port, value:version);
text = "Remote SSH version : " + version + '\n\n';
@@ -82,7 +81,14 @@
text += 'Remote SSH banner : \n' + banner + '\n\n';
}
- security_note(port:port, data:text);
register_service(port: port, proto: "ssh");
}
+
+ security_note(port:port, data:text);
+ close(soc);
}
+else{
+ log_message (data:"An ssh server was discovered or assumed to be running on " + port + ", but the port seems to be closed now.", port:port);
+}
+
+exit(0);
More information about the Openvas-commits
mailing list