From 94d33b9207f348bba1029d9a8c3032d999780c5b Mon Sep 17 00:00:00 2001 From: wchen-r7 Date: Mon, 25 Apr 2016 19:45:06 -0500 Subject: [PATCH 1/2] Fix #95, unexpected syntax error '[' in PHP 5.3.6-13 Fix #95 --- php/meterpreter/meterpreter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/meterpreter/meterpreter.php b/php/meterpreter/meterpreter.php index f7c82ded..058247e6 100755 --- a/php/meterpreter/meterpreter.php +++ b/php/meterpreter/meterpreter.php @@ -1263,7 +1263,8 @@ while (false !== ($cnt = select($r, $w, $e, $t))) { } $xor = strrev(substr($header, 0, 4)); $request = substr($header, 4); - $len = unpack("Nlen", xor_bytes($xor, substr($request, 0, 4)))['len']; + $len_array = unpack("Nlen", xor_bytes($xor, substr($request, 0, 4))); + $len = $len_array['len'] # length of the whole packet, including header # packet type should always be 0, i.e. PACKET_TYPE_REQUEST while (strlen($request) < $len) { From 8cbd68b056a9461ae57364b91244e25dd61f9b9b Mon Sep 17 00:00:00 2001 From: James Lee Date: Tue, 26 Apr 2016 14:53:11 -0500 Subject: [PATCH 2/2] Add missing semicolon --- php/meterpreter/meterpreter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/meterpreter/meterpreter.php b/php/meterpreter/meterpreter.php index 058247e6..fa41d5f2 100755 --- a/php/meterpreter/meterpreter.php +++ b/php/meterpreter/meterpreter.php @@ -1264,7 +1264,7 @@ while (false !== ($cnt = select($r, $w, $e, $t))) { $xor = strrev(substr($header, 0, 4)); $request = substr($header, 4); $len_array = unpack("Nlen", xor_bytes($xor, substr($request, 0, 4))); - $len = $len_array['len'] + $len = $len_array['len']; # length of the whole packet, including header # packet type should always be 0, i.e. PACKET_TYPE_REQUEST while (strlen($request) < $len) {