lib/ronin/sql/injection.rb in ronin-sql-0.2.1 vs lib/ronin/sql/injection.rb in ronin-sql-0.2.2

- old
+ new

@@ -23,13 +23,15 @@ require 'ronin/sql/error' require 'ronin/code/sql/injection' require 'ronin/sessions/http' require 'ronin/extensions/uri' -require 'ronin/web/extensions/hpricot' -require 'ronin/web/web' +require 'ronin/web/extensions/nokogiri' +require 'ronin/web/spider' +require 'nokogiri' + module Ronin module SQL class Injection include Sessions::HTTP @@ -75,11 +77,11 @@ # end # def Injection.spider(url,options={},&block) injections = [] - Web.spider_site(url,options) do |spider| + Web::Spider.site(url,options) do |spider| spider.every_url_like(/\?[a-zA-Z0-9_]/) do |vuln_url| found = vuln_url.sql_injections found.each(&block) if block injections += found @@ -132,14 +134,14 @@ if (body1.sql_error? || body2.sql_error?) return false end - body1 = Hpricot(body1) - body2 = Hpricot(body2) + body1 = Nokogiri::HTML(body1) + body2 = Nokogiri::HTML(body2) - return body1 < body2 + return body1.total_children < body2.total_children end def has_column?(column,options={}) body1 = inject(options) body2 = inject(options.merge(:symbols => {:column => column})) do @@ -148,14 +150,14 @@ if (body1.sql_error? || body2.sql_error?) return false end - body1 = Hpricot(body1) - body2 = Hpricot(body2) + body1 = Nokogiri::HTML(body1) + body2 = Nokogiri::HTML(body2) - return body1 == body2 + return body1.total_children == body2.total_children end def has_table?(table,options={}) body1 = inject(options) body2 = inject(options.merge(:symbols => {:table => table})) do @@ -164,14 +166,14 @@ if (body1.sql_error? || body2.sql_error?) return false end - body1 = Hpricot(body1) - body2 = Hpricot(body2) + body1 = Nokogiri::HTML(body1) + body2 = Nokogiri::HTML(body2) - return body1 == body2 + return body1.total_children == body2.total_children end def uses_column?(column,options={}) body1 = inject(options) body2 = inject(options.merge(:symbols => {:column => column})) do @@ -180,14 +182,14 @@ if (body1.sql_error? || body2.sql_error?) return false end - body1 = Hpricot(body1) - body2 = Hpricot(body2) + body1 = Nokogiri::HTML(body1) + body2 = Nokogiri::HTML(body2) - return body1 == body2 + return body1.total_children == body2.total_children end def uses_table?(table,options={}) body1 = inject(options) body2 = inject(options.merge(:symbols => {:table => table})) do @@ -196,13 +198,13 @@ if (body1.sql_error? || body2.sql_error?) return false end - body1 = Hpricot(body1) - body2 = Hpricot(body2) + body1 = Nokogiri::HTML(body1) + body2 = Nokogiri::HTML(body2) - return body1 == body2 + return body1.total_children == body2.total_children end def to_s @url.to_s end