OS Command Injection - Blind

先上代码,他判断了win还是linux然后进行了ping但是结果并没有返回。

 1 <div id="main">
2
3 <h1>OS Command Injection - Blind</h1>
4
5 <form action="<?php echo($_SERVER["SCRIPT_NAME"]);?>" method="POST">
6
7 <p>
8
9 <label for="target">Enter your IP address:</label>
10 <input type="text" id="target" name="target" value="">
11
12 <button type="submit" name="form" value="submit">PING</button>
13
14 </p>
15
16 </form>
17 <?php
18
19 if(isset($_POST["target"]))
20 {
21
22 $target = $_POST["target"];
23
24 if($target == "")
25 {
26
27 echo "<font color=\"red\">Please enter your IP address...</font>";
28
29 }
30
31 else
32 {
33
34 echo "Did you captured our GOLDEN packet?";
35
36 if(PHP_OS == "Windows" or PHP_OS == "WINNT" or PHP_OS == "WIN32")
37 {
38
39 // Debugging
40 // echo "Windows!";
41
42 // Increasing the PING count will slow down your web scanner!
43 shell_exec("ping -n 1 " . commandi($target));
44
45 }
46
47 else
48 {
49
50 // Debugging
51 // echo "Not Windows!";
52
53 // Increasing the PING count will slow down your web scanner!
54 shell_exec("ping -c 1 " . commandi($target));
55
56 }
57
58 }
59
60 }
61
62 ?>
63
64 </div>

看反应时间,没有任何ping,只是返回一个信息,服务器的执行速度最快

当服务器正常ping一次后,反应是17

当有命令注入时,多执行了一个命令,所以反应的时间会长,是25

如果是错误命令,服务器不执行,时间会在两者之间。

根据时间的长短就能判断服务器是否执行了注入的命令

防御代码与 上一个命令注入相同。

最新文章

  1. ajax 后台正常执行 错误类型却是404
  2. 【USACO 1.2】Name That Number
  3. Win 7 下制作 mac 系统启动U盘
  4. [整理]Linux压缩与解压缩命令整理。
  5. 为hbase新增节点
  6. make menuconfig出错需要安装文件
  7. SGU 114.Telecasting station
  8. openfire服务器+Spark搭建即时聊天系统 &amp; 阿里云的初步探索
  9. C#数组随机生成四个随机数
  10. 解决idea导入项目后依赖报错问题
  11. 最近学习的 Node.js 之 http
  12. 安装一个Linux
  13. feedparser的安装
  14. 179. Largest Number(INT, String)
  15. list add() 和 addall()的区别
  16. 单点登录(十二)-----遇到问题-----cas启用mongodb验证方式登录后没反应-pac4j-mongo包中的MongoAuthenticatInvocationTargetException
  17. 第二次去苹果店维修MacBook
  18. Lua学习笔记(6): 函数
  19. Error : getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
  20. jQuery代码性能优化

热门文章

  1. Python基础数据类型及其转换
  2. Helium文档12-WebUI自动化-go_to在当前的Web浏览器窗口中打开指定的URL
  3. svn右键菜单不显
  4. 【1】TensorFlow光速入门-tensorflow开发基本流程
  5. day1-linux基础命令
  6. C语言程序设计之 数组2020-10-28
  7. .Net/.Net Core 的界面框架 NanUI 发布新版本啦!
  8. Appium常用操作之「微信滑屏、触屏操作」
  9. RabbitMQ的简单封装
  10. How to Convert and Import VHD to VMDK (VMWare)