Skip to content

Commit ad22221

Browse files
author
Brent Cook
committed
Merge remote-tracking branch 'upstream/master' into land-8056-outlook
2 parents 03698ec + d55b680 commit ad22221

File tree

39 files changed

+1043
-231
lines changed

39 files changed

+1043
-231
lines changed

Gemfile.lock

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
metasploit-framework (4.14.2)
4+
metasploit-framework (4.14.3)
55
actionpack (~> 4.2.6)
66
activerecord (~> 4.2.6)
77
activesupport (~> 4.2.6)
@@ -14,7 +14,7 @@ PATH
1414
metasploit-concern
1515
metasploit-credential
1616
metasploit-model
17-
metasploit-payloads (= 1.2.17)
17+
metasploit-payloads (= 1.2.18)
1818
metasploit_data_models
1919
metasploit_payloads-mettle (= 0.1.7)
2020
msgpack
@@ -104,7 +104,7 @@ GEM
104104
bcrypt (3.1.11)
105105
bit-struct (0.15.0)
106106
builder (3.2.3)
107-
capybara (2.12.1)
107+
capybara (2.13.0)
108108
addressable
109109
mime-types (>= 1.16)
110110
nokogiri (>= 1.3.3)
@@ -145,8 +145,8 @@ GEM
145145
ffi (1.9.18)
146146
filesize (0.1.1)
147147
fivemat (1.3.2)
148-
gherkin (4.0.0)
149-
google-protobuf (3.2.0)
148+
gherkin (4.1.1)
149+
google-protobuf (3.2.0.2)
150150
googleauth (0.5.1)
151151
faraday (~> 0.9)
152152
jwt (~> 1.4)
@@ -164,7 +164,7 @@ GEM
164164
json (2.0.3)
165165
jwt (1.5.6)
166166
little-plugger (1.1.4)
167-
logging (2.1.0)
167+
logging (2.2.0)
168168
little-plugger (~> 1.1)
169169
multi_json (~> 1.10)
170170
loofah (2.0.3)
@@ -190,7 +190,7 @@ GEM
190190
activemodel (~> 4.2.6)
191191
activesupport (~> 4.2.6)
192192
railties (~> 4.2.6)
193-
metasploit-payloads (1.2.17)
193+
metasploit-payloads (1.2.18)
194194
metasploit_data_models (2.0.14)
195195
activerecord (~> 4.2.6)
196196
activesupport (~> 4.2.6)
@@ -227,7 +227,7 @@ GEM
227227
pcaprub
228228
patch_finder (1.0.2)
229229
pcaprub (0.12.4)
230-
pg (0.19.0)
230+
pg (0.20.0)
231231
pg_array_parser (0.0.9)
232232
postgres_ext (3.0.0)
233233
activerecord (>= 4.0.0)
@@ -256,7 +256,7 @@ GEM
256256
thor (>= 0.18.1, < 2.0)
257257
rake (12.0.0)
258258
rb-readline (0.5.4)
259-
recog (2.1.4)
259+
recog (2.1.5)
260260
nokogiri
261261
redcarpet (3.4.0)
262262
rex-arch (0.1.4)
@@ -335,7 +335,7 @@ GEM
335335
faraday (~> 0.9)
336336
jwt (~> 1.5)
337337
multi_json (~> 1.10)
338-
simplecov (0.13.0)
338+
simplecov (0.14.0)
339339
docile (~> 1.1.0)
340340
json (>= 1.8, < 3)
341341
simplecov-html (~> 0.10.0)
@@ -350,7 +350,7 @@ GEM
350350
thread_safe (~> 0.1)
351351
tzinfo-data (1.2017.1)
352352
tzinfo (>= 1.0.0)
353-
windows_error (0.1.0)
353+
windows_error (0.1.1)
354354
xpath (2.0.0)
355355
nokogiri (~> 1.3)
356356
yard (0.9.8)

data/msfcrawler/basic.rb

100755100644
Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
##
2-
# $Id$
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
34
##
45

5-
##
6-
# This file is part of the Metasploit Framework and may be subject to
7-
# redistribution and commercial restrictions. Please see the Metasploit
8-
# Framework web site for more information on licensing and terms of use.
9-
# http://metasploit.com/framework/
10-
##
11-
12-
# $Revision$
13-
14-
require 'rubygems'
156
require 'pathname'
167
require 'nokogiri'
178
require 'uri'
189

1910
class CrawlerSimple < BaseParser
2011

2112
def parse(request,result)
22-
23-
if !result['Content-Type'].include? "text/html"
24-
return
25-
end
13+
return unless result['Content-Type'].include?('text/html')
2614

2715
# doc = Hpricot(result.body.to_s)
2816
doc = Nokogiri::HTML(result.body.to_s)

data/msfcrawler/comments.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'pathname'
7+
require 'nokogiri'
8+
require 'uri'
9+
10+
class CrawlerComments < BaseParser
11+
12+
def parse(request,result)
13+
return unless result['Content-Type'].include?('text/html')
14+
15+
doc = Nokogiri::HTML(result.body.to_s)
16+
doc.xpath('//comment()').each do |comment|
17+
# searching for href
18+
hr = /href\s*=\s*"([^"]*)"/.match(comment)
19+
if hr
20+
begin
21+
hreq = urltohash('GET', hr[1], request['uri'], nil)
22+
insertnewpath(hreq)
23+
rescue URI::InvalidURIError
24+
# ignored
25+
end
26+
end
27+
28+
end
29+
30+
end
31+
end

data/msfcrawler/forms.rb

100755100644
Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,30 @@
11
##
2-
# $Id$
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
34
##
45

