3v4l.org

run code in 300+ PHP versions simultaneously
<?php $passwd = 'censored'; $username = 'archive.zip'; if (isset ($_POST['password'])) { if ($_POST['password'] == $passwd) { if (isset ($_POST['username'])) { $username = escapeshellarg ($_POST['username']); } echo "<pre>"; echo shell_exec ("sh sync.sh {$username} {$passwd}"); echo "</pre>"; } else { outputPage ("Your password didn't check out, mon. Better try it again, eh?"); } } else { outputPage(); } function outputPage ($errorMessage = '') { echo <<<HTML <html><head><title>Mail Sync</title> <style type="text/css"> td.left { text-align: right; } td.right { text-align: left; } div { color: red; border: 1px solid gray; padding: 4px; } </style> </head> <body> HTML; if (!empty ($errorMessage)) { echo "\n<div>$errorMessage</div>\n"; } echo <<<HTMLL <h1>Mail Sync</h1> <form name="zipform" method="post" action="unzipper.php"> <table> <tr> <td class="left">Username:</td> <td class="right"><input type="text" name="username" size="50" maxlength="255" />@mcsmortgage.com</td> </tr><tr> <td class="left">Password:</td> <td class="right"><input type="password" name="password" size="15" maxlength="30" /></td> </tr><tr> <td class="right"><input type="reset" value="Reset" /></td> <td class="left"><input type="submit" value="Sync Mail!" /></td> </tr> </table> </form> </body> </html> HTMLL; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 33
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 29
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v4L0o
function name:  (null)
number of ops:  36
compiled vars:  !0 = $passwd, !1 = $username
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'censored'
    3     1        ASSIGN                                                   !1, 'archive.zip'
    5     2        FETCH_IS                                         ~4      '_POST'
          3        ISSET_ISEMPTY_DIM_OBJ                         0          ~4, 'password'
          4      > JMPZ                                                     ~5, ->33
    6     5    >   FETCH_R                      global              ~6      '_POST'
          6        FETCH_DIM_R                                      ~7      ~6, 'password'
          7        IS_EQUAL                                                 !0, ~7
          8      > JMPZ                                                     ~8, ->29
    7     9    >   FETCH_IS                                         ~9      '_POST'
         10        ISSET_ISEMPTY_DIM_OBJ                         0          ~9, 'username'
         11      > JMPZ                                                     ~10, ->18
         12    >   INIT_FCALL                                               'escapeshellarg'
         13        FETCH_R                      global              ~11     '_POST'
         14        FETCH_DIM_R                                      ~12     ~11, 'username'
         15        SEND_VAL                                                 ~12
         16        DO_ICALL                                         $13     
         17        ASSIGN                                                   !1, $13
    9    18    >   ECHO                                                     '%3Cpre%3E'
   10    19        INIT_FCALL                                               'shell_exec'
         20        ROPE_INIT                                     4  ~16     'sh+sync.sh+'
         21        ROPE_ADD                                      1  ~16     ~16, !1
         22        ROPE_ADD                                      2  ~16     ~16, '+'
         23        ROPE_END                                      3  ~15     ~16, !0
         24        SEND_VAL                                                 ~15
         25        DO_ICALL                                         $18     
         26        ECHO                                                     $18
   11    27        ECHO                                                     '%3C%2Fpre%3E'
         28      > JMP                                                      ->32
   14    29    >   INIT_FCALL_BY_NAME                                       'outputPage'
         30        SEND_VAL_EX                                              'Your+password+didn%27t+check+out%2C+mon.+Better+try+it+again%2C+eh%3F'
         31        DO_FCALL                                      0          
         32    > > JMP                                                      ->35
   17    33    >   INIT_FCALL_BY_NAME                                       'outputPage'
         34        DO_FCALL                                      0          
   55    35    > > RETURN                                                   1

Function outputpage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/v4L0o
function name:  outputPage
number of ops:  11
compiled vars:  !0 = $errorMessage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV_INIT                                        !0      ''
   21     1        ECHO                                                     '++++++++%3Chtml%3E%3Chead%3E%3Ctitle%3EMail+Sync%3C%2Ftitle%3E%0A++++++++++++%3Cstyle+type%3D%22text%2Fcss%22%3E%0A++++++++++++++++td.left++%7B+text-align%3A+right%3B+%7D%0A++++++++++++++++td.right+%7B+text-align%3A+left%3B+%7D%0A%0A++++++++++++++++div++%7B+color%3A+red%3B+border%3A+1px+solid+gray%3B+padding%3A+4px%3B+%7D%0A++++++++++++%3C%2Fstyle%3E%0A++++++++%3C%2Fhead%3E%0A++++++++%3Cbody%3E'
   32     2        ISSET_ISEMPTY_CV                                 ~1      !0
          3        BOOL_NOT                                         ~2      ~1
          4      > JMPZ                                                     ~2, ->9
          5    >   ROPE_INIT                                     3  ~4      '%0A%3Cdiv%3E'
          6        ROPE_ADD                                      1  ~4      ~4, !0
          7        ROPE_END                                      2  ~3      ~4, '%3C%2Fdiv%3E%0A'
          8        ECHO                                                     ~3
   35     9    >   ECHO                                                     '++++++++%3Ch1%3EMail+Sync%3C%2Fh1%3E%0A++++++++%3Cform+name%3D%22zipform%22+method%3D%22post%22+action%3D%22unzipper.php%22%3E%0A++++++++++++%3Ctable%3E%0A++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++%3Ctd+class%3D%22left%22%3EUsername%3A%3C%2Ftd%3E%0A++++++++++++++++++++%3Ctd+class%3D%22right%22%3E%3Cinput+type%3D%22text%22+name%3D%22username%22+size%3D%2250%22+maxlength%3D%22255%22+%2F%3E%40mcsmortgage.com%3C%2Ftd%3E%0A++++++++++++++++%3C%2Ftr%3E%3Ctr%3E%0A++++++++++++++++++++%3Ctd+class%3D%22left%22%3EPassword%3A%3C%2Ftd%3E%0A++++++++++++++++++++%3Ctd+class%3D%22right%22%3E%3Cinput+type%3D%22password%22+name%3D%22password%22+size%3D%2215%22+maxlength%3D%2230%22+%2F%3E%3C%2Ftd%3E%0A++++++++++++++++%3C%2Ftr%3E%3Ctr%3E%0A++++++++++++++++++++%3Ctd+class%3D%22right%22%3E%3Cinput+type%3D%22reset%22+value%3D%22Reset%22+%2F%3E%3C%2Ftd%3E%0A++++++++++++++++++++%3Ctd+class%3D%22left%22%3E%3Cinput+type%3D%22submit%22+value%3D%22Sync+Mail%21%22+%2F%3E%3C%2Ftd%3E%0A++++++++++++++++%3C%2Ftr%3E%0A++++++++++++%3C%2Ftable%3E%0A%0A++++++++%3C%2Fform%3E%0A++++++++%3C%2Fbody%3E%0A++++++++%3C%2Fhtml%3E'
   54    10      > RETURN                                                   null

End of function outputpage

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.47 ms | 1400 KiB | 17 Q