Browse Source

Retab all the things (except external/)

Tab Assassin 6 years ago
parent
commit
2e8d19edcf
100 changed files with 13439 additions and 13439 deletions
  1. 23
    23
      data/exploits/capture/http/forms/extractforms.rb
  2. 53
    53
      data/exploits/capture/http/forms/grabforms.rb
  3. 55
    55
      data/exploits/psnuffle/ftp.rb
  4. 67
    67
      data/exploits/psnuffle/imap.rb
  5. 68
    68
      data/exploits/psnuffle/pop3.rb
  6. 198
    198
      data/exploits/psnuffle/smb.rb
  7. 33
    33
      data/exploits/psnuffle/url.rb
  8. 48
    48
      data/john/run.linux.x64.mmx/genincstats.rb
  9. 48
    48
      data/john/run.linux.x86.any/genincstats.rb
  10. 48
    48
      data/john/run.linux.x86.mmx/genincstats.rb
  11. 48
    48
      data/john/run.linux.x86.sse2/genincstats.rb
  12. 48
    48
      data/john/run.win32.any/genincstats.rb
  13. 48
    48
      data/john/run.win32.mmx/genincstats.rb
  14. 48
    48
      data/john/run.win32.sse2/genincstats.rb
  15. 18
    18
      data/msfcrawler/basic.rb
  16. 38
    38
      data/msfcrawler/forms.rb
  17. 17
    17
      data/msfcrawler/frames.rb
  18. 18
    18
      data/msfcrawler/image.rb
  19. 18
    18
      data/msfcrawler/link.rb
  20. 18
    18
      data/msfcrawler/objects.rb
  21. 18
    18
      data/msfcrawler/scripts.rb
  22. 2
    2
      data/sounds/aiff2wav.rb
  23. 23
    23
      data/sounds/gensounds_mac.rb
  24. 11
    11
      documentation/samples/framework/dump_module_info.rb
  25. 7
    7
      documentation/samples/framework/encode_file.rb
  26. 1
    1
      documentation/samples/framework/enumerate_modules.rb
  27. 20
    20
      documentation/samples/framework/run_exploit_using_base.rb
  28. 30
    30
      documentation/samples/framework/run_exploit_using_core.rb
  29. 26
    26
      documentation/samples/modules/auxiliary/sample.rb
  30. 17
    17
      documentation/samples/modules/encoders/sample.rb
  31. 129
    129
      documentation/samples/modules/exploits/ie_browser.rb
  32. 58
    58
      documentation/samples/modules/exploits/sample.rb
  33. 14
    14
      documentation/samples/modules/nops/sample.rb
  34. 15
    15
      documentation/samples/modules/payloads/singles/sample.rb
  35. 19
    19
      documentation/samples/modules/post/sample.rb
  36. 75
    75
      documentation/samples/pro/msfrpc_pro_discover.rb
  37. 76
    76
      documentation/samples/pro/msfrpc_pro_exploit.rb
  38. 40
    40
      documentation/samples/pro/msfrpc_pro_import.rb
  39. 55
    55
      documentation/samples/pro/msfrpc_pro_nexpose.rb
  40. 70
    70
      documentation/samples/pro/msfrpc_pro_report.rb
  41. 14
    14
      documentation/samples/scripts/meterpreter_script_template.rb
  42. 69
    69
      documentation/samples/scripts/resource_script.rb
  43. 1
    1
      modules/exploits/unix/webapp/arkeia_upload_exec.rb
  44. 194
    194
      msfbinscan
  45. 536
    536
      msfcli
  46. 115
    115
      msfconsole
  47. 45
    45
      msfd
  48. 55
    55
      msfelfscan
  49. 205
    205
      msfencode
  50. 45
    45
      msfmachscan
  51. 153
    153
      msfpayload
  52. 81
    81
      msfpescan
  53. 88
    88
      msfrop
  54. 35
    35
      msfrpc
  55. 47
    47
      msfrpcd
  56. 164
    164
      msfupdate
  57. 1
    1
      msfvenom
  58. 333
    333
      plugins/alias.rb
  59. 27
    27
      plugins/auto_add_route.rb
  60. 103
    103
      plugins/db_credcollect.rb
  61. 56
    56
      plugins/db_tracker.rb
  62. 68
    68
      plugins/editor.rb
  63. 26
    26
      plugins/event_tester.rb
  64. 88
    88
      plugins/ffautoregen.rb
  65. 89
    89
      plugins/ips_filter.rb
  66. 562
    562
      plugins/lab.rb
  67. 135
    135
      plugins/msfd.rb
  68. 97
    97
      plugins/msgrpc.rb
  69. 1675
    1675
      plugins/nessus.rb
  70. 654
    654
      plugins/nexpose.rb
  71. 545
    545
      plugins/openvas.rb
  72. 182
    182
      plugins/pcap_log.rb
  73. 66
    66
      plugins/sample.rb
  74. 28
    28
      plugins/session_tagger.rb
  75. 84
    84
      plugins/socket_logger.rb
  76. 82
    82
      plugins/sounds.rb
  77. 115
    115
      plugins/thread.rb
  78. 98
    98
      plugins/token_adduser.rb
  79. 141
    141
      plugins/token_hunter.rb
  80. 2271
    2271
      plugins/wmap.rb
  81. 84
    84
      scripts/meterpreter/arp_scanner.rb
  82. 133
    133
      scripts/meterpreter/autoroute.rb
  83. 314
    314
      scripts/meterpreter/checkvm.rb
  84. 56
    56
      scripts/meterpreter/credcollect.rb
  85. 35
    35
      scripts/meterpreter/domain_list_gen.rb
  86. 294
    294
      scripts/meterpreter/dumplinks.rb
  87. 92
    92
      scripts/meterpreter/duplicate.rb
  88. 165
    165
      scripts/meterpreter/enum_chrome.rb
  89. 227
    227
      scripts/meterpreter/enum_firefox.rb
  90. 74
    74
      scripts/meterpreter/enum_logged_on_users.rb
  91. 98
    98
      scripts/meterpreter/enum_powershell_env.rb
  92. 71
    71
      scripts/meterpreter/enum_putty.rb
  93. 90
    90
      scripts/meterpreter/enum_shares.rb
  94. 273
    273
      scripts/meterpreter/enum_vmware.rb
  95. 150
    150
      scripts/meterpreter/event_manager.rb
  96. 61
    61
      scripts/meterpreter/file_collector.rb
  97. 45
    45
      scripts/meterpreter/get_application_list.rb
  98. 23
    23
      scripts/meterpreter/get_env.rb
  99. 115
    115
      scripts/meterpreter/get_filezilla_creds.rb
  100. 0
    0
      scripts/meterpreter/get_local_subnets.rb

+ 23
- 23
data/exploits/capture/http/forms/extractforms.rb View File

@@ -15,8 +15,8 @@ require 'open-uri'
15 15
 require 'timeout'
16 16
 
17 17
 def usage
18
-	$stderr.puts "#{$0} [site list] [output-dir]"
19
-	exit(0)
18
+  $stderr.puts "#{$0} [site list] [output-dir]"
19
+  exit(0)
20 20
 end
21 21
 
22 22
 input = ARGV.shift() || usage()
@@ -25,32 +25,32 @@ res = ""
25 25
 doc = Hpricot(File.open(input))
26 26
 doc.search("//form").each do |form|
27 27
 
28
-	# Extract the form
29
-	res = "<form"
30
-	form.attributes.each do |attr|
31
-		res << " #{attr[0]}='#{attr[1].gsub("'", "")}'"
32
-	end
33
-	res << "> "
28
+  # Extract the form
29
+  res = "<form"
30
+  form.attributes.each do |attr|
31
+    res << " #{attr[0]}='#{attr[1].gsub("'", "")}'"
32
+  end
33
+  res << "> "
34 34
 
35
-	# Strip out the value
36
-	form.search("//input") do |inp|
35
+  # Strip out the value
36
+  form.search("//input") do |inp|
37 37
 
38
-		inp.attributes.keys.each do |ikey|
39
-			if (ikey.downcase == "value")
40
-				inp[ikey] = ""
41
-				next
42
-			end
38
+    inp.attributes.keys.each do |ikey|
39
+      if (ikey.downcase == "value")
40
+        inp[ikey] = ""
41
+        next
42
+      end
43 43
 
44
-			if(inp.attributes[ikey] =~ /^http/i)
45
-				inp[ikey] = ""
46
-				next
47
-			end
44
+      if(inp.attributes[ikey] =~ /^http/i)
45
+        inp[ikey] = ""
46
+        next
47
+      end
48 48
 
49
-		end
49
+    end
50 50
 
51
-		res << inp.to_html
52
-	end
53
-	res << "</form>"
51
+    res << inp.to_html
52
+  end
53
+  res << "</form>"
54 54
 end
55 55
 
56 56
 $stdout.puts res

+ 53
- 53
data/exploits/capture/http/forms/grabforms.rb View File

@@ -15,72 +15,72 @@ require 'open-uri'
15 15
 require 'timeout'
16 16
 
17 17
 def usage
18
-	$stderr.puts "#{$0} [site list] [output-dir]"
19
-	exit(0)
18
+  $stderr.puts "#{$0} [site list] [output-dir]"
19
+  exit(0)
20 20
 end
21 21
 
22 22
 sitelist = ARGV.shift() || usage()
23 23
 output   = ARGV.shift() || usage()
24 24
 
25 25
 File.readlines(sitelist).each do |site|
26
-	site.strip!
27
-	next if site.length == 0
28
-	next if site =~ /^#/
29
-	
30
-	out = File.join(output, site + ".txt")
31
-	File.unlink(out) if File.exists?(out)
32
-	
33
-	fd  = File.open(out, "a")
34
-	
26
+  site.strip!
27
+  next if site.length == 0
28
+  next if site =~ /^#/
29
+  
30
+  out = File.join(output, site + ".txt")
31
+  File.unlink(out) if File.exists?(out)
32
+  
33
+  fd  = File.open(out, "a")
34
+  
35 35
 
36
-	["", "www."].each do |prefix|
37
-		begin
38
-			Timeout.timeout(10) do 
39
-				doc = Hpricot(open("http://#{prefix}#{site}/"))
40
-				doc.search("//form").each do |form|
36
+  ["", "www."].each do |prefix|
37
+    begin
38
+      Timeout.timeout(10) do 
39
+        doc = Hpricot(open("http://#{prefix}#{site}/"))
40
+        doc.search("//form").each do |form|
41 41
 
42
-					# Extract the form
43
-					res = "<form"
44
-					form.attributes.each do |attr|
45
-						res << " #{attr[0]}='#{attr[1].gsub("'", "")}'"
46
-					end
47
-					res << "> "
42
+          # Extract the form
43
+          res = "<form"
44
+          form.attributes.each do |attr|
45
+            res << " #{attr[0]}='#{attr[1].gsub("'", "")}'"
46
+          end
47
+          res << "> "
48 48
 
49
-					# Strip out the value
50
-					form.search("//input") do |inp|
49
+          # Strip out the value
50
+          form.search("//input") do |inp|
51 51
 
52
-						inp.attributes.keys.each do |ikey|
53
-							if (ikey.downcase == "value")
54
-								inp[ikey] = ""
55
-								next
56
-							end
52
+            inp.attributes.keys.each do |ikey|
53
+              if (ikey.downcase == "value")
54
+                inp[ikey] = ""
55
+                next
56
+              end
57 57
 
