Sablog X 2 0 後台管理許可權欺騙漏洞

2021-12-29 16:12:10 字數 2201 閱讀 7932

下面來看下這幾個變數是怎麼來的

漏洞:)

$seccode = $sessionexists = 0;

$userfields = u.userid as sax_uid, u.username as sax_user, u.password as sax_pw, u.groupid as sax_group, u.logincount as sax_logincount, u.email as sax_email, u.url as sax_url, u.lastpost, u.lastip, u.lastvisit, u.lastactivity;

// 這裡定義的字段包括sax_user、sax_pw、sax_group、sax_logincount,這些都是後台許可權驗證時要用到的

if ($sax_hash) users u

left join sessions s on (s.uid = u.userid)

where s.hash=$sax_hash and u.userid=$sax_uid and concat_ws(.,s.ip1,s.ip2,s.ip3,s.ip4)=$onlineip

and u.password=$sax_pw and u.logincount=$sax_logincount and s.auth_key=$sax_auth_key");

} else sessions where hash=$sax_hash and concat_ws(.,ip1,ip2,ip3,ip4)=$onlineip limit 1");

// 流程[2]

// 如果我們知道管理員的sax_hash和onlineip,就可以使下面的$_evo[sessionuid]的值為管理員的id

}if ($_evo = $db->fetch_array($query))users u where u.userid=".intval($_evo[sessionuid])."");

$_evo = array_merge($_evo, $db->fetch_array($query));

// 這裡查詢的資料會合併到$_evo,而我們只要能控制$_evo[sessionuid]的值為1[假設我們要查詢的管理員id為1],就可以查詢出正確的管理員資訊,這樣就可以保證sax_group的值為1了

$sax_uid = $_evo[userid];

}} else sessions where hash=$sax_hash and concat_ws(.,ip1,ip2,ip3,ip4)=$onlineip"))

}}......

@extract($_evo);

由上面的**可以看到,如果我們知道session表中uid為1的資料的sax_hash和onlineip,通過流程[2][3]就可以查詢出正確的管理員資訊,再通過extract($_evo)註冊變數,就可以通過後台的驗證,獲得管理員許可權了:)

那麼我們如何知道正確的sax_hash和onlineip呢?

query("insert into sessions (hash, auth_key, ip1, ip2, ip3, ip4, uid, groupid, lastactivity, seccode, is_robot) values ($sax_hash, $sax_auth_key, $ips[0], $ips[1], $ips[2], $ips[3], $sax_uid, $sax_group, $timestamp, $seccode, ".is_robot.")");

...replacesession()函式為我們提供幫助,因為$sax_hash、$sax_uid、$onlineip這些變數是可以控制的,所以我們可以向session表**入一條uid為1的資料:)

首先我們使$sax_uid為1,$sax_pw為空,這樣就會跳過流程[1]執行流程[2],這時我們的sax_hash和onlineip在session表中並不存在,所以流程[3]不會執行,通過extract($_evo)註冊變數時也不會重新註冊$sax_uid、$sax_hash和$onlineip,這樣我們就可以通過updatesession()函式向session表中插入一條uid為1同時sax_hash和onlineip也是我們知道的資料了

然後我們重新執行上面的過程,因為這時session表裡已經有了我們需要的資料了,流程[3]將被執行,user表中uid為1的管理員資料將被查詢出並合併到$_evo,並通過extract()重新註冊變數[$sax_group的值將被重新註冊為1],這樣我們就可以通過後台許可權驗證,並獲得管理員許可權了:)

TrustedInstaller管理許可權

trustedinstaller.exe實際上是 windows modules installer 這個服務的程序,路徑位於c windows servicing trustedinstaller.exe。當進行windows update,或者安裝某些微軟發布的安裝包時,windows modu...

Liunx 管理許可權

1.acl許可權 acl access control list 用來設定使用者 除所有者,所屬組,其他組之外的使用者或組 針對檔案的讀 寫 執行許可權。getfacl 檔名 檢視acl許可權 setfacl 選項 檔名 設定acl許可權選項 舉例 我們要求 root 是 acltest 目錄的屬主...

3 管理許可權

授予物件許可權 在oracle9i前,授予物件許可權是由物件的所有者來完成的,如果用其它的使用者來操作,則需要使用者具有相應的 with grant option 許可權,從oracle9i開始,dba,sys,system 可以將任何物件上的物件許可權授予其它使用者.授予物件許可權是用grant命...