SysV /bin/login Environment Remote Overflow (rlogin) - Nessus
Critical Plugin ID: 10828This page contains detailed information about the SysV /bin/login Environment Remote Overflow (rlogin) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.
Plugin Overview
ID: 10828
Name: SysV /bin/login Environment Remote Overflow (rlogin)
Filename: binlogin_overflow_rlogin.nasl
Vulnerability Published: 2001-12-12
This Plugin Published: 2001-12-15
Last Modification Time: 2018-06-27
Plugin Version: 1.35
Plugin Type: remote
Plugin Family: Gain a shell remotely
Dependencies:
find_service1.nasl
Required KB Items [?]: Settings/ParanoidReport
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 code on the remote host.
Description
The remote /bin/login seems to crash when it receives too many environment variables. This is likely due to a buffer overflow vulnerability which might allow an attacker to execute arbitrary code on the remote host.
Solution
Apply the patch from your vendor (or read the CERT advisory).
Public Exploits
Target Network Port(s): 513
Target Asset(s): Services/rlogin
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 SysV /bin/login Environment Remote Overflow (rlogin) 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 binlogin_overflow_rlogin.nasl nessus plugin source code. This script is Copyright (C) 2001-2018 Tenable Network Security, Inc.
#
# (C) Tenable Network Security, Inc.
#
include("compat.inc");
if (description)
{
script_id(10828);
script_version("1.35");
script_cvs_date("Date: 2018/06/27 18:42:25");
script_cve_id("CVE-2001-0797");
script_bugtraq_id(3681);
script_xref(name:"CERT-CC", value:"CA-2001-34");
script_name(english:"SysV /bin/login Environment Remote Overflow (rlogin)");
script_summary(english:"Attempts to overflow /bin/login");
script_set_attribute(attribute:"synopsis", value:"It is possible to execute arbitrary code on the remote host.");
script_set_attribute(attribute:"description", value:
"The remote /bin/login seems to crash when it receives too many
environment variables. This is likely due to a buffer overflow
vulnerability which might allow an attacker to execute arbitrary code
on the remote host.");
script_set_attribute(attribute:"solution", value:"Apply the patch from your vendor (or read the CERT advisory).");
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:"2001/12/15");
script_set_attribute(attribute:"potential_vulnerability", value:"true");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_end_attributes();
script_category(ACT_DESTRUCTIVE_ATTACK);
script_copyright(english:"This script is Copyright (C) 2001-2018 Tenable Network Security, Inc.");
script_family(english:"Gain a shell remotely");
script_dependencie("find_service1.nasl");
script_require_keys("Settings/ParanoidReport");
script_require_ports("Services/rlogin", 513);
exit(0);
}
include("audit.inc");
include("global_settings.inc");
include("misc_func.inc");
if (report_paranoia < 2) audit(AUDIT_PARANOID);
login = rand_str(length:6);
port = get_kb_item("Services/rlogin");
if(!port)port = 513;
global_var port;
function rlogin(env)
{
local_var soc, s1, s2, a;
if(get_port_state(port))
{
soc = open_priv_sock_tcp(dport:port);
if(soc)
{
s1 = raw_string(0);
s2 = string(login, s1, s1);
send(socket:soc, data:s1);
send(socket:soc, data:s2);
a = recv(socket:soc, length:1, min:1);
if(!strlen(a)){
return(0);
}
if(!(ord(a[0]) == 0)){
return(0);
}
send(socket:soc, data:s1);
a = recv(socket:soc, length:1024, min:1);
if("ogin:" >< a)
{
send(socket:soc, data:string(env, "\r\n"));
a = recv(socket:soc, length:4096);
a = recv(socket:soc, length:4096);
if("word:" >< a)
{
close(soc);
return(1);
}
}
close(soc);
}
else return(0);
}
return(0);
}
if(rlogin(env:login))
{
res = rlogin(env:string(login, " ", crap(data:"A=B ", length:244)));
if(res)
{
res = rlogin(env:string(login, " ", crap(data:"A=B ", length:400)));
if(!res)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/binlogin_overflow_rlogin.nasl
- Windows:
C:\ProgramData\Tenable\Nessus\nessus\plugins\binlogin_overflow_rlogin.nasl
- Mac OS X:
/Library/Nessus/run/lib/nessus/plugins/binlogin_overflow_rlogin.nasl
Go back to menu.
How to Run
Here is how to run the SysV /bin/login Environment Remote Overflow (rlogin) 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 SysV /bin/login Environment Remote Overflow (rlogin) plugin ID 10828.
- 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 binlogin_overflow_rlogin.nasl -t <IP/HOST>
Run the plugin with audit trail message on the console:
/opt/nessus/bin/nasl -a binlogin_overflow_rlogin.nasl -t <IP/HOST>
Run the plugin with trace script execution written to the console (useful for debugging):
/opt/nessus/bin/nasl -T - binlogin_overflow_rlogin.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 binlogin_overflow_rlogin.nasl -t <IP/HOST>
Go back to menu.
References
BID | SecurityFocus Bugtraq ID: CERT-CC | CERT Coordination Center:
- CA-2001-34
- https://www.tenable.com/plugins/nessus/10828
- https://vulners.com/nessus/BINLOGIN_OVERFLOW_RLOGIN.NASL
- 10827 - SysV /bin/login Environment Remote Overflow (telnet check)
- 11136 - Multiple OS /bin/login Remote Overflow
- 10205 - rlogin Service Detection
Version
This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file binlogin_overflow_rlogin.nasl version 1.35. For more plugins, visit the Nessus Plugin Library.
Go back to menu.