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

 

 


Tema destacado: Usando Git para manipular el directorio de trabajo, el índice y commits (segunda parte)


+  Foro de elhacker.net
|-+  Programación
| |-+  Desarrollo Web (Moderador: #!drvy)
| | |-+  Me recomendais algún algoritmo de bruteforce?
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Me recomendais algún algoritmo de bruteforce?  (Leído 2,033 veces)
@XSStringManolo
Hacker/Programador
Colaborador
***
Desconectado Desconectado

Mensajes: 2.397


Turn off the red ligth


Ver Perfil WWW
Me recomendais algún algoritmo de bruteforce?
« en: 12 Marzo 2020, 17:03 pm »

Llevo tiempo intentando hacer uno, pero nunca lo consigo xD

Os dejo mi último intento por si veis alguna forma de arreglarlo o conoceis algun algoritmo que me sea sencillo de implementar o copiar.

Código
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. </head>
  6. <body>
  7.  
  8. <script>
  9. function bruteforce(mainUrl, longitud, dictio) {
  10.  var directories = [];
  11.  var increaseSize = false;
  12.  var tmpUrl = mainUrl;
  13.  var permanecerEnBucle = true;
  14.  var posicionCambio = "";
  15. var dict = dictio || " abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ1234567890/-.?=_";
  16. /* var dict = "abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ1234567890/-.?=_";
  17.   dict = "abcdefghijklmnñopqrstuvwxyz";
  18. */var tmp, fuck = "", sigChar, wtf;
  19.  dict = dict.split("");
  20.  
  21. /*  longitud *= dict.length;     */    /* Max Length of the directory without domain */
  22.  
  23.  for(var i = 0, j=0, k=0; i < longitud; ++i, ++j) {
  24.    directories[i] = mainUrl + dict[j];          /* Append current character to base url */
  25.    tmp = directories[i].substring((mainUrl.length-k), directories[i].length);          /* current directory without path */
  26.    if (j == (dict.length-1)) {          /* Last character of the dictionary */
  27.      j = -1;          /* Reset dictionary itherator. j = 0 next ither */
  28.      if(tmp[(tmp.length-1)] == dict[(dict.length-1)]) {          /* Check lf Last char of current directory without path matches last dictionary char */
  29.        permanecerEnBucle=true;          /* reset loop */
  30.        posicionCambio = "";          /* reset diff ocurrences */
  31.        for(var a = 0; a < tmp.length; ++a) {          /* Loop over directories no path included */
  32.          if((tmp[a] == dict[(dict.length-1)]) && (permanecerEnBucle == true)) {          /* if all characters in the directorie name match last dictionary character */
  33.            increaseSize = true;          
  34.          } else {
  35.            posicionCambio += a.toString();          /* Log first non dictionary end char possition */
  36.          increaseSize = false;
  37.            permanecerEnBucle = false;          /* Force increaseSize to remain false */
  38.          }
  39.        }
  40.        if (increaseSize) {
  41.          for(var c = 0, restart=""; c < tmp.length; ++c) {          /* for each char in tmp */
  42.            restart += dict[0];          /* Add first dictionary ocurrence  */
  43.          }
  44.          mainUrl = tmpUrl + restart;          /* Add the new generated path to main url */
  45.          ++k;          /* Count size increased */
  46.          increaseSize = false;          /* done */
  47.          } else {
  48.                      /* If all chars not matching last dicctionary char */
  49.            if (tmp === undefined) {          /* need to debug */
  50.              alert("tmp undefined");
  51.              tmp = "";
  52.            }
  53. /*alert(tmp);*/
  54.  
  55.  sigChar = dict.indexOf(tmp[(posicionCambio[0])]);
  56.  
  57.  
  58.        /*    sigChar = dict.indexOf(tmp[0]);*/          /* Get actual character position inside dictionary */
  59.            ++sigChar;          /* Get next character */
  60. /*alert("Char actual = " + sigChar);*/
  61. /*alert("Current: "+ directories[i] + "\n\nnext char " + dict[sigChar] + "\n\nPosition: " + posicionCambio[((posicionCambio.length-1)-1)]);*/
  62.            for(var d = 0, fuck = ""; d < (tmp.length-1); ++d) {          
  63.              if(d != posicionCambio[0] ) {          /* get path characters */
  64.                fuck += tmp[d];
  65. /*alert("if fuck = "+ fuck);*/
  66.              } else {
  67.                fuck += dict[sigChar];          /* get next character in rigth position */
  68. /*alert("else fuck = "+ fuck);*/
  69.              }
  70.            }
  71.            wtf = fuck.split("").reverse().join("");            /* Reversing string trying to fix the character in rigth position */
  72.            mainUrl = tmpUrl + wtf;          /* Appending reversed dirname to url */
  73.          }
  74.        }
  75.      }
  76.    }  
  77. alert("Número de combinaciones generadas: " + directories.length);
  78. alert("Número de letras en total: " + directories.join("").length);
  79.  return directories;          /* Return all urls generated. */
  80. }
  81.  
  82. var url = prompt("URL.\n\nExample: https://facebook.com/");
  83. var lengt = prompt("Number os results.\n\nExample: 10");
  84. var dictionary = prompt("Dictionary.\n\nExample: abcde12345!@#$ or accept to use default");
  85.  
  86. var arrDirs = bruteforce(url, lengt, dictionary);
  87. document.write(arrDirs);
  88.  
  89. </script>
  90. </body>
  91. </html>


En línea

Mi perfil de patrocinadores de GitHub está activo! Puedes patrocinarme para apoyar mi trabajo de código abierto 💖

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Me recomendais algún programilla?
Multimedia
Spica 2 1,755 Último mensaje 3 Enero 2008, 14:51 pm
por Songoku
¿Me recomendais algun NetBook barato?
Hardware
Erik# 4 3,089 Último mensaje 2 Julio 2010, 00:16 am
por Aprendiz-Oscuro
¿Algún Bruteforce para HTTP-GET?
Hacking
Latroma 0 2,400 Último mensaje 21 Abril 2011, 13:03 pm
por Latroma
Tengo muchas ganas de probar algun distro de linux cual me recomendais? « 1 2 »
GNU/Linux
Darves 13 5,951 Último mensaje 30 Agosto 2012, 04:36 am
por dato000
Me recomendais algún proveedor de dominios?
Desarrollo Web
samjack 3 2,056 Último mensaje 10 Septiembre 2012, 01:41 am
por samjack
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines