ffranz

urlcrazydnsAAAAquery.patch

Jul 31st, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.19 KB | None | 0 0
  1. --- urlcrazy    2012-07-18 07:48:11.000000000 +0200
  2. +++ urlcrazydns6    2012-07-31 14:08:44.000000000 +0200
  3. @@ -73,15 +73,17 @@
  4.  
  5.  
  6.  class Typo
  7. -attr_accessor :type, :name, :valid_name, :tld, :extension, :registered_name, :popularity, :resolved_a, :resolved_mx, :country_a
  8. +attr_accessor :type, :name, :valid_name, :tld, :extension, :registered_name, :popularity, :resolved_a, :resolved_aaaa, :resolved_mx, :country_a
  9.    
  10.     def get_resolved
  11.         @resolved_a=""
  12. +       @resolved_aaaa=""
  13.         @resolved_mx=""
  14.         return if !@valid_name
  15.  
  16.         begin
  17.             @resolved_a=IPSocket.getaddress(@name)
  18. +           @resolved_aaaa=dns.getresources(@name,Resolv::DNS::Resource::IN::AAAA).first.exchange.to_s
  19.        if @resolved_a
  20.          @country_a = Countrylookup.ip2cc(@resolved_a)
  21.        end
  22. @@ -636,9 +638,9 @@
  23.  widths=Array.new
  24.  
  25.  if output_type=="human"
  26. -  headings=["Typo Type","Typo","Valid","Pop","DNS-A","CC-A","DNS-MX","Extn"]
  27. +  headings=["Typo Type","Typo","Valid","Pop","DNS-A","DNS-AAAA","CC-A","DNS-MX","Extn"]
  28.  else
  29. -  headings=["Typo Type","Typo","Valid","Pop","DNS-A","CC-A","Country-A","DNS-MX","Extn"]
  30. +  headings=["Typo Type","Typo","Valid","Pop","DNS-A","DNS-AAAA","CC-A","Country-A","DNS-MX","Extn"]
  31.  end
  32.  (0..headings.size-1).each {|c| columns[c]=Array.new }
  33.  
  34. @@ -666,9 +668,10 @@
  35.         columns[2] << typo.valid_name.to_s
  36.         columns[3] << (check_popularity == true ? typo.popularity.to_s : "?")
  37.         columns[4] << (resolve_domains == true ? typo.resolved_a.to_s : "?" )
  38. -       columns[5] << (resolve_domains == true and typo.country_a ? typo.country_a.join(",") : "?" )
  39. -       columns[6] << (resolve_domains == true ? typo.resolved_mx.to_s : "?" )
  40. -       columns[7] << typo.extension.to_s
  41. +       columns[5] << (resolve_domains == true ? typo.resolved_aaaa.to_s : "?" )
  42. +       columns[6] << (resolve_domains == true and typo.country_a ? typo.country_a.join(",") : "?" )
  43. +       columns[7] << (resolve_domains == true ? typo.resolved_mx.to_s : "?" )
  44. +       columns[8] << typo.extension.to_s
  45.  }
  46.  
  47.  # trim unneeded columns
  48. @@ -683,8 +686,10 @@
  49.  unless resolve_domains
  50.     headings -= ["DNS-A"]
  51.     headings -= ["DNS-MX"]
  52. +   headings -= ["DNS-AAAA"]
  53.     columns[4] =nil
  54.     columns[5] =nil
  55. +   columns[6] =nil
  56.  end
  57.  headings.compact!
  58.  columns.compact!
Advertisement
Add Comment
Please, Sign In to add comment