58
-							if(inp.attributes[ikey] =~ /^http/i)
59
-								inp[ikey] = ""
60
-								next
61
-							end
58
+              if(inp.attributes[ikey] =~ /^http/i)
59
+                inp[ikey] = ""
60
+                next
61
+              end
62 62
 
63
-						end
63
+            end
64 64
 
65
-						res << inp.to_html
66
-					end
67
-					res << "</form>"
65
+            res << inp.to_html
66
+          end
67
+          res << "</form>"
68 68
 
69
-					fd.write(res)
70
-				end
71
-			end
72
-			break
73
-		rescue ::Timeout::Error
74
-			$stderr.puts "#{prefix}#{site} timed out"
75
-		rescue ::Interrupt
76
-			raise $!
77
-		rescue ::Exception => e
78
-			$stderr.puts "#{prefix}#{site} #{e.class} #{e}"
79
-		end
80
-	end
81
-	
82
-	fd.close
83
-	
84
-	File.unlink(out) if (File.size(out) == 0)
69
+          fd.write(res)
70
+        end
71
+      end
72
+      break
73
+    rescue ::Timeout::Error
74
+      $stderr.puts "#{prefix}#{site} timed out"
75
+    rescue ::Interrupt
76
+      raise $!
77
+    rescue ::Exception => e
78
+      $stderr.puts "#{prefix}#{site} #{e.class} #{e}"
79
+    end
80
+  end
81
+  
82
+  fd.close
83
+  
84
+  File.unlink(out) if (File.size(out) == 0)
85 85
 
86 86
 end

+ 55
- 55
data/exploits/psnuffle/ftp.rb View File

@@ -8,71 +8,71 @@
8 8
 
9 9
 class SnifferFTP < BaseProtocolParser
10 10
 
11
-	def register_sigs
12
-		self.sigs = {
13
-			:banner		=> /^(220\s*[^\r\n]+)/i,
14
-			:user		=> /^USER\s+([^\s]+)/i,
15
-			:pass		=> /^PASS\s+([^\s]+)/i,
16
-			:login_pass => /^(230\s*[^\n]+)/i,
17
-			:login_fail => /^(5\d\d\s*[^\n]+)/i,
18
-			:bye      => /^221/
19
-		}
20
-	end
11
+  def register_sigs
12
+    self.sigs = {
13
+      :banner		=> /^(220\s*[^\r\n]+)/i,
14
+      :user		=> /^USER\s+([^\s]+)/i,
15
+      :pass		=> /^PASS\s+([^\s]+)/i,
16
+      :login_pass => /^(230\s*[^\n]+)/i,
17
+      :login_fail => /^(5\d\d\s*[^\n]+)/i,
18
+      :bye      => /^221/
19
+    }
20
+  end
21 21
 
22
-	def parse(pkt)
23
-		# We want to return immediatly if we do not have a packet which is handled by us
24
-		return unless pkt.is_tcp?
25
-		return if (pkt.tcp_sport != 21 and pkt.tcp_dport != 21)
26
-		s = find_session((pkt.tcp_sport == 21) ? get_session_src(pkt) : get_session_dst(pkt))
27
-		s[:sname] ||= "ftp"
22
+  def parse(pkt)
23
+    # We want to return immediatly if we do not have a packet which is handled by us
24
+    return unless pkt.is_tcp?
25
+    return if (pkt.tcp_sport != 21 and pkt.tcp_dport != 21)
26
+    s = find_session((pkt.tcp_sport == 21) ? get_session_src(pkt) : get_session_dst(pkt))
27
+    s[:sname] ||= "ftp"
28 28
 
29
-		self.sigs.each_key do |k|
30
-			# There is only one pattern per run to test
31
-			matched = nil
32
-			matches = nil
29
+    self.sigs.each_key do |k|
30
+      # There is only one pattern per run to test
31
+      matched = nil
32
+      matches = nil
33 33
 
34
-			if(pkt.payload =~ self.sigs[k])
35
-				matched = k
36
-				matches = $1
37
-			end
34
+      if(pkt.payload =~ self.sigs[k])
35
+        matched = k
36
+        matches = $1
37
+      end
38 38
 
39
-			case matched
39
+      case matched
40 40
 
41
-			when :login_fail
42
-				if(s[:user] and s[:pass])
43
-					report_auth_info(s.merge({:active => false}))
44
-					print_status("Failed FTP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]}")
41
+      when :login_fail
42
+        if(s[:user] and s[:pass])
43
+          report_auth_info(s.merge({:active => false}))
44
+          print_status("Failed FTP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]}")
45 45
 
46
-					s[:pass] = ""
47
-					return
48
-				end
46
+          s[:pass] = ""
47
+          return
48
+        end
49 49
 
50
-			when :login_pass
51
-				if(s[:user] and s[:pass])
52
-					report_auth_info(s)
53
-					print_status("Successful FTP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]}")
54
-					# Remove it form the session objects so freeup memory
55
-					sessions.delete(s[:session])
56
-					return
57
-				end
50
+      when :login_pass
51
+        if(s[:user] and s[:pass])
52
+          report_auth_info(s)
53
+          print_status("Successful FTP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]}")
54
+          # Remove it form the session objects so freeup memory
55
+          sessions.delete(s[:session])
56
+          return
57
+        end
58 58
 
59
-			when :banner
60
-				# Because some ftp server send multiple banner we take only the first one and ignore the rest
61
-				if not (s[:info])
62
-					s[:info] = matches
63
-					report_service(s)
64
-				end
59
+      when :banner
60
+        # Because some ftp server send multiple banner we take only the first one and ignore the rest
61
+        if not (s[:info])
62
+          s[:info] = matches
63
+          report_service(s)
64
+        end
65 65
 
66
-			when :bye
67
-				sessions.delete(s[:session])
66
+      when :bye
67
+        sessions.delete(s[:session])
68 68
 
69
-			when nil
70
-				# No matches, no saved state
71
-			else
72
-				sessions[s[:session]].merge!({k => matches})
73
-			end # end case matched
69
+      when nil
70
+        # No matches, no saved state
71
+      else
72
+        sessions[s[:session]].merge!({k => matches})
73
+      end # end case matched
74 74
 
75
-		end # end of each_key
76
-	end # end of parse
75
+    end # end of each_key
76
+  end # end of parse
77 77
 end
78 78
 

+ 67
- 67
data/exploits/psnuffle/imap.rb View File

@@ -9,72 +9,72 @@
9 9
 
10 10
 class SnifferIMAP < BaseProtocolParser
11 11
 
