rlogin Service Detection - Nessus

High   Plugin ID: 10205

This page contains detailed information about the rlogin Service Detection Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 10205
Name: rlogin Service Detection
Filename: rlogin.nasl
Vulnerability Published: 1990-01-01
This Plugin Published: 1999-08-30
Last Modification Time: 2022-04-11
Plugin Version: 1.36
Plugin Type: remote
Plugin Family: Service detection
Dependencies: find_service1.nasl

Vulnerability Information


Severity: High
Vulnerability Published: 1990-01-01
Patch Published: N/A
CVE [?]: CVE-1999-0651
CPE [?]: N/A

Synopsis

The rlogin service is running on the remote host.

Description

The rlogin service is running on the remote host. This service is vulnerable since data is passed between the rlogin client and server in cleartext. A man-in-the-middle attacker can exploit this to sniff logins and passwords. Also, it may allow poorly authenticated logins without passwords. If the host is vulnerable to TCP sequence number guessing (from any network) or IP spoofing (including ARP hijacking on a local network) then it may be possible to bypass authentication. Finally, rlogin is an easy way to turn file-write access into full logins through the .rhosts or rhosts.equiv files.

Solution

Comment out the 'login' line in /etc/inetd.conf and restart the inetd process. Alternatively, disable this service and use SSH instead.

Public Exploits


Target Network Port(s): 513
Target Asset(s): Services/rlogin
Exploit Available: True (Metasploit Framework)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the rlogin Service Detection vulnerability:

  1. Metasploit: auxiliary/scanner/rservices/rlogin_login
    [rlogin Authentication Scanner]
  2. Metasploit: auxiliary/scanner/rservices/rexec_login
    [rexec Authentication Scanner]
  3. Metasploit: auxiliary/scanner/rservices/rsh_login
    [rsh Authentication Scanner]

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.

Risk Information


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

Go back to menu.

Plugin Source


This is the rlogin.nasl nessus plugin source code. This script is Copyright (C) 1999-2022 Tenable Network Security, Inc.

#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(10205);
  script_version("1.36");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");

  script_cve_id("CVE-1999-0651");

  script_name(english:"rlogin Service Detection");

  script_set_attribute(attribute:"synopsis", value:
"The rlogin service is running on the remote host.");
  script_set_attribute(attribute:"description", value:
"The rlogin service is running on the remote host. This service is
vulnerable since data is passed between the rlogin client and server
in cleartext. A man-in-the-middle attacker can exploit this to sniff
logins and passwords. Also, it may allow poorly authenticated logins
without passwords. If the host is vulnerable to TCP sequence number
guessing (from any network) or IP spoofing (including ARP hijacking on
a local network) then it may be possible to bypass authentication.
Finally, rlogin is an easy way to turn file-write access into full
logins through the .rhosts or rhosts.equiv files.");
  script_set_attribute(attribute:"solution", value:
"Comment out the 'login' line in /etc/inetd.conf and restart the inetd
process. Alternatively, disable this service and use SSH instead.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");

  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:'rlogin Authentication Scanner');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"1990/01/01");
  script_set_attribute(attribute:"plugin_publication_date", value:"1999/08/30");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Service detection");

  script_copyright(english:"This script is Copyright (C) 1999-2022 Tenable Network Security, Inc.");

  script_dependencies("find_service1.nasl");
  script_require_ports("Services/rlogin", 513);

  exit(0);
}

#
# The script code starts here
#
include("global_settings.inc");
include("misc_func.inc");

function test(port)
{
  local_var	soc, s, c, a, r;

  if (! get_port_state(port)) return 0;
  soc = open_priv_sock_tcp(dport:port);
  if (! soc) return 0;
  s = '\0';
  send(socket:soc, data:s);
  s = 'root\0root\0xterm/38400\0';
  send(socket:soc, data:s);
  c = recv(socket:soc, length: 1);
  if (strlen(c) == 0 || c != '\0')
  {
    close(soc);
    return 0;
  }
  r = recv(socket:soc, length:1024);
  close(soc);
  a = strcat(c, r);
  set_kb_banner(port: port, type: "rlogin", banner: a);
  if (strlen(r) < 1) return 0;
  if (port == 513 || 'assword:' >< r)
    return 1;
  else
    return 0;
}

port_l = make_service_list(513, "Services/rlogin");
done = make_list();

foreach p (port_l)
  if (! done[p])
  {
    if (test(port: p))
    {
      pci_report = 'The remote RLOGIN service on port ' + p + ' accepts cleartext logins.';
      set_kb_item(name:"PCI/ClearTextCreds/" + p, value:pci_report);
      security_hole(port: p);
      register_service(port: p, proto: "rlogin");
    }
    done[p] = 1;
  }

if (! get_kb_item("global_settings/disable_service_discovery")
    && thorough_tests)
  foreach p (get_kb_list("Services/unknown"))
    if (! done[p] && service_is_unknown(port: p))
    {
      if (test(port: p))
      {
        pci_report = 'The remote RLOGIN service on port ' + p + ' accepts cleartext logins.';
        set_kb_item(name:"PCI/ClearTextCreds/" + p, value:pci_report);
        security_hole(port: p);
        register_service(port: p, proto: "rlogin");
      }
      done[p] = 1;
    }

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

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

Go back to menu.

How to Run


Here is how to run the rlogin Service Detection 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 Service detection plugin family.
  6. On the right side table select rlogin Service Detection plugin ID 10205.
  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 rlogin.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

/opt/nessus/bin/nasl -T - 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 rlogin.nasl -t <IP/HOST>

Go back to menu.

References


See also: Similar and related Nessus plugins:
  • 10245 - rsh Service Detection
  • 10828 - SysV /bin/login Environment Remote Overflow (rlogin)

Version


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

Go back to menu.