Variable functions
'phpinfo'() => phpinfo()
"phpinfo"() => phpinfo()
PHP Type Juggling *( [a-zA-Z0-9_]만 적용 )
system('ls') => system(ls) // Notice: Use of undefined constant ls - assumed 'ls'
PHP Variables Trick
#####################################
$a = 'b';
$b = 'NGA';
$c = '_GET';
echo $$a; // printed NGA
echo $$c['v']; // print $_GET['v']
echo $$c{'v'}; // print $_GET['v']
#####################################
$a = 'phpinfo';
$a(); // execute phpinfo
#####################################
$a = 'NGA';
echo $'a'; // return Parse error : expecting variable (T_VARIABLE) or '{' or '$'
echo ${'a'}; // print NGA
#####################################
$a = p;
$b = h;
$c = i;
$d = n;
$e = f;
$f = o;
($a.$b.$a.$c.$d.$e.$f)();
#####################################
$a = "phpinfn";
$b = "phpinfp";
(--$a)(); // p -> p => Fatal error: Uncaught Error: Call to undefined function phpinfp()
(++$a)(); // n -> o => execute phpinfo
#####################################
~ (NOT)
(~%8f%97%8f%96%91%99%90)(); => phpinfo()
^ (XOR)
(%8f%97%8f%96%91%99%90^%ff%ff%ff%ff%ff%ff%ff)(); => phpinfo()
& (AND)
(thtinfo&zhzinfo)(); => phpinfo()
| (OR)
(phphnfo|phpanfo)(); => phpinfo()
PHP Array Trick (0) | 2020.02.12 |
---|---|
HTTP HEAD method trick in PHP 5.3.5 (0) | 2020.02.12 |
PHP system command functions (0) | 2019.09.24 |
PHP parse_url 과 Curl 의 URL Parsing 차이 (0) | 2019.08.06 |
Read file with PHP Display Error (0) | 2019.07.10 |