12
-	def register_sigs
13
-		self.sigs = {
14
-			:banner		=> /^(\*\s+OK[^\n\r]*)/i,
15
-			:login		=> /^CAPABILITY\s+LOGIN\s+([^\s]+)\s+([^\n\r]+)/i,
16
-			:login_pass => /^CAPABILITY\s+OK\s+(Login[^\n\r]*)/i,
17
-			:login_bad	=> /^CAPABILITY\s+BAD\s+(Login[^\n\r]*)/i,
18
-			:login_fail => /^CAPABILITY\s+NO\s+(Login[^\n\r]*)/i
19
-		}
20
-	end
21
-
22
-	def parse(pkt)
23
-
24
-		# We want to return immediatly if we do not have a packet which is handled by us
25
-		return unless pkt.is_tcp?
26
-		return if (pkt.tcp_sport != 143 and pkt.tcp_dport != 143)
27
-		s = find_session((pkt.tcp_sport == 143) ? get_session_src(pkt) : get_session_dst(pkt))
28
-		s[:sname] ||= "imap4"
29
-
30
-		self.sigs.each_key do |k|
31
-			# There is only one pattern per run to test
32
-			matched = nil
33
-			matches = nil
34
-
35
-			if (pkt.payload =~ self.sigs[k])
36
-				matched = k
37
-				matches = [$1,$2]
38
-			end
39
-
40
-			case matched
41
-			when :banner
42
-				s[:info] = matches
43
-				report_service(s)
44
-
45
-			when :login_pass
46
-
47
-				report_auth_info(s)
48
-				print_status("Successful IMAP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
49
-
50
-				# Remove it form the session objects so freeup
51
-				sessions.delete(s[:session])
52
-
53
-			when :login_fail
54
-
55
-				report_auth_info(s.merge({:active => false}))
56
-				print_status("Failed IMAP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
57
-
58
-				# Remove it form the session objects so freeup
59
-				sessions.delete(s[:session])
60
-
61
-			when :login_bad
62
-				report_auth_info(s.merge({:active => false}))
63
-				print_status("Bad IMAP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
64
-
65
-				# Remove it form the session objects so freeup
66
-				sessions.delete(s[:session])
67
-
68
-			when :login
69
-				s[:user]=$1
70
-				s[:pass]=$2
71
-
72
-			when nil
73
-				# No matches, no saved state
74
-			else
75
-				sessions[s[:session]].merge!({k => matches})
76
-			end # end case matched
77
-		end # end of each_key
78
-	end # end of parse
12
+  def register_sigs
13
+    self.sigs = {
14
+      :banner		=> /^(\*\s+OK[^\n\r]*)/i,
15
+      :login		=> /^CAPABILITY\s+LOGIN\s+([^\s]+)\s+([^\n\r]+)/i,
16
+      :login_pass => /^CAPABILITY\s+OK\s+(Login[^\n\r]*)/i,
17
+      :login_bad	=> /^CAPABILITY\s+BAD\s+(Login[^\n\r]*)/i,
18
+      :login_fail => /^CAPABILITY\s+NO\s+(Login[^\n\r]*)/i
19
+    }
20
+  end
21
+
22
+  def parse(pkt)
23
+
24
+    # We want to return immediatly if we do not have a packet which is handled by us
25
+    return unless pkt.is_tcp?
26
+    return if (pkt.tcp_sport != 143 and pkt.tcp_dport != 143)
27
+    s = find_session((pkt.tcp_sport == 143) ? get_session_src(pkt) : get_session_dst(pkt))
28
+    s[:sname] ||= "imap4"
29
+
30
+    self.sigs.each_key do |k|
31
+      # There is only one pattern per run to test
32
+      matched = nil
33
+      matches = nil
34
+
35
+      if (pkt.payload =~ self.sigs[k])
36
+        matched = k
37
+        matches = [$1,$2]
38
+      end
39
+
40
+      case matched
41
+      when :banner
42
+        s[:info] = matches
43
+        report_service(s)
44
+
45
+      when :login_pass
46
+
47
+        report_auth_info(s)
48
+        print_status("Successful IMAP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
49
+
50
+        # Remove it form the session objects so freeup
51
+        sessions.delete(s[:session])
52
+
53
+      when :login_fail
54
+
55
+        report_auth_info(s.merge({:active => false}))
56
+        print_status("Failed IMAP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
57
+
58
+        # Remove it form the session objects so freeup
59
+        sessions.delete(s[:session])
60
+
61
+      when :login_bad
62
+        report_auth_info(s.merge({:active => false}))
63
+        print_status("Bad IMAP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
64
+
65
+        # Remove it form the session objects so freeup
66
+        sessions.delete(s[:session])
67
+
68
+      when :login
69
+        s[:user]=$1
70
+        s[:pass]=$2
71
+
72
+      when nil
73
+        # No matches, no saved state
74
+      else
75
+        sessions[s[:session]].merge!({k => matches})
76
+      end # end case matched
77
+    end # end of each_key
78
+  end # end of parse
79 79
 end
80 80
 

+ 68
- 68
data/exploits/psnuffle/pop3.rb View File

@@ -6,83 +6,83 @@
6 6
 # as unsuccessful logins... (Typos are common :-) )
7 7
 #
8 8
 class SnifferPOP3 < BaseProtocolParser
9
-	def register_sigs
10
-		self.sigs = {
11
-			:ok				=> /^(\+OK[^\n]*)\n/i,
12
-			:err			=> /^(\-ERR[^\n]*)\n/i,
13
-			:user			=> /^USER\s+([^\n]+)\n/i,
14
-			:pass			=> /^PASS\s+([^\n]+)\n/i,
15
-			:quit			=> /^(QUIT\s*[^\n]*)\n/i
16
-		}
17
-	end
9
+  def register_sigs
10
+    self.sigs = {
11
+      :ok				=> /^(\+OK[^\n]*)\n/i,
12
+      :err			=> /^(\-ERR[^\n]*)\n/i,
13
+      :user			=> /^USER\s+([^\n]+)\n/i,
14
+      :pass			=> /^PASS\s+([^\n]+)\n/i,
15
+      :quit			=> /^(QUIT\s*[^\n]*)\n/i
16
+    }
17
+  end
18 18
 
19
-	def parse(pkt)
20
-		# We want to return immediatly if we do not have a packet which is handled by us
21
-		return unless pkt.is_tcp?
22
-		return if (pkt.tcp_sport != 110 and pkt.tcp_dport != 110)
23
-		s = find_session((pkt.tcp_sport == 110) ? get_session_src(pkt) : get_session_dst(pkt))
19
+  def parse(pkt)
20
+    # We want to return immediatly if we do not have a packet which is handled by us
21
+    return unless pkt.is_tcp?
22
+    return if (pkt.tcp_sport != 110 and pkt.tcp_dport != 110)
23
+    s = find_session((pkt.tcp_sport == 110) ? get_session_src(pkt) : get_session_dst(pkt))
24 24
 
25
-		self.sigs.each_key do |k|
26
-			# There is only one pattern per run to test
27
-			matched = nil
28
-			matches = nil
25
+    self.sigs.each_key do |k|
26
+      # There is only one pattern per run to test
27
+      matched = nil
28
+      matches = nil
29 29
 
30
-			if(pkt.payload =~ self.sigs[k])
31
-				matched = k
32
-				matches = $1
33
-			end
30
+      if(pkt.payload =~ self.sigs[k])
31
+        matched = k
32
+        matches = $1
33
+      end
34 34
 
35
-			case matched
36
-				when :ok
37
-					# Last command was successful, in addition most servers transmit a banner with the first +OK
38
-					case s[:last]
39
-						when nil
40
-							# Its the first +OK must include the banner, worst case its just +OK
41
-							s[:info]  = matches
42
-							s[:proto] = "tcp"
43
-							s[:name]  = "pop3"
44
-							report_service(s)
35
+      case matched
36
+        when :ok
37
+          # Last command was successful, in addition most servers transmit a banner with the first +OK
38
+          case s[:last]
39
+            when nil
40
+              # Its the first +OK must include the banner, worst case its just +OK
41
+              s[:info]  = matches
42
+              s[:proto] = "tcp"
43
+              s[:name]  = "pop3"
44
+              report_service(s)
45 45
 
46
-						when :user
47
-							# When the last command was a username login
48
-							# We might keep track on this one in future
49
-						when :pass
50
-							# Perfect we get an +OK after a PASS command this means right password given :-)
46
+            when :user
47
+              # When the last command was a username login
48
+              # We might keep track on this one in future
49
+            when :pass
50
+              # Perfect we get an +OK after a PASS command this means right password given :-)
51 51
 
52
-							s[:proto] = "tcp"
53
-							s[:name]  = "pop3"
54
-							s[:extra] = "Successful Login. Banner: #{s[:banner]}"
55
-							report_auth_info(s)
56
-							print_status("Successful POP3 Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
52
+              s[:proto] = "tcp"
53
+              s[:name]  = "pop3"
54
+              s[:extra] = "Successful Login. Banner: #{s[:banner]}"
55
+              report_auth_info(s)
56
+              print_status("Successful POP3 Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
57 57
 
58
-							# Remove it form the session objects so freeup
59
-							sessions.delete(s[:session])
58
+              # Remove it form the session objects so freeup
59
+              sessions.delete(s[:session])
60 60
 
61
-						when :quit
62
-							# The session is terminated by the user just delete is as well
63
-							sessions.delete(s[:session])
64
-					end
65
-					s[:last]=:ok
61
+            when :quit
62
+              # The session is terminated by the user just delete is as well
63
+              sessions.delete(s[:session])
64
+          end
65
+          s[:last]=:ok
66 66
 
67
-				when :err
68
-					case s[:last]
69
-						when :pass
70
-							# Oops got a -ERR after a pass so its crap ignore the pass
71
-							# But report it, might be helpfull for guessing :-)
67
+        when :err
68
+          case s[:last]
69
+            when :pass
70
+              # Oops got a -ERR after a pass so its crap ignore the pass
71
+              # But report it, might be helpfull for guessing :-)
72 72
 
73
-							s[:proto]="pop3"
74
-							s[:extra]="Failed Login. Banner: #{s[:banner]}"
75
-							report_auth_info(s)
76
-							print_status("Invalid POP3 Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
77
-							s[:pass]=""
78
-					end
79
-				when nil
80
-					# No matches, no saved state
81
-				else
82
-					s[:last]=matched
83
-					sessions[s[:session]].merge!({k => matches})
84
-			end # end case matched
85
-		end # end of each_key
86
-	end # end of parse
73
+              s[:proto]="pop3"
74
+              s[:extra]="Failed Login. Banner: #{s[:banner]}"
75
+              report_auth_info(s)
76
+              print_status("Invalid POP3 Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
77
+              s[:pass]=""
78
+          end
79
+        when nil
80
+          # No matches, no saved state
81
+        else
82
+          s[:last]=matched
83
+          sessions[s[:session]].merge!({k => matches})
84
+      end # end case matched
85
+    end # end of each_key
86
+  end # end of parse
87 87
 end
88 88
 

+ 198
- 198
data/exploits/psnuffle/smb.rb View File

@@ -6,206 +6,206 @@
6 6
 
7 7
 #Memo : 
8 8
 #FOR SMBV1
9
-	# Authentification without extended security set
10
-		#1) client -> server : smb_negotiate (0x72) : smb.flags2.extended_sec  =  0
11
-		#2) server -> client : smb_negotiate (0x72) : smb.flags2.extended_sec  =  0 and contains server challenge (aka encryption key) and wordcount = 17
12
-		#3) client -> server : smb_setup_andx (0x73) : contains lm/ntlm hashes and wordcount = 13 (not 0)
13
-		#4) server -> client : smb_setup_andx (0x73) : if status = success then authentification ok
14
-
15
-	# Authentification with extended security set
16
-		#1) client -> server : smb_negotiate (0x72) : smb.flags2.extended_sec  =  1
17
-		#2) server -> client : smb_negotiate (0x72) : smb.flags2.extended_sec  =  1
18
-		#3) client -> server : smb_setup_andx (0x73) : contains an ntlm_type1 message
19
-		#4) server -> client : smb_setup_andx (0x73) : contains an ntlm_type2 message with the server challenge
20
-		#5) client -> server : smb_setup_andx (0x73) : contains an ntlm_type3 message with the lm/ntlm hashes
21
-		#6) server -> client : smb_setup_andx (0x73) : if status = success then authentification = ok
9
+  # Authentification without extended security set
10
+    #1) client -> server : smb_negotiate (0x72) : smb.flags2.extended_sec  =  0
11
+    #2) server -> client : smb_negotiate (0x72) : smb.flags2.extended_sec  =  0 and contains server challenge (aka encryption key) and wordcount = 17
12
+    #3) client -> server : smb_setup_andx (0x73) : contains lm/ntlm hashes and wordcount = 13 (not 0)
13
+    #4) server -> client : smb_setup_andx (0x73) : if status = success then authentification ok
14
+
15
+  # Authentification with extended security set
16
+    #1) client -> server : smb_negotiate (0x72) : smb.flags2.extended_sec  =  1
17
+    #2) server -> client : smb_negotiate (0x72) : smb.flags2.extended_sec  =  1
18
+    #3) client -> server : smb_setup_andx (0x73) : contains an ntlm_type1 message
19
+    #4) server -> client : smb_setup_andx (0x73) : contains an ntlm_type2 message with the server challenge
20
+    #5) client -> server : smb_setup_andx (0x73) : contains an ntlm_type3 message with the lm/ntlm hashes
21
+    #6) server -> client : smb_setup_andx (0x73) : if status = success then authentification = ok
22 22
 #FOR SMBV2
23
-	#SMBv2 is pretty similar. However, extended security is always set and it is using a newer set of smb negociate and session_setup command for requets/response 
23
+  #SMBv2 is pretty similar. However, extended security is always set and it is using a newer set of smb negociate and session_setup command for requets/response 
24 24
 
25 25
 class SnifferSMB < BaseProtocolParser
26 26
 
27
-	def register_sigs
28
-		self.sigs = {
29
-			:smb1_negotiate		=> /\xffSMB\x72/n,
30
-			:smb1_setupandx		=> /\xffSMB\x73/n,
31
-			#:smb2_negotiate	=> /\xFESMB\x40\x00(.){6}\x00\x00/n,
32
-			:smb2_setupandx		=> /\xFESMB\x40\x00(.){6}\x01\x00/n
33
-		}
34
-	end
35
-
36
-	def parse(pkt)
37
-		# We want to return immediatly if we do not have a packet which is handled by us
38
-		return unless pkt.is_tcp?
39
-		return if (pkt.tcp_sport != 445 and pkt.tcp_dport != 445)
40
-		s = find_session((pkt.tcp_sport == 445) ? get_session_src(pkt) : get_session_dst(pkt))
41
-
42
-		self.sigs.each_key do |k|
43
-			# There is only one pattern per run to test
44
-			matched = nil
45
-			matches = nil
46
-
47
-			if(pkt.payload =~ self.sigs[k])
48
-				matched = k
49
-				matches = $1
50
-			end
51
-
52
-			case matched
53
-			when :smb1_negotiate
54
-				payload = pkt.payload.dup
55
-				wordcount = payload[36,1].unpack("C")[0]
56
-				#negotiate response
57
-				if wordcount == 17
58
-					flags2 = payload[14,2].unpack("v")[0]
59
-					#the server challenge is here
60
-					if flags2 & 0x800 == 0
61
-						s[:challenge] = payload[73,8].unpack("H*")[0]
62
-						s[:last]  = :smb1_negotiate
63
-					end
64
-				end
65
-
66
-			when :smb1_setupandx
67
-				s[:smb_version]  = "SMBv1"
68
-				parse_sessionsetup(pkt, s)
69
-			when :smb2_setupandx
70
-				s[:smb_version]  = "SMBv2"
71
-				parse_sessionsetup(pkt, s)
72
-			when nil
73
-				# No matches, no saved state
74
-			else
75
-				sessions[s[:session]].merge!({k => matches})
76
-			end # end case matched
77
-
78
-		end # end of each_key
79
-	end # end of parse
80
-
81
-	#ntlmv1, ntlmv2 or ntlm2_session
82
-	def detect_ntlm_ver(lmhash, ntlmhash)
83
-		return "NTLMv2" if ntlmhash.length > 48
84
-		if lmhash.length == 48 and ntlmhash.length == 48
85
-			if lmhash != "00" * 24 and lmhash[16,32] == "00" * 16
86
-				return "NTLM2_SESSION"
87
-			else
88
-				return "NTLMv1"
89
-			end
90
-		else
91
-			raise RuntimeError, "Unknow hash type"
92
-		end
93
-	end
94
-
95
-	def parse_sessionsetup(pkt, s)
96
-		payload = pkt.payload.dup
97
-		ntlmpayload = payload[/NTLMSSP\x00.*/m]
98
-		if ntlmpayload
99
-			ntlmmessagetype = ntlmpayload[8,4].unpack("V")[0]
100
-			case ntlmmessagetype
101
-			when 2 # challenge
102
-				s[:challenge] = ntlmpayload[24,8].unpack("H*")[0]
103
-				s[:last] = :ntlm_type2
104
-			when 3 # auth
105
-				if s[:last] == :ntlm_type2
106
-					lmlength = 	ntlmpayload[12, 2].unpack("v")[0]
107
-					lmoffset = 	ntlmpayload[16, 2].unpack("v")[0]
108
-					ntlmlength = 	ntlmpayload[20, 2].unpack("v")[0]
109
-					ntlmoffset = 	ntlmpayload[24, 2].unpack("v")[0]
110
-					domainlength = 	ntlmpayload[28, 2].unpack("v")[0]
111
-					domainoffset = 	ntlmpayload[32, 2].unpack("v")[0]
112
-					usrlength = 	ntlmpayload[36, 2].unpack("v")[0]
113
-					usroffset = 	ntlmpayload[40, 2].unpack("v")[0]
114
-
115
-					s[:lmhash] = 	ntlmpayload[lmoffset, lmlength].unpack("H*")[0] || ''
116
-					s[:ntlmhash] =      ntlmpayload[ntlmoffset, ntlmlength].unpack("H*")[0] || ''
117
-					s[:domain] =	ntlmpayload[domainoffset, domainlength].gsub("\x00","") || ''
118
-					s[:user] =		ntlmpayload[usroffset, usrlength].gsub("\x00","") || ''
119
-
120
-					secbloblength = payload[51,2].unpack("v")[0]
121
-					names = (payload[63..-1][secbloblength..-1] || '').split("\x00\x00").map { |x| x.gsub(/\x00/, '') }
122
-					s[:peer_os]   = names[0] || ''
123
-					s[:peer_lm]   = names[1] || ''
124
-					s[:last] = :ntlm_type3
125
-				end
126
-			end
127
-		else
128
-			wordcount = payload[36,1].unpack("C")[0]
129
-			#authentification without smb extended security (smbmount, msf server capture)
130
-			if wordcount == 13 and s[:last]  == :smb1_negotiate and s[:smb_version]  == "SMBv1"
131
-				lmlength = 	payload[51,2].unpack("v")[0]
132
-				ntlmlength = 	payload[53,2].unpack("v")[0]
133
-				s[:lmhash] = 	payload[65,lmlength].unpack("H*")[0]
134
-				s[:ntlmhash] =  payload[65 + lmlength, ntlmlength].unpack("H*")[0]
135
-			
136
-				names = payload[Range.new(65 + lmlength + ntlmlength,-1)].split("\x00\x00").map { |x| x.gsub(/\x00/, '') }
137
-
138
-				s[:user] = names[0]
139
-				s[:domain]   = names[1]
140
-				s[:peer_os]   = names[2]
141
-				s[:peer_lm]   = names[3]
142
-				s[:last] = :smb_no_ntlm
143
-			else
144
-				#answer from server
145
-				if s[:last] == :ntlm_type3 or s[:last] == :smb_no_ntlm
146
-					#do not output anonymous/guest logging
147
-					unless s[:user] == '' or s[:ntlmhash] == '' or s[:ntlmhash] =~ /^(00)*$/m
148
-						#set lmhash to a default value if not provided						   	
149
-						s[:lmhash] = "00" * 24 if s[:lmhash] == '' or s[:lmhash] =~ /^(00)*$/m 
150
-						s[:lmhash] = "00" * 24 if s[:lmhash] == s[:ntlmhash]
151
-
152
-						smb_status = payload[9,4].unpack("V")[0]
153
-						if smb_status == 0 # success
154
-
155
-							ntlm_ver = detect_ntlm_ver(s[:lmhash],s[:ntlmhash])
156
-
157
-							logmessage =
158
-								"#{ntlm_ver} Response Captured in #{s[:smb_version]} session : #{s[:session]} \n" +
159
-								"USER:#{s[:user]} DOMAIN:#{s[:domain]} OS:#{s[:peer_os]} LM:#{s[:peer_lm]}\n" +
160
-								"SERVER CHALLENGE:#{s[:challenge]} " + 
161
-								"\nLMHASH:#{s[:lmhash]} " + 
162
-								"\nNTHASH:#{s[:ntlmhash]}\n"
163
-							print_status(logmessage)
164
-
165
-							src_ip = s[:client_host]
166
-							dst_ip = s[:host]
167
-							# know this is ugly , last code added :-/
168
-							smb_db_type_hash = case ntlm_ver
169
-							       when "NTLMv1" 		then "smb_netv1_hash"
170
-							       when "NTLM2_SESSION" 	then "smb_netv1_hash"
171
-							       when "NTLMv2" 		then "smb_netv2_hash"
172
-							       end
173
-							# DB reporting
174
-							report_auth_info(
175
-								:host  => dst_ip,
176
-								:port => 445,
177
-								:sname => 'smb',
178
-								:user => s[:user],
179
-								:pass => s[:domain] + ":" + s[:lmhash] + ":" + s[:ntlmhash] + ":" + s[:challenge],
180
-								:type => smb_db_type_hash,
181
-								:proof => "DOMAIN=#{s[:domain]} OS=#{s[:peer_os]}",
182
-								:active => true
183
-							)
184
-
185
-							report_note(
186
-								:host  => src_ip,
187
-								:type  => "smb_peer_os",
188
-								:data  => s[:peer_os]
189
-							) if (s[:peer_os] and s[:peer_os].strip.length > 0)
190
-
191
-							report_note(
192
-								:host  => src_ip,
193
-								:type  => "smb_peer_lm",
194
-								:data  => s[:peer_lm]
195
-							) if (s[:peer_lm] and s[:peer_lm].strip.length > 0)
196
-
197
-							report_note(
198
-								:host  => src_ip,
199
-								:type  => "smb_domain",
200
-								:data  => s[:domain]
201
-							) if (s[:domain] and s[:domain].strip.length > 0)
202
-
203
-						end
204
-					end
205
-				end
206
-				s[:last] = nil
207
-				sessions.delete(s[:session])
208
-			end
209
-		end
210
-	end
27
+  def register_sigs
28
+    self.sigs = {
29
+      :smb1_negotiate		=> /\xffSMB\x72/n,
30
+      :smb1_setupandx		=> /\xffSMB\x73/n,
31
+      #:smb2_negotiate	=> /\xFESMB\x40\x00(.){6}\x00\x00/n,
32
+      :smb2_setupandx		=> /\xFESMB\x40\x00(.){6}\x01\x00/n
33
+    }
34
+  end
35
+
36
+  def parse(pkt)
37
+    # We want to return immediatly if we do not have a packet which is handled by us
38
+    return unless pkt.is_tcp?
39
+    return if (pkt.tcp_sport != 445 and pkt.tcp_dport != 445)
40
+    s = find_session((pkt.tcp_sport == 445) ? get_session_src(pkt) : get_session_dst(pkt))
41
+
42
+    self.sigs.each_key do |k|
43
+      # There is only one pattern per run to test
44
+      matched = nil
45
+      matches = nil
46
+
47
+      if(pkt.payload =~ self.sigs[k])
48
+        matched = k
49
+        matches = $1
50
+      end
51
+
52
+      case matched
53
+      when :smb1_negotiate
54
+        payload = pkt.payload.dup
55
+        wordcount = payload[36,1].unpack("C")[0]
56
+        #negotiate response
57
+        if wordcount == 17
58
+          flags2 = payload[14,2].unpack("v")[0]
59
+          #the server challenge is here
60
+          if flags2 & 0x800 == 0
61
+            s[:challenge] = payload[73,8].unpack("H*")[0]
62
+            s[:last]  = :smb1_negotiate
63
+          end
64
+        end
65
+
66
+      when :smb1_setupandx
67
+        s[:smb_version]  = "SMBv1"
68
+        parse_sessionsetup(pkt, s)
69
+      when :smb2_setupandx
70
+        s[:smb_version]  = "SMBv2"
71
+        parse_sessionsetup(pkt, s)
72
+      when nil
73
+        # No matches, no saved state
74
+      else
75
+        sessions[s[:session]].merge!({k => matches})
76
+      end # end case matched
77
+
78
+    end # end of each_key
79
+  end # end of parse
80
+
81
+  #ntlmv1, ntlmv2 or ntlm2_session
82
+  def detect_ntlm_ver(lmhash, ntlmhash)
83
+    return "NTLMv2" if ntlmhash.length > 48
84
+    if lmhash.length == 48 and ntlmhash.length == 48
85
+      if lmhash != "00" * 24 and lmhash[16,32] == "00" * 16
86
+        return "NTLM2_SESSION"
87
+      else
88
+        return "NTLMv1"
89
+      end
90
+    else
91
+      raise RuntimeError, "Unknow hash type"
92
+    end
93
+  end
94
+
95
+  def parse_sessionsetup(pkt, s)
96
+    payload = pkt.payload.dup
97
+    ntlmpayload = payload[/NTLMSSP\x00.*/m]
98
+    if ntlmpayload
99
+      ntlmmessagetype = ntlmpayload[8,4].unpack("V")[0]
100
+      case ntlmmessagetype
101
+      when 2 # challenge
102
+        s[:challenge] = ntlmpayload[24,8].unpack("H*")[0]
103
+        s[:last] = :ntlm_type2
104
+      when 3 # auth
105
+        if s[:last] == :ntlm_type2
106
+          lmlength = 	ntlmpayload[12, 2].unpack("v")[0]
107
+          lmoffset = 	ntlmpayload[16, 2].unpack("v")[0]
108
+          ntlmlength = 	ntlmpayload[20, 2].unpack("v")[0]
109
+          ntlmoffset = 	ntlmpayload[24, 2].unpack("v")[0]
110
+          domainlength = 	ntlmpayload[28, 2].unpack("v")[0]
111
+          domainoffset = 	ntlmpayload[32, 2].unpack("v")[0]
112
+          usrlength = 	ntlmpayload[36, 2].unpack("v")[0]
113
+          usroffset = 	ntlmpayload[40, 2].unpack("v")[0]
114
+
115
+          s[:lmhash] = 	ntlmpayload[lmoffset, lmlength].unpack("H*")[0] || ''
116
+          s[:ntlmhash] =      ntlmpayload[ntlmoffset, ntlmlength].unpack("H*")[0] || ''
117
+          s[:domain] =	ntlmpayload[domainoffset, domainlength].gsub("\x00","") || ''
118
+          s[:user] =		ntlmpayload[usroffset, usrlength].gsub("\x00","") || ''
119
+
120
+          secbloblength = payload[51,2].unpack("v")[0]
121
+          names = (payload[63..-1][secbloblength..-1] || '').split("\x00\x00").map { |x| x.gsub(/\x00/, '') }
122
+          s[:peer_os]   = names[0] || ''
123
+          s[:peer_lm]   = names[1] || ''
124
+          s[:last] = :ntlm_type3
125
+        end
126
+      end
127
+    else
128
+      wordcount = payload[36,1].unpack("C")[0]
129
+      #authentification without smb extended security (smbmount, msf server capture)
130
+      if wordcount == 13 and s[:last]  == :smb1_negotiate and s[:smb_version]  == "SMBv1"
131
+        lmlength = 	payload[51,2].unpack("v")[0]
132
+        ntlmlength = 	payload[53,2].unpack("v")[0]
133
+        s[:lmhash] = 	payload[65,lmlength].unpack("H*")[0]
134
+        s[:ntlmhash] =  payload[65 + lmlength, ntlmlength].unpack("H*")[0]
135
+      
136
+        names = payload[Range.new(65 + lmlength + ntlmlength,-1)].split("\x00\x00").map { |x| x.gsub(/\x00/, '') }
137
+
138
+        s[:user] = names[0]
139
+        s[:domain]   = names[1]
140
+        s[:peer_os]   = names[2]
141
+        s[:peer_lm]   = names[3]
142
+        s[:last] = :smb_no_ntlm
143
+      else
144
+        #answer from server
145
+        if s[:last] == :ntlm_type3 or s[:last] == :smb_no_ntlm
146
+          #do not output anonymous/guest logging
147
+          unless s[:user] == '' or s[:ntlmhash] == '' or s[:ntlmhash] =~ /^(00)*$/m
148
+            #set lmhash to a default value if not provided						   	
149
+            s[:lmhash] = "00" * 24 if s[:lmhash] == '' or s[:lmhash] =~ /^(00)*$/m 
150
+            s[:lmhash] = "00" * 24 if s[:lmhash] == s[:ntlmhash]
151
+
152
+            smb_status = payload[9,4].unpack("V")[0]
153
+            if smb_status == 0 # success
154
+
155
+              ntlm_ver = detect_ntlm_ver(s[:lmhash],s[:ntlmhash])
156
+
157
+              logmessage =
158
+                "#{ntlm_ver} Response Captured in #{s[:smb_version]} session : #{s[:session]} \n" +
159
+                "USER:#{s[:user]} DOMAIN:#{s[:domain]} OS:#{s[:peer_os]} LM:#{s[:peer_lm]}\n" +
160
+                "SERVER CHALLENGE:#{s[:challenge]} " + 
161
+                "\nLMHASH:#{s[:lmhash]} " + 
162
+                "\nNTHASH:#{s[:ntlmhash]}\n"
163
+              print_status(logmessage)
164
+
165
+              src_ip = s[:client_host]
166
+              dst_ip = s[:host]
167
+              # know this is ugly , last code added :-/
168
+              smb_db_type_hash = case ntlm_ver
169
+                     when "NTLMv1" 		then "smb_netv1_hash"
170
+                     when "NTLM2_SESSION" 	then "smb_netv1_hash"
171
+                     when "NTLMv2" 		then "smb_netv2_hash"
172
+                     end
173
+              # DB reporting
174
+              report_auth_info(
175
+                :host  => dst_ip,
176
+                :port => 445,
177
+                :sname => 'smb',
178
+                :user => s[:user],
179
+                :pass => s[:domain] + ":" + s[:lmhash] + ":" + s[:ntlmhash] + ":" + s[:challenge],
180
+                :type => smb_db_type_hash,
181
+                :proof => "DOMAIN=#{s[:domain]} OS=#{s[:peer_os]}",
182
+                :active => true
183
+              )
184
+
185
+              report_note(
186
+                :host  => src_ip,
187
+                :type  => "smb_peer_os",
188
+                :data  => s[:peer_os]
189
+              ) if (s[:peer_os] and s[:peer_os].strip.length > 0)
190
+
191
+              report_note(
192
+                :host  => src_ip,
193
+                :type  => "smb_peer_lm",
194
+                :data  => s[:peer_lm]
195
+              ) if (s[:peer_lm] and s[:peer_lm].strip.length > 0)
196
+
197
+              report_note(
198
+                :host  => src_ip,
199
+                :type  => "smb_domain",
200
+                :data  => s[:domain]
201
+              ) if (s[:domain] and s[:domain].strip.length > 0)
202
+
203
+            end
204
+          end
205
+        end
206
+        s[:last] = nil
207
+        sessions.delete(s[:session])
208
+      end
209
+    end
210
+  end
211 211
 end

+ 33
- 33
data/exploits/psnuffle/url.rb View File

@@ -6,43 +6,43 @@
6 6
 
7 7
 # Sniffer class for GET URL's
8 8
 class SnifferURL < BaseProtocolParser
9
-	def register_sigs
10
-		self.sigs = {
11
-			:get		=> /^GET\s+([^\n]+)\s+HTTP\/\d\.\d/i,
12
-			:webhost	=> /^HOST\:\s+([^\n\r]+)/i,
13
-		}
14
-	end
9
+  def register_sigs
10
+    self.sigs = {
11
+      :get		=> /^GET\s+([^\n]+)\s+HTTP\/\d\.\d/i,
12
+      :webhost	=> /^HOST\:\s+([^\n\r]+)/i,
13
+    }
14
+  end
15 15
 
16
-	def parse(pkt)
17
-		# We want to return immediantly if	we do not have a packet which is handled by us
18
-		return unless pkt.is_tcp?
19
-		return if (pkt.tcp_sport != 80 and pkt.tcp_dport != 80)
20
-		s = find_session((pkt.tcp_sport == 80) ? get_session_src(pkt) : get_session_dst(pkt))
16
+  def parse(pkt)
17
+    # We want to return immediantly if	we do not have a packet which is handled by us
18
+    return unless pkt.is_tcp?
19
+    return if (pkt.tcp_sport != 80 and pkt.tcp_dport != 80)
20
+    s = find_session((pkt.tcp_sport == 80) ? get_session_src(pkt) : get_session_dst(pkt))
21 21
 
22
-		self.sigs.each_key do |k|
22
+    self.sigs.each_key do |k|
23 23
 
24
-			# There is only one pattern per run to test
25
-			matched = nil
26
-			matches = nil
24
+      # There is only one pattern per run to test
25
+      matched = nil
26
+      matches = nil
27 27
 
28
-			if(pkt.payload =~ self.sigs[k])
29
-				matched = k
30
-				matches = $1
31
-				sessions[s[:session]].merge!({k => matches})
32
-			end
28
+      if(pkt.payload =~ self.sigs[k])
29
+        matched = k
30
+        matches = $1
31
+        sessions[s[:session]].merge!({k => matches})
32
+      end
33 33
 
34
-			case matched
35
-			when :webhost
36
-				sessions[s[:session]].merge!({k => matches})
37
-				if(s[:get])
38
-					print_status("HTTP GET: #{s[:session]} http://#{s[:webhost]}#{s[:get]}")
39
-					sessions.delete(s[:session])
40
-					return
41
-				end
42
-			when nil
43
-				# No matches, no saved state
44
-			end # end case matched
45
-		end # end of each_key
46
-	end # end of parse
34
+      case matched
35
+      when :webhost
36
+        sessions[s[:session]].merge!({k => matches})
37
+        if(s[:get])
38
+          print_status("HTTP GET: #{s[:session]} http://#{s[:webhost]}#{s[:get]}")
39
+          sessions.delete(s[:session])
40
+          return
41
+        end
42
+      when nil
43
+        # No matches, no saved state
44
+      end # end case matched
45
+    end # end of each_key
46
+  end # end of parse
47 47
 end # end of URL sniffer
48 48
 

+ 48
- 48
data/john/run.linux.x64.mmx/genincstats.rb View File

@@ -3,20 +3,20 @@
3 3
 require 'getoptlong'
4 4
 
5 5
 def	help
6
-	puts "Usage: #{$0} [options]"
7
-	puts "\t-h --help\t\tthis help."
8
-	puts "\t-f --file\t\toutput file."
9
-	puts "\t-n --num\t\tcharset: 0123456789"
10
-	puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
-	puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
-	puts "\t-l --alphanum\t\tcharset: alpha + num"
13
-	puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
-	puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
-	puts "\t-c --custom"
16
-	puts "\nExample:\n"
17
-	puts "#{$0} -f stats -s"
18
-	puts "#{$0} -f stats -c \"0123abc+=\""
19
-	exit
6
+  puts "Usage: #{$0} [options]"
7
+  puts "\t-h --help\t\tthis help."
8
+  puts "\t-f --file\t\toutput file."
9
+  puts "\t-n --num\t\tcharset: 0123456789"
10
+  puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
+  puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
+  puts "\t-l --alphanum\t\tcharset: alpha + num"
13
+  puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
+  puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
+  puts "\t-c --custom"
16
+  puts "\nExample:\n"
17
+  puts "#{$0} -f stats -s"
18
+  puts "#{$0} -f stats -c \"0123abc+=\""
19
+  exit
20 20
 end
21 21
 
22 22
 ch_alpha 	= 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num 		= '0123456789'
24 24
 ch_sp		= '!@#$+=.*'
25 25
 
26 26
 opts = GetoptLong.new(
27
-	[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
-	[ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
-	[ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
-	[ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
-	[ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
-	[ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
-	[ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
-	[ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
-	[ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
27
+  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
+  [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
+  [ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
+  [ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
+  [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
+  [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
+  [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
+  [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
+  [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
36 36
 )
37 37
 
38 38
 charset = nil
39 39
 filename = "stats_out"
40 40
 
41 41
 opts.each do |opt, arg|
42
-	case opt
43
-	when '--help'
44
-		help
45
-	when '--file'
46
-		filename = arg
47
-	when '--num'
48
-		charset = ch_num
49
-	when '--alpha'
50
-		charset = ch_alpha
51
-	when '--alphamaj'
52
-		charset = ch_alpha.capitalize
53
-	when '--alphanum'
54
-		charset = ch_alpha + ch_num
55
-	when '--alphanummaj'
56
-		charset = ch_alpha.capitalize + ch_num
57
-	when '--all'
58
-		charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
-	when '--custom'
60
-		charset = arg
61
-	end
42
+  case opt
43
+  when '--help'
44
+    help
45
+  when '--file'
46
+    filename = arg
47
+  when '--num'
48
+    charset = ch_num
49
+  when '--alpha'
50
+    charset = ch_alpha
51
+  when '--alphamaj'
52
+    charset = ch_alpha.capitalize
53
+  when '--alphanum'
54
+    charset = ch_alpha + ch_num
55
+  when '--alphanummaj'
56
+    charset = ch_alpha.capitalize + ch_num
57
+  when '--all'
58
+    charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
+  when '--custom'
60
+    charset = arg
61
+  end
62 62
 end
63 63
 
64 64
 
65 65
 if charset == nil
66
-	help
66
+  help
67 67
 end
68 68
 
69 69
 
70 70
 fstat = File.open(filename, "w")
71 71
 charset.each_byte do |c|
72
-	fstat.write("1=proba1[#{c.to_s}]\n")
73
-	charset.each_byte do |tmp|
74
-		fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
-	end
72
+  fstat.write("1=proba1[#{c.to_s}]\n")
73
+  charset.each_byte do |tmp|
74
+    fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
+  end
76 76
 end
77 77
 fstat.close
78 78
 

+ 48
- 48
data/john/run.linux.x86.any/genincstats.rb View File

@@ -3,20 +3,20 @@
3 3
 require 'getoptlong'
4 4
 
5 5
 def	help
6
-	puts "Usage: #{$0} [options]"
7
-	puts "\t-h --help\t\tthis help."
8
-	puts "\t-f --file\t\toutput file."
9
-	puts "\t-n --num\t\tcharset: 0123456789"
10
-	puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
-	puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
-	puts "\t-l --alphanum\t\tcharset: alpha + num"
13
-	puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
-	puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
-	puts "\t-c --custom"
16
-	puts "\nExample:\n"
17
-	puts "#{$0} -f stats -s"
18
-	puts "#{$0} -f stats -c \"0123abc+=\""
19
-	exit
6
+  puts "Usage: #{$0} [options]"
7
+  puts "\t-h --help\t\tthis help."
8
+  puts "\t-f --file\t\toutput file."
9
+  puts "\t-n --num\t\tcharset: 0123456789"
10
+  puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
+  puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
+  puts "\t-l --alphanum\t\tcharset: alpha + num"
13
+  puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
+  puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
+  puts "\t-c --custom"
16
+  puts "\nExample:\n"
17
+  puts "#{$0} -f stats -s"
18
+  puts "#{$0} -f stats -c \"0123abc+=\""
19
+  exit
20 20
 end
21 21
 
22 22
 ch_alpha 	= 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num 		= '0123456789'
24 24
 ch_sp		= '!@#$+=.*'
25 25
 
26 26
 opts = GetoptLong.new(
27
-	[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
-	[ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
-	[ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
-	[ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
-	[ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
-	[ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
-	[ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
-	[ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
-	[ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
27
+  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
+  [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
+  [ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
+  [ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
+  [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
+  [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
+  [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
+  [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
+  [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
36 36
 )
37 37
 
38 38
 charset = nil
39 39
 filename = "stats_out"
40 40
 
41 41
 opts.each do |opt, arg|
42
-	case opt
43
-	when '--help'
44
-		help
45
-	when '--file'
46
-		filename = arg
47
-	when '--num'
48
-		charset = ch_num
49
-	when '--alpha'
50
-		charset = ch_alpha
51
-	when '--alphamaj'
52
-		charset = ch_alpha.capitalize
53
-	when '--alphanum'
54
-		charset = ch_alpha + ch_num
55
-	when '--alphanummaj'
56
-		charset = ch_alpha.capitalize + ch_num
57
-	when '--all'
58
-		charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
-	when '--custom'
60
-		charset = arg
61
-	end
42
+  case opt
43
+  when '--help'
44
+    help
45
+  when '--file'
46
+    filename = arg
47
+  when '--num'
48
+    charset = ch_num
49
+  when '--alpha'
50
+    charset = ch_alpha
51
+  when '--alphamaj'
52
+    charset = ch_alpha.capitalize
53
+  when '--alphanum'
54
+    charset = ch_alpha + ch_num
55
+  when '--alphanummaj'
56
+    charset = ch_alpha.capitalize + ch_num
57
+  when '--all'
58
+    charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
+  when '--custom'
60
+    charset = arg
61
+  end
62 62
 end
63 63
 
64 64
 
65 65
 if charset == nil
66
-	help
66
+  help
67 67
 end
68 68
 
69 69
 
70 70
 fstat = File.open(filename, "w")
71 71
 charset.each_byte do |c|
72
-	fstat.write("1=proba1[#{c.to_s}]\n")
73
-	charset.each_byte do |tmp|
74
-		fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
-	end
72
+  fstat.write("1=proba1[#{c.to_s}]\n")
73
+  charset.each_byte do |tmp|
74
+    fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
+  end
76 76
 end
77 77
 fstat.close
78 78
 

+ 48
- 48
data/john/run.linux.x86.mmx/genincstats.rb View File

@@ -3,20 +3,20 @@
3 3
 require 'getoptlong'
4 4
 
5 5
 def	help
6
-	puts "Usage: #{$0} [options]"
7
-	puts "\t-h --help\t\tthis help."
8
-	puts "\t-f --file\t\toutput file."
9
-	puts "\t-n --num\t\tcharset: 0123456789"
10
-	puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
-	puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
-	puts "\t-l --alphanum\t\tcharset: alpha + num"
13
-	puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
-	puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
-	puts "\t-c --custom"
16
-	puts "\nExample:\n"
17
-	puts "#{$0} -f stats -s"
18
-	puts "#{$0} -f stats -c \"0123abc+=\""
19
-	exit
6
+  puts "Usage: #{$0} [options]"
7
+  puts "\t-h --help\t\tthis help."
8
+  puts "\t-f --file\t\toutput file."
9
+  puts "\t-n --num\t\tcharset: 0123456789"
10
+  puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
+  puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
+  puts "\t-l --alphanum\t\tcharset: alpha + num"
13
+  puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
+  puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
+  puts "\t-c --custom"
16
+  puts "\nExample:\n"
17
+  puts "#{$0} -f stats -s"
18
+  puts "#{$0} -f stats -c \"0123abc+=\""
19
+  exit
20 20
 end
21 21
 
22 22
 ch_alpha 	= 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num 		= '0123456789'
24 24
 ch_sp		= '!@#$+=.*'
25 25
 
26 26
 opts = GetoptLong.new(
27
-	[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
-	[ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
-	[ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
-	[ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
-	[ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
-	[ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
-	[ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
-	[ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
-	[ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
27
+  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
+  [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
+  [ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
+  [ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
+  [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
+  [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
+  [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
+  [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
+  [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
36 36
 )
37 37
 
38 38
 charset = nil
39 39
 filename = "stats_out"
40 40
 
41 41
 opts.each do |opt, arg|
42
-	case opt
43
-	when '--help'
44
-		help
45
-	when '--file'
46
-		filename = arg
47
-	when '--num'
48
-		charset = ch_num
49
-	when '--alpha'
50
-		charset = ch_alpha
51
-	when '--alphamaj'
52
-		charset = ch_alpha.capitalize
53
-	when '--alphanum'
54
-		charset = ch_alpha + ch_num
55
-	when '--alphanummaj'
56
-		charset = ch_alpha.capitalize + ch_num
57
-	when '--all'
58
-		charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
-	when '--custom'
60
-		charset = arg
61
-	end
42
+  case opt
43
+  when '--help'
44
+    help
45
+  when '--file'
46
+    filename = arg
47
+  when '--num'
48
+    charset = ch_num
49
+  when '--alpha'
50
+    charset = ch_alpha
51
+  when '--alphamaj'
52
+    charset = ch_alpha.capitalize
53
+  when '--alphanum'
54
+    charset = ch_alpha + ch_num
55
+  when '--alphanummaj'
56
+    charset = ch_alpha.capitalize + ch_num
57
+  when '--all'
58
+    charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
+  when '--custom'
60
+    charset = arg
61
+  end
62 62
 end
63 63
 
64 64
 
65 65
 if charset == nil
66
-	help
66
+  help
67 67
 end
68 68
 
69 69
 
70 70
 fstat = File.open(filename, "w")
71 71
 charset.each_byte do |c|
72
-	fstat.write("1=proba1[#{c.to_s}]\n")
73
-	charset.each_byte do |tmp|
74
-		fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
-	end
72
+  fstat.write("1=proba1[#{c.to_s}]\n")
73
+  charset.each_byte do |tmp|
74
+    fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
+  end
76 76
 end
77 77
 fstat.close
78 78
 

+ 48
- 48
data/john/run.linux.x86.sse2/genincstats.rb View File

@@ -3,20 +3,20 @@
3 3
 require 'getoptlong'
4 4
 
5 5
 def	help
6
-	puts "Usage: #{$0} [options]"
7
-	puts "\t-h --help\t\tthis help."
8
-	puts "\t-f --file\t\toutput file."
9
-	puts "\t-n --num\t\tcharset: 0123456789"
10
-	puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
-	puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
-	puts "\t-l --alphanum\t\tcharset: alpha + num"
13
-	puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
-	puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
-	puts "\t-c --custom"
16
-	puts "\nExample:\n"
17
-	puts "#{$0} -f stats -s"
18
-	puts "#{$0} -f stats -c \"0123abc+=\""
19
-	exit
6
+  puts "Usage: #{$0} [options]"
7
+  puts "\t-h --help\t\tthis help."
8
+  puts "\t-f --file\t\toutput file."
9
+  puts "\t-n --num\t\tcharset: 0123456789"
10
+  puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
+  puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
+  puts "\t-l --alphanum\t\tcharset: alpha + num"
13
+  puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
+  puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
+  puts "\t-c --custom"
16
+  puts "\nExample:\n"
17
+  puts "#{$0} -f stats -s"
18
+  puts "#{$0} -f stats -c \"0123abc+=\""
19
+  exit
20 20
 end
21 21
 
22 22
 ch_alpha 	= 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num 		= '0123456789'
24 24
 ch_sp		= '!@#$+=.*'
25 25
 
26 26
 opts = GetoptLong.new(
27
-	[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
-	[ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
-	[ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
-	[ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
-	[ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
-	[ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
-	[ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
-	[ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
-	[ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
27
+  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
+  [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
+  [ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
+  [ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
+  [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
+  [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
+  [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
+  [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
+  [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
36 36
 )
37 37
 
38 38
 charset = nil
39 39
 filename = "stats_out"
40 40
 
41 41
 opts.each do |opt, arg|
42
-	case opt
43
-	when '--help'
44
-		help
45
-	when '--file'
46
-		filename = arg
47
-	when '--num'
48
-		charset = ch_num
49
-	when '--alpha'
50
-		charset = ch_alpha
51
-	when '--alphamaj'
52
-		charset = ch_alpha.capitalize
53
-	when '--alphanum'
54
-		charset = ch_alpha + ch_num
55
-	when '--alphanummaj'
56
-		charset = ch_alpha.capitalize + ch_num
57
-	when '--all'
58
-		charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
-	when '--custom'
60
-		charset = arg
61
-	end
42
+  case opt
43
+  when '--help'
44
+    help
45
+  when '--file'
46
+    filename = arg
47
+  when '--num'
48
+    charset = ch_num
49
+  when '--alpha'
50
+    charset = ch_alpha
51
+  when '--alphamaj'
52
+    charset = ch_alpha.capitalize
53
+  when '--alphanum'
54
+    charset = ch_alpha + ch_num
55
+  when '--alphanummaj'
56
+    charset = ch_alpha.capitalize + ch_num
57
+  when '--all'
58
+    charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
+  when '--custom'
60
+    charset = arg
61
+  end
62 62
 end
63 63
 
64 64
 
65 65
 if charset == nil
66
-	help
66
+  help
67 67
 end
68 68
 
69 69
 
70 70
 fstat = File.open(filename, "w")
71 71
 charset.each_byte do |c|
72
-	fstat.write("1=proba1[#{c.to_s}]\n")
73
-	charset.each_byte do |tmp|
74
-		fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
-	end
72
+  fstat.write("1=proba1[#{c.to_s}]\n")
73
+  charset.each_byte do |tmp|
74
+    fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
+  end
76 76
 end
77 77
 fstat.close
78 78
 

+ 48
- 48
data/john/run.win32.any/genincstats.rb View File

@@ -3,20 +3,20 @@
3 3
 require 'getoptlong'
4 4
 
5 5
 def	help
6
-	puts "Usage: #{$0} [options]"
7
-	puts "\t-h --help\t\tthis help."
8
-	puts "\t-f --file\t\toutput file."
9
-	puts "\t-n --num\t\tcharset: 0123456789"
10
-	puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
-	puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
-	puts "\t-l --alphanum\t\tcharset: alpha + num"
13
-	puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
-	puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
-	puts "\t-c --custom"
16
-	puts "\nExample:\n"
17
-	puts "#{$0} -f stats -s"
18
-	puts "#{$0} -f stats -c \"0123abc+=\""
19
-	exit
6
+  puts "Usage: #{$0} [options]"
7
+  puts "\t-h --help\t\tthis help."
8
+  puts "\t-f --file\t\toutput file."
9
+  puts "\t-n --num\t\tcharset: 0123456789"
10
+  puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
+  puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
+  puts "\t-l --alphanum\t\tcharset: alpha + num"
13
+  puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
+  puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
+  puts "\t-c --custom"
16
+  puts "\nExample:\n"
17
+  puts "#{$0} -f stats -s"
18
+  puts "#{$0} -f stats -c \"0123abc+=\""
19
+  exit
20 20
 end
21 21
 
22 22
 ch_alpha 	= 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num 		= '0123456789'
24 24
 ch_sp		= '!@#$+=.*'
25 25
 
26 26
 opts = GetoptLong.new(
27
-	[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
-	[ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
-	[ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
-	[ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
-	[ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
-	[ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
-	[ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
-	[ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
-	[ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
27
+  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
+  [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
+  [ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
+  [ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
+  [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
+  [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
+  [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
+  [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
+  [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
36 36
 )
37 37
 
38 38
 charset = nil
39 39
 filename = "stats_out"
40 40
 
41 41
 opts.each do |opt, arg|
42
-	case opt
43
-	when '--help'
44
-		help
45
-	when '--file'
46
-		filename = arg
47
-	when '--num'
48
-		charset = ch_num
49
-	when '--alpha'
50
-		charset = ch_alpha
51
-	when '--alphamaj'
52
-		charset = ch_alpha.capitalize
53
-	when '--alphanum'
54
-		charset = ch_alpha + ch_num
55
-	when '--alphanummaj'
56
-		charset = ch_alpha.capitalize + ch_num
57
-	when '--all'
58
-		charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
-	when '--custom'
60
-		charset = arg
61
-	end
42
+  case opt
43
+  when '--help'
44
+    help
45
+  when '--file'
46
+    filename = arg
47
+  when '--num'
48
+    charset = ch_num
49
+  when '--alpha'
50
+    charset = ch_alpha
51
+  when '--alphamaj'
52
+    charset = ch_alpha.capitalize
53
+  when '--alphanum'
54
+    charset = ch_alpha + ch_num
55
+  when '--alphanummaj'
56
+    charset = ch_alpha.capitalize + ch_num
57
+  when '--all'
58
+    charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
+  when '--custom'
60
+    charset = arg
61
+  end
62 62
 end
63 63
 
64 64
 
65 65
 if charset == nil
66
-	help
66
+  help
67 67
 end
68 68
 
69 69
 
70 70
 fstat = File.open(filename, "w")
71 71
 charset.each_byte do |c|
72
-	fstat.write("1=proba1[#{c.to_s}]\n")
73
-	charset.each_byte do |tmp|
74
-		fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
-	end
72
+  fstat.write("1=proba1[#{c.to_s}]\n")
73
+  charset.each_byte do |tmp|
74
+    fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
+  end
76 76
 end
77 77
 fstat.close
78 78
 

+ 48
- 48
data/john/run.win32.mmx/genincstats.rb View File

@@ -3,20 +3,20 @@
3 3
 require 'getoptlong'
4 4
 
5 5
 def	help
6
-	puts "Usage: #{$0} [options]"
7
-	puts "\t-h --help\t\tthis help."
8
-	puts "\t-f --file\t\toutput file."
9
-	puts "\t-n --num\t\tcharset: 0123456789"
10
-	puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
-	puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
-	puts "\t-l --alphanum\t\tcharset: alpha + num"
13
-	puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
-	puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
-	puts "\t-c --custom"
16
-	puts "\nExample:\n"
17
-	puts "#{$0} -f stats -s"
18
-	puts "#{$0} -f stats -c \"0123abc+=\""
19
-	exit
6
+  puts "Usage: #{$0} [options]"
7
+  puts "\t-h --help\t\tthis help."
8
+  puts "\t-f --file\t\toutput file."
9
+  puts "\t-n --num\t\tcharset: 0123456789"
10
+  puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
+  puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
+  puts "\t-l --alphanum\t\tcharset: alpha + num"
13
+  puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
+  puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
+  puts "\t-c --custom"
16
+  puts "\nExample:\n"
17
+  puts "#{$0} -f stats -s"
18
+  puts "#{$0} -f stats -c \"0123abc+=\""
19
+  exit
20 20
 end
21 21
 
22 22
 ch_alpha 	= 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num 		= '0123456789'
24 24
 ch_sp		= '!@#$+=.*'
25 25
 
26 26
 opts = GetoptLong.new(
27
-	[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
-	[ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
-	[ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
-	[ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
-	[ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
-	[ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
-	[ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
-	[ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
-	[ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
27
+  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
+  [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
+  [ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
+  [ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
+  [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
+  [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
+  [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
+  [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
+  [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
36 36
 )
37 37
 
38 38
 charset = nil
39 39
 filename = "stats_out"
40 40
 
41 41
 opts.each do |opt, arg|
42
-	case opt
43
-	when '--help'
44
-		help
45
-	when '--file'
46
-		filename = arg
47
-	when '--num'
48
-		charset = ch_num
49
-	when '--alpha'
50
-		charset = ch_alpha
51
-	when '--alphamaj'
52
-		charset = ch_alpha.capitalize
53
-	when '--alphanum'
54
-		charset = ch_alpha + ch_num
55
-	when '--alphanummaj'
56
-		charset = ch_alpha.capitalize + ch_num
57
-	when '--all'
58
-		charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
-	when '--custom'
60
-		charset = arg
61
-	end
42
+  case opt
43
+  when '--help'
44
+    help
45
+  when '--file'
46
+    filename = arg
47
+  when '--num'
48
+    charset = ch_num
49
+  when '--alpha'
50
+    charset = ch_alpha
51
+  when '--alphamaj'
52
+    charset = ch_alpha.capitalize
53
+  when '--alphanum'
54
+    charset = ch_alpha + ch_num
55
+  when '--alphanummaj'
56
+    charset = ch_alpha.capitalize + ch_num
57
+  when '--all'
58
+    charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
+  when '--custom'
60
+    charset = arg
61
+  end
62 62
 end
63 63
 
64 64
 
65 65
 if charset == nil
66
-	help
66
+  help
67 67
 end
68 68
 
69 69
 
70 70
 fstat = File.open(filename, "w")
71 71
 charset.each_byte do |c|
72
-	fstat.write("1=proba1[#{c.to_s}]\n")
73
-	charset.each_byte do |tmp|
74
-		fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
-	end
72
+  fstat.write("1=proba1[#{c.to_s}]\n")
73
+  charset.each_byte do |tmp|
74
+    fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
+  end
76 76
 end
77 77
 fstat.close
78 78
 

+ 48
- 48
data/john/run.win32.sse2/genincstats.rb View File

@@ -3,20 +3,20 @@
3 3
 require 'getoptlong'
4 4
 
5 5
 def	help
6
-	puts "Usage: #{$0} [options]"
7
-	puts "\t-h --help\t\tthis help."
8
-	puts "\t-f --file\t\toutput file."
9
-	puts "\t-n --num\t\tcharset: 0123456789"
10
-	puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
-	puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
-	puts "\t-l --alphanum\t\tcharset: alpha + num"
13
-	puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
-	puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
-	puts "\t-c --custom"
16
-	puts "\nExample:\n"
17
-	puts "#{$0} -f stats -s"
18
-	puts "#{$0} -f stats -c \"0123abc+=\""
19
-	exit
6
+  puts "Usage: #{$0} [options]"
7
+  puts "\t-h --help\t\tthis help."
8
+  puts "\t-f --file\t\toutput file."
9
+  puts "\t-n --num\t\tcharset: 0123456789"
10
+  puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
11
+  puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12
+  puts "\t-l --alphanum\t\tcharset: alpha + num"
13
+  puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
14
+  puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
15
+  puts "\t-c --custom"
16
+  puts "\nExample:\n"
17
+  puts "#{$0} -f stats -s"
18
+  puts "#{$0} -f stats -c \"0123abc+=\""
19
+  exit
20 20
 end
21 21
 
22 22
 ch_alpha 	= 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num 		= '0123456789'
24 24
 ch_sp		= '!@#$+=.*'
25 25
 
26 26
 opts = GetoptLong.new(
27
-	[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
-	[ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
-	[ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
-	[ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
-	[ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
-	[ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
-	[ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
-	[ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
-	[ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
27
+  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
28
+  [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
29
+  [ '--all', '-s', GetoptLong::NO_ARGUMENT],
30
+  [ '--num', '-n', GetoptLong::NO_ARGUMENT],
31
+  [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
32
+  [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
33
+  [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
34
+  [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
35
+  [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
36 36
 )
37 37
 
38 38
 charset = nil
39 39
 filename = "stats_out"
40 40
 
41 41
 opts.each do |opt, arg|
42
-	case opt
43
-	when '--help'
44
-		help
45
-	when '--file'
46
-		filename = arg
47
-	when '--num'
48
-		charset = ch_num
49
-	when '--alpha'
50
-		charset = ch_alpha
51
-	when '--alphamaj'
52
-		charset = ch_alpha.capitalize
53
-	when '--alphanum'
54
-		charset = ch_alpha + ch_num
55
-	when '--alphanummaj'
56
-		charset = ch_alpha.capitalize + ch_num
57
-	when '--all'
58
-		charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
-	when '--custom'
60
-		charset = arg
61
-	end
42
+  case opt
43
+  when '--help'
44
+    help
45
+  when '--file'
46
+    filename = arg
47
+  when '--num'
48
+    charset = ch_num
49
+  when '--alpha'
50
+    charset = ch_alpha
51
+  when '--alphamaj'
52
+    charset = ch_alpha.capitalize
53
+  when '--alphanum'
54
+    charset = ch_alpha + ch_num
55
+  when '--alphanummaj'
56
+    charset = ch_alpha.capitalize + ch_num
57
+  when '--all'
58
+    charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
59
+  when '--custom'
60
+    charset = arg
61
+  end
62 62
 end
63 63
 
64 64
 
65 65
 if charset == nil
66
-	help
66
+  help
67 67
 end
68 68
 
69 69
 
70 70
 fstat = File.open(filename, "w")
71 71
 charset.each_byte do |c|
72
-	fstat.write("1=proba1[#{c.to_s}]\n")
73
-	charset.each_byte do |tmp|
74
-		fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
-	end
72
+  fstat.write("1=proba1[#{c.to_s}]\n")
73
+  charset.each_byte do |tmp|
74
+    fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
75
+  end
76 76
 end
77 77
 fstat.close
78 78
 

+ 18
- 18
data/msfcrawler/basic.rb View File

@@ -18,29 +18,29 @@ require 'uri'
18 18
 
19 19
 class CrawlerSimple < BaseParser
20 20
 
21
-	def parse(request,result)
21
+  def parse(request,result)
22 22
 
23
-		if !result['Content-Type'].include? "text/html"
24
-			return
25
-		end
23
+    if !result['Content-Type'].include? "text/html"
24
+      return
25
+    end
26 26
 
27
-		doc = Hpricot(result.body.to_s)
28
-		doc.search('a').each do |link|
27
+    doc = Hpricot(result.body.to_s)
28
+    doc.search('a').each do |link|
29 29
 
30
-		hr = link.attributes['href']
30
+    hr = link.attributes['href']
31 31
 
32
-		if hr and !hr.match(/^(\#|javascript\:)/)
33
-			begin
34
-				hreq = urltohash('GET',hr,request['uri'],nil)
32
+    if hr and !hr.match(/^(\#|javascript\:)/)
33
+      begin
34
+        hreq = urltohash('GET',hr,request['uri'],nil)
35 35
 
36
-				insertnewpath(hreq)
36
+        insertnewpath(hreq)
37 37
 
38
-			rescue URI::InvalidURIError
39
-				#puts "Parse error"
40
-				#puts "Error: #{link[0]}"
41
-			end
42
-		end
43
-		end
44
-	end
38
+      rescue URI::InvalidURIError
39
+        #puts "Parse error"
40
+        #puts "Error: #{link[0]}"
41
+      end
42
+    end
43
+    end
44
+  end
45 45
 end
46 46
 

+ 38
- 38
data/msfcrawler/forms.rb View File

@@ -18,60 +18,60 @@ require 'uri'
18 18
 
19 19
 class CrawlerForms < BaseParser
20 20
 
21
-	def parse(request,result)
21
+  def parse(request,result)
22 22
 
23
-		if !result['Content-Type'].include? "text/html"
24
-			return
25
-		end
23
+    if !result['Content-Type'].include? "text/html"
24
+      return
25
+    end
26 26
 
27
-		hr = ''
28
-		m = ''
27
+    hr = ''
28
+    m = ''
29 29
 
30
-		doc = Hpricot(result.body.to_s)
31
-		doc.search('form').each do |f|
32
-			hr = f.attributes['action']
30
+    doc = Hpricot(result.body.to_s)
31
+    doc.search('form').each do |f|
32
+      hr = f.attributes['action']
33 33
 
34
-			fname = f.attributes['name']
35
-			if fname.empty?
36
-				fname = "NONE"
37
-			end
34
+      fname = f.attributes['name']
35
+      if fname.empty?
36
+        fname = "NONE"
37
+      end
38 38
 
39
-			m = "GET"
40
-			if !f.attributes['method'].empty?
41
-				m = f.attributes['method'].upcase
42
-			end
39
+      m = "GET"
40
+      if !f.attributes['method'].empty?
41
+        m = f.attributes['method'].upcase
42
+      end
43 43
 
44
-			#puts "Parsing form name: #{fname} (#{m})"
44
+      #puts "Parsing form name: #{fname} (#{m})"
45 45
 
46
-			htmlform = Hpricot(f.inner_html)
46
+      htmlform = Hpricot(f.inner_html)
47 47
 
48
-			arrdata = []
48
+      arrdata = []
49 49
 
50
-			htmlform.search('input').each do |p|
51
-				#puts p.attributes['name']
52
-				#puts p.attributes['type']
53
-				#puts p.attributes['value']
50
+      htmlform.search('input').each do |p|
51
+        #puts p.attributes['name']
52
+        #puts p.attributes['type']
53
+        #puts p.attributes['value']
54 54
 
55
-				#raw_request has uri_encoding disabled as it encodes '='.
56
-				arrdata << (p.attributes['name'] + "=" + Rex::Text.uri_encode(p.attributes['value']))
57
-			end
55
+        #raw_request has uri_encoding disabled as it encodes '='.
56
+        arrdata << (p.attributes['name'] + "=" + Rex::Text.uri_encode(p.attributes['value']))
57
+      end
58 58
 
59
-			data = arrdata.join("&").to_s
59
+      data = arrdata.join("&").to_s
60 60
 
61 61
 
62
-			begin
63
-				hreq = urltohash(m,hr,request['uri'],data)
62
+      begin
63
+        hreq = urltohash(m,hr,request['uri'],data)
64 64
 
65
-				hreq['ctype'] = 'application/x-www-form-urlencoded'
65
+        hreq['ctype'] = 'application/x-www-form-urlencoded'
66 66
 
67
-				insertnewpath(hreq)
67
+        insertnewpath(hreq)
68 68
 
69 69
 
70
-			rescue URI::InvalidURIError
71
-				#puts "Parse error"
72
-				#puts "Error: #{link[0]}"
73
-			end
74
-		end
75
-	end
70
+      rescue URI::InvalidURIError
71
+        #puts "Parse error"
72
+        #puts "Error: #{link[0]}"
73
+      end
74
+    end
75
+  end
76 76
 end
77 77
 

+ 17
- 17
data/msfcrawler/frames.rb View File

@@ -14,28 +14,28 @@ require 'uri'
14 14
 
15 15
 class CrawlerFrames < BaseParser
16 16
 
17
-	def parse(request,result)
17
+  def parse(request,result)
18 18
 
19
-		if !result['Content-Type'].include? "text/html"
20
-			return
21
-		end
19
+    if !result['Content-Type'].include? "text/html"
20
+      return
21
+    end
22 22
 
23
-		doc = Hpricot(result.body.to_s)
24
-		doc.search('iframe').each do |ifra|
23
+    doc = Hpricot(result.body.to_s)
24
+    doc.search('iframe').each do |ifra|
25 25
 
26
-		ir = ifra.attributes['src']
26
+    ir = ifra.attributes['src']
27 27
 
28
-		if ir and !ir.match(/^(\#|javascript\:)/)
29
-			begin
30
-				hreq = urltohash('GET',ir,request['uri'],nil)
28
+    if ir and !ir.match(/^(\#|javascript\:)/)
29
+      begin
30
+        hreq = urltohash('GET',ir,request['uri'],nil)
31 31
 
32
-				insertnewpath(hreq)
32
+        insertnewpath(hreq)
33 33
 
34
-			rescue URI::InvalidURIError
35
-				#puts "Error"
36
-			end
37
-		end
38
-		end
39
-	end
34
+      rescue URI::InvalidURIError
35
+        #puts "Error"
36
+      end
37
+    end
38
+    end
39
+  end
40 40
 end
41 41
 

+ 18
- 18
data/msfcrawler/image.rb View File

@@ -15,29 +15,29 @@ require 'uri'
15 15
 
16 16
 class CrawlerImage < BaseParser
17 17
 
18
-	def parse(request,result)
18
+  def parse(request,result)
19 19
 
20
-		if !result['Content-Type'].include? "text/html"
21
-			return
22
-		end
20
+    if !result['Content-Type'].include? "text/html"
21
+      return
22
+    end
23 23
 
24
-		doc = Hpricot(result.body.to_s)
25
-		doc.search('img').each do |i|
24
+    doc = Hpricot(result.body.to_s)
25
+    doc.search('img').each do |i|
26 26
 
27
-		im = i.attributes['src']
27
+    im = i.attributes['src']
28 28
 
29
-		if im and !im.match(/^(\#|javascript\:)/)
30
-			begin
31
-				hreq = urltohash('GET',im,request['uri'],nil)
29
+    if im and !im.match(/^(\#|javascript\:)/)
30
+      begin
31
+        hreq = urltohash('GET',im,request['uri'],nil)
32 32
 
33
-				insertnewpath(hreq)
33
+        insertnewpath(hreq)
34 34
 
35
-			rescue URI::InvalidURIError
36
-				#puts "Parse error"
37
-				#puts "Error: #{i[0]}"
38
-			end
39
-		end
40
-		end
41
-	end
35
+      rescue URI::InvalidURIError
36
+        #puts "Parse error"
37
+        #puts "Error: #{i[0]}"
38
+      end
39
+    end
40
+    end
41
+  end
42 42
 end
43 43
 

+ 18
- 18
data/msfcrawler/link.rb View File

@@ -15,29 +15,29 @@ require 'uri'
15 15
 
16 16
 class CrawlerLink < BaseParser
17 17
 
18
-	def parse(request,result)
18
+  def parse(request,result)
19 19
 
20
-		if !result['Content-Type'].include? "text/html"
21
-			return
22
-		end
20
+    if !result['Content-Type'].include? "text/html"
21
+      return
22
+    end
23 23
 
24
-		doc = Hpricot(result.body.to_s)
25
-		doc.search('link').each do |link|
24
+    doc = Hpricot(result.body.to_s)
25
+    doc.search('link').each do |link|
26 26
 
27
-		hr = link.attributes['href']
27
+    hr = link.attributes['href']
28 28
 
29
-		if hr and !hr.match(/^(\#|javascript\:)/)
30
-			begin
31
-				hreq = urltohash('GET',hr,request['uri'],nil)
29
+    if hr and !hr.match(/^(\#|javascript\:)/)
30
+      begin
31
+        hreq = urltohash('GET',hr,request['uri'],nil)
32 32
 
33
-				insertnewpath(hreq)
33
+        insertnewpath(hreq)
34 34
 
35
-			rescue URI::InvalidURIError
36
-				#puts "Parse error"
37
-				#puts "Error: #{link[0]}"
38
-			end
39
-		end
40
-		end
41
-	end
35
+      rescue URI::InvalidURIError
36
+        #puts "Parse error"
37
+        #puts "Error: #{link[0]}"
38
+      end
39
+    end
40
+    end
41
+  end
42 42
 end
43 43
 

+ 18
- 18
data/msfcrawler/objects.rb View File

@@ -18,31 +18,31 @@ require 'uri'
18 18
 
19 19
 class CrawlerObjects < BaseParser
20 20
 
21
-	def parse(request,result)
21
+  def parse(request,result)
22 22
 
23
-		if !result['Content-Type'].include? "text/html"
24
-			return
25
-		end
23
+    if !result['Content-Type'].include? "text/html"
24
+      return
25
+    end
26 26
 
27
-		hr = ''
28
-		m = ''
27
+    hr = ''
28
+    m = ''
29 29
 
30
-		doc = Hpricot(result.body.to_s)
31
-		doc.search("//object/embed").each do |obj|
30
+    doc = Hpricot(result.body.to_s)
31
+    doc.search("//object/embed").each do |obj|
32 32
 
33
-			s = obj['src']
33
+      s = obj['src']
34 34