0x00前言
a.关于图片马
图片马成功getshell的前提是靶标存在文件包含漏洞,而不是说直接说上传图片马(eg:1.jpg)就行了。你要让它能被服务端解析。
b.关于.user.ini
就是用户自定义的配置文件 实际上除了特定敏感配置选项(只能由php_ini_system修改)其余选项都能通过.user.ini修改
官方定义.user.ini: 除了主 php.ini 之外,PHP 还会在每个目录下扫描 INI 文件,从被执行的 PHP 文件所在目录开始一直上升到 web 根目录($_SERVER[‘DOCUMENT_ROOT’] 所指定的)。如果被执行的 PHP 文件在 web 根目录之外,则只扫描该目录。
两个新的 INI 指令, user_ini.filename 和 user_ini.cache_ttl 控制着用户 INI 文件的使用。
user_ini.filename 设定了 PHP 会在每个目录下搜寻的文件名;如果设定为空字符串则 PHP 不会搜寻。默认值是 .user.ini。
user_ini.cache_ttl 控制着重新读取用户 INI 文件的间隔时间。默认是 300 秒(5 分钟)。 与php.ini不同的是,修改.user.ini是不需要重启中间件的,只需要等待重新读取用户ini文件的间隔时间即可 
参考文章
https://wooyun.js.org/drops/user.ini%E6%96%87%E4%BB%B6%E6%9E%84%E6%88%90%E7%9A%84PHP%E5%90%8E%E9%97%A8.html
0x01 Brain.md
 php各种后缀名绕过皆已尝试,预测是白名单  加上图片头即可绕过
exif_imagetype() 读取一个图像的第一个字节并检查其签名。如果发现了恰当的签名则返回一个对应的常量,否则返回 FALSE。
可上传图片形式的文件 —> 图片马 对<?也做了检测 —> script绕过
本题中须知的重要的配置选项  截取官方文档(为保证原汁原味皆不做机翻)
auto_append_file string Specifies the name of a file that is automatically parsed after the main file. The file is included as if it was called with the require function, so include_path is used.
auto_prepend_file string Specifies the name of a file that is automatically parsed before the main file. The file is included as if it was called with the require function, so include_path is used.
自动包含指定的文件,一个是在主文件之前,一个之后
理一下思路: 1.上图片马 2.通过上传.user.ini指定包含图片马(加上文件头) 3.注意此处利用存在前提! 当前目录下存在正常的php文件!不然即使包含了图片马也没有用
   done
0x02 rethink
对于服务器一些特殊配置选项可以稍作了解,拓宽思路 flag:每日一blog
|