Rapid7 Vulnerability & Exploit Database

Ghostscript Failed Restore Command Execution

Back to Search

Ghostscript Failed Restore Command Execution

Disclosed
08/21/2018
Created
03/19/2019

Description

This module exploits a -dSAFER bypass in Ghostscript to execute arbitrary commands by handling a failed restore (grestore) in PostScript to disable LockSafetyParams and avoid invalidaccess. This vulnerability is reachable via libraries such as ImageMagick.

Author(s)

  • Tavis Ormandy
  • wvu <wvu@metasploit.com>

Platform

Linux,Unix,Windows

Architectures

cmd, x86, x64

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/multi/fileformat/ghostscript_failed_restore
msf exploit(ghostscript_failed_restore) > show targets
    ...targets...
msf exploit(ghostscript_failed_restore) > set TARGET < target-id >
msf exploit(ghostscript_failed_restore) > show options
    ...show and set options...
msf exploit(ghostscript_failed_restore) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;