5-
##
6-
# This file is part of the Metasploit Framework and may be subject to
7-
# redistribution and commercial restrictions. Please see the Metasploit
8-
# Framework web site for more information on licensing and terms of use.
9-
# http://metasploit.com/framework/
10-
##
11-
12-
# $Revision$
13-
14-
require 'rubygems'
156
require 'pathname'
167
require 'nokogiri'
178
require 'uri'
189

1910
class CrawlerForms < BaseParser
2011

2112
def parse(request,result)
22-
23-
if !result['Content-Type'].include? "text/html"
24-
return
25-
end
26-
27-
hr = ''
28-
m = ''
13+
return unless result['Content-Type'].include?('text/html')
2914

3015
doc = Nokogiri::HTML(result.body.to_s)
3116
doc.css('form').each do |f|
3217
hr = f['action']
3318

34-
fname = f['name']
35-
fname = "NONE" if fname.empty?
19+
# Removed because unused
20+
#fname = f['name']
21+
#fname = 'NONE' if fname.empty?
3622

37-
m = f['method'].empty? ? 'GET' : f['method'].upcase
38-
39-
htmlform = Nokogiri::HTML(f.inner_html)
23+
m = (f['method'].empty? ? 'GET' : f['method'].upcase)
4024

4125
arrdata = []
4226

43-
htmlform.css('input').each do |p|
27+
f.css('input').each do |p|
4428
arrdata << "#{p['name']}=#{Rex::Text.uri_encode(p['value'])}"
4529
end
4630

@@ -51,7 +35,10 @@ def parse(request,result)
5135
hreq['ctype'] = 'application/x-www-form-urlencoded'
5236
insertnewpath(hreq)
5337
rescue URI::InvalidURIError
38+
#puts "Parse error"
39+
#puts "Error: #{link[0]}"
5440
end
41+
5542
end
5643
end
5744
end

data/msfcrawler/frames.rb

100755100644
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
21
##
3-
# This file is part of the Metasploit Framework and may be subject to
4-
# redistribution and commercial restrictions. Please see the Metasploit
5-
# Framework web site for more information on licensing and terms of use.
6-
# http://metasploit.com/framework/
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
74
##
85

9-
10-
require 'rubygems'
116
require 'pathname'
127
require 'nokogiri'
138
require 'uri'
@@ -27,6 +22,7 @@ def parse(request,result)
2722
hreq = urltohash('GET', ir, request['uri'], nil)
2823
insertnewpath(hreq)
2924
rescue URI::InvalidURIError
25+
# ignored
3026
end
3127
end
3228

data/msfcrawler/image.rb

100755100644
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
21
##
3-
# This file is part of the Metasploit Framework and may be subject to
4-
# redistribution and commercial restrictions. Please see the Metasploit
5-
# Framework web site for more information on licensing and terms of use.
6-
# http://metasploit.com/framework/
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
74
##
85

9-
# $Revision: 9212 $
10-
11-
require 'rubygems'
126
require 'pathname'
137
require 'nokogiri'
148
require 'uri'
@@ -27,6 +21,7 @@ def parse(request,result)
2721
hreq = urltohash('GET', im, request['uri'], nil)
2822
insertnewpath(hreq)
2923
rescue URI::InvalidURIError
24+
# ignored
3025
end
3126
end
3227

data/msfcrawler/link.rb

100755100644
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
21
##
3-
# This file is part of the Metasploit Framework and may be subject to
4-
# redistribution and commercial restrictions. Please see the Metasploit
5-
# Framework web site for more information on licensing and terms of use.
6-
# http://metasploit.com/framework/
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
74
##
85

9-
# $Revision: 9212 $
10-
11-
require 'rubygems'
126
require 'pathname'
137
require 'nokogiri'
148
require 'uri'
@@ -26,6 +20,7 @@ def parse(request,result)
2620
hreq = urltohash('GET', hr, request['uri'], nil)
2721
insertnewpath(hreq)
2822
rescue URI::InvalidURIError
23+
# ignored
2924
end
3025
end
3126

data/msfcrawler/objects.rb

100755100644
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
##
2-
# $Id$
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
34
##
45

5-
##
6-
# This file is part of the Metasploit Framework and may be subject to
7-
# redistribution and commercial restrictions. Please see the Metasploit
8-
# Framework web site for more information on licensing and terms of use.
9-
# http://metasploit.com/framework/
10-
##
11-
12-
# $Revision$
13-
14-
require 'rubygems'
156
require 'pathname'
167
require 'nokogiri'
178
require 'uri'
@@ -29,6 +20,7 @@ def parse(request,result)
2920
hreq = urltohash('GET', s, request['uri'], nil)
3021
insertnewpath(hreq)
3122
rescue URI::InvalidURIError
23+
# ignored
3224
end
3325
end
3426
end

data/msfcrawler/scripts.rb

100755100644
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
##
2-
# $Id$
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
34
##
45

5-
##
6-
# This file is part of the Metasploit Framework and may be subject to
7-
# redistribution and commercial restrictions. Please see the Metasploit
8-
# Framework web site for more information on licensing and terms of use.
9-
# http://metasploit.com/framework/
10-
##
11-
12-
# $Revision$
13-
14-
require 'rubygems'
156
require 'pathname'
167
require 'nokogiri'
178
require 'uri'
@@ -21,15 +12,14 @@ class CrawlerScripts < BaseParser
2112
def parse(request,result)
2213
return unless result['Content-Type'].include? "text/html"
2314

24-
hr = ''
25-
m = ''
2615
doc = Nokogiri::HTML(result.body.to_s)
2716
doc.xpath("//script").each do |obj|
2817
s = obj['src']
2918
begin
3019
hreq = urltohash('GET', s, request['uri'], nil)
3120
insertnewpath(hreq)
3221
rescue URI::InvalidURIError
22+
# ignored
3323
end
3424
end
3525

0 commit comments

Comments
 (0)