Skip to content

Commit 58d5cf6

Browse files
committed
Module should use OptRegexp for regex pattern option
Instead of using OptString, OptRegexp should be used because this datastore option is a regex pattern.
1 parent a815d92 commit 58d5cf6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

modules/auxiliary/scanner/http/scraper.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def initialize
2929
register_options(
3030
[
3131
OptString.new('PATH', [ true, "The test path to the page to analize", '/']),
32-
OptString.new('REGEX', [ true, "The regex to use (default regex is a sample to grab page title)", '\<title\>(.*)\<\/title\>']),
32+
OptRegexp.new('REGEX', [ true, "The regex to use (default regex is a sample to grab page title)", '\<title\>(.*)\<\/title\>'])
3333

3434
], self.class)
3535

@@ -57,8 +57,6 @@ def run_host(target_host)
5757
return
5858
end
5959

60-
aregex = Regexp.new(datastore['REGEX'].to_s,Regexp::IGNORECASE)
61-
6260
result = res.body.scan(aregex).flatten.map{ |s| s.strip }.uniq
6361

6462
result.each do |u|

0 commit comments

Comments
 (0)