bWAPP----PHP Code Injection

 

主要代码

 

 1 <div >
 2 
 3     <h1>PHP Code Injection</h1>
 4 
 5     <p>This is just a test page, reflecting back your <a href="<?php echo($_SERVER["SCRIPT_NAME"]);?>?message=test">message</a>...</p>
 6     
 7 <?php
 8 
 9 if(isset($_REQUEST["message"]))                                                              //这里接受message参数
10 {
11 
12     // If the security level is not MEDIUM or HIGH
13     if($_COOKIE["security_level"] != "1" && $_COOKIE["security_level"] != "2")               //如果是low级别执行下列代码
14     {
15 
16 ?>
17     <p><i><?php @eval ("echo " . $_REQUEST["message"] . ";");?></i></p>                      //直接echo  message
18 
19 <?php
20 
21     }
22 
23     // If the security level is MEDIUM or HIGH
24     else                                                                                   //如果不是low级别,进行echo函数过滤
25     {
26 ?>
27     <p><i><?php echo htmlspecialchars($_REQUEST["message"], ENT_QUOTES, "UTF-8");;?></i></p>
28 
29 <?php
30 
31     }
32 
33 }
34 
35 ?>
36 </div>

bWAPP----PHP Code Injection

本人水平比较低,想到的是phpinfo(),然后直接上刀,看YouTube上的老外,直接命令执行反弹一个NC

相关文章:

  • 2021-12-23
  • 2021-09-02
  • 2021-11-23
  • 2021-06-10
  • 2021-05-16
  • 2021-10-09
  • 2021-12-07
  • 2019-10-18
猜你喜欢
  • 2021-05-11
  • 2021-11-28
  • 2021-10-06
  • 2021-12-15
  • 2021-11-19
  • 2021-06-23
  • 2021-06-08
  • 2021-06-06
相关资源
相似解决方案