3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_POST['host'] = 'www.seznam.cz'; $_POST['hmac'] = 'ea490cb67d21d43592c2b20a5339da2b373c2de39e4a5bcfab9872d448955376'; $_POST['nonce'] = true; if ( empty($_POST['nonce']) || empty($_POST['hmac']) || empty($_POST['host']) ) { header('HTTP/1.0 400 Bad Request'); exit; } $secret = '6556464'; $secret = hash_hmac('sha256', $_POST['nonce'], $secret); $hmac = hash_hmac('sha256', $_POST['host'], $secret); var_dump($hmac); if ($hmac !== $_POST['hmac']) { header('HTTP/1.0 403 Forbidden'); exit; } var_dump('lol'); echo exec("host " . $_POST['host']);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
2 jumps found. (Code = 47) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 52
Branch analysis from position: 48
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Branch analysis from position: 15
filename:       /in/bCilf
function name:  (null)
number of ops:  63
compiled vars:  !0 = $secret, !1 = $hmac
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                      global              $2      '_POST'
          1        ASSIGN_DIM                                               $2, 'host'
          2        OP_DATA                                                  'www.seznam.cz'
    4     3        FETCH_W                      global              $4      '_POST'
          4        ASSIGN_DIM                                               $4, 'hmac'
          5        OP_DATA                                                  'ea490cb67d21d43592c2b20a5339da2b373c2de39e4a5bcfab9872d448955376'
    5     6        FETCH_W                      global              $6      '_POST'
          7        ASSIGN_DIM                                               $6, 'nonce'
          8        OP_DATA                                                  <true>
    9     9        FETCH_IS                                         ~8      '_POST'
         10        ISSET_ISEMPTY_DIM_OBJ                         1  ~9      ~8, 'nonce'
         11      > JMPNZ_EX                                         ~9      ~9, ->15
   10    12    >   FETCH_IS                                         ~10     '_POST'
         13        ISSET_ISEMPTY_DIM_OBJ                         1  ~11     ~10, 'hmac'
         14        BOOL                                             ~9      ~11
         15    > > JMPNZ_EX                                         ~9      ~9, ->19
   11    16    >   FETCH_IS                                         ~12     '_POST'
         17        ISSET_ISEMPTY_DIM_OBJ                         1  ~13     ~12, 'host'
         18        BOOL                                             ~9      ~13
         19    > > JMPZ                                                     ~9, ->24
   13    20    >   INIT_FCALL                                               'header'
         21        SEND_VAL                                                 'HTTP%2F1.0+400+Bad+Request'
         22        DO_ICALL                                                 
   14    23      > EXIT                                                     
   17    24    >   ASSIGN                                                   !0, '6556464'
   19    25        INIT_FCALL                                               'hash_hmac'
         26        SEND_VAL                                                 'sha256'
         27        FETCH_R                      global              ~16     '_POST'
         28        FETCH_DIM_R                                      ~17     ~16, 'nonce'
         29        SEND_VAL                                                 ~17
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                         $18     
         32        ASSIGN                                                   !0, $18
   20    33        INIT_FCALL                                               'hash_hmac'
         34        SEND_VAL                                                 'sha256'
         35        FETCH_R                      global              ~20     '_POST'
         36        FETCH_DIM_R                                      ~21     ~20, 'host'
         37        SEND_VAL                                                 ~21
         38        SEND_VAR                                                 !0
         39        DO_ICALL                                         $22     
         40        ASSIGN                                                   !1, $22
   22    41        INIT_FCALL                                               'var_dump'
         42        SEND_VAR                                                 !1
         43        DO_ICALL                                                 
   23    44        FETCH_R                      global              ~25     '_POST'
         45        FETCH_DIM_R                                      ~26     ~25, 'hmac'
         46        IS_NOT_IDENTICAL                                         !1, ~26
         47      > JMPZ                                                     ~27, ->52
   24    48    >   INIT_FCALL                                               'header'
         49        SEND_VAL                                                 'HTTP%2F1.0+403+Forbidden'
         50        DO_ICALL                                                 
   25    51      > EXIT                                                     
   28    52    >   INIT_FCALL                                               'var_dump'
         53        SEND_VAL                                                 'lol'
         54        DO_ICALL                                                 
   29    55        INIT_FCALL                                               'exec'
         56        FETCH_R                      global              ~30     '_POST'
         57        FETCH_DIM_R                                      ~31     ~30, 'host'
         58        CONCAT                                           ~32     'host+', ~31
         59        SEND_VAL                                                 ~32
         60        DO_ICALL                                         $33     
         61        ECHO                                                     $33
         62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.36 ms | 1400 KiB | 21 Q