• WhaleCTF day1


    image

    文件上传getshell

    image

    一句话木马

    上传路径可能会帮你改名

    服务器要能够解析它

    image

    image#注意bypass

    image

    代码审计工具

    看全局配置文件 config.php / common.inc.php

    审计php脚本


    首先看源码 在全局配置文件common.inc.php

    image进行全局转移

    由于全局utf-8的 排除宽字节

    接下来看upload.php

    image

    上传文件走的流程

    image

    再看rename.php

    image

    • 二次注入
    • 插入的=到数据库后,转移字符消失了。再从数据库中查出后,第二次注入。

    upload.php中

    image

    是存在白名单的,这里没有办法绕过。

    image

    文件名 = xxxx.php

    后缀名为 空

    image

    注入语句:

    insert into `file` ( `filename`, `view`, `extension`) values( '{$path_parts['filename']}

    更新语句

    update `file` set `filename`='{$req['newname']}', `oldname`='{$result['filename']}' where `fid`={$result['fid']}

    构造语句

    update `file set `filename`=’x.jpg’,`oldname`=’’,extension=’’,filename=’x.jpg.jpg’ where `fid`=fid

    newname是’,extension=’’,filename=’x.jpg

  • 相关阅读:
    手机文件夹的emulated什么意思
    数据结构
    Django简介
    forms组件
    前端css
    mysql进阶知识
    mysql入门知识
    html文档知识补充
    前端基础
    python 面试题
  • 原文地址:https://www.cnblogs.com/rookieDanny/p/8733323.html
Copyright © 2020-2023  润新知