3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check_for_exploit($host,$port=80,$timeout=10){ $range = '0-1'; for($i=0;$i<20;$i++){ $range .= ",5-$i"; } $error_code = null; $error = null; $socket = fsockopen($host,$port,$error_code,$error,$timeout); $packet = "HEAD / HTTP/1.1\r\nHost: $host\r\nRange:bytes=$range\r\nAccept-Encoding: gzip\r\nConnection: close\r\n\r\n"; fwrite($socket,$packet); $result = fread($socket,2048); //check to see if "Partial" is in the response if(strstr($result,"Partial") !== false){ return true; } return false; } echo check_for_exploit("http://www.smiths-gloucester.co.uk/"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/liBSb
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'check_for_exploit'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.smiths-gloucester.co.uk%2F'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   24     4      > RETURN                                                   1

Function check_for_exploit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 44
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
Branch analysis from position: 6
filename:       /in/liBSb
function name:  check_for_exploit
number of ops:  46
compiled vars:  !0 = $host, !1 = $port, !2 = $timeout, !3 = $range, !4 = $i, !5 = $error_code, !6 = $error, !7 = $socket, !8 = $packet, !9 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      80
          2        RECV_INIT                                        !2      10
    3     3        ASSIGN                                                   !3, '0-1'
    4     4        ASSIGN                                                   !4, 0
          5      > JMP                                                      ->10
    5     6    >   NOP                                                      
          7        FAST_CONCAT                                      ~12     '%2C5-', !4
          8        ASSIGN_OP                                     8          !3, ~12
    4     9        PRE_INC                                                  !4
         10    >   IS_SMALLER                                               !4, 20
         11      > JMPNZ                                                    ~15, ->6
    8    12    >   ASSIGN                                                   !5, null
    9    13        ASSIGN                                                   !6, null
   11    14        INIT_FCALL                                               'fsockopen'
         15        SEND_VAR                                                 !0
         16        SEND_VAR                                                 !1
         17        SEND_REF                                                 !5
         18        SEND_REF                                                 !6
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $18     
         21        ASSIGN                                                   !7, $18
   12    22        ROPE_INIT                                     5  ~21     'HEAD+%2F+HTTP%2F1.1%0D%0AHost%3A+'
         23        ROPE_ADD                                      1  ~21     ~21, !0
         24        ROPE_ADD                                      2  ~21     ~21, '%0D%0ARange%3Abytes%3D'
         25        ROPE_ADD                                      3  ~21     ~21, !3
         26        ROPE_END                                      4  ~20     ~21, '%0D%0AAccept-Encoding%3A+gzip%0D%0AConnection%3A+close%0D%0A%0D%0A'
         27        ASSIGN                                                   !8, ~20
   13    28        INIT_FCALL                                               'fwrite'
         29        SEND_VAR                                                 !7
         30        SEND_VAR                                                 !8
         31        DO_ICALL                                                 
   14    32        INIT_FCALL                                               'fread'
         33        SEND_VAR                                                 !7
         34        SEND_VAL                                                 2048
         35        DO_ICALL                                         $26     
         36        ASSIGN                                                   !9, $26
   16    37        INIT_FCALL                                               'strstr'
         38        SEND_VAR                                                 !9
         39        SEND_VAL                                                 'Partial'
         40        DO_ICALL                                         $28     
         41        TYPE_CHECK                                  1018          $28
         42      > JMPZ                                                     ~29, ->44
   17    43    > > RETURN                                                   <true>
   19    44    > > RETURN                                                   <false>
   20    45*     > RETURN                                                   null

End of function check_for_exploit

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.3 ms | 1403 KiB | 22 Q