Skip to content

Commit

Permalink
mozilla_reduceright.rb - fix regex error.
Browse files Browse the repository at this point in the history
[] is character class, and will match on 1, 6, 7, and |.
Where as (16|17) will match on either 16, or 17.

irb(main):053:0> y = /Firefox\/3\.6\.[16|17]/
=> /Firefox\/3\.6\.[16|17]/
irb(main):054:0> x = "Firefox/3.6.13"
=> "Firefox/3.6.13"
irb(main):055:0> x =~ y
=> 0
irb(main):056:0> y = /Firefox\/3\.6\.(16|17)/
=> /Firefox\/3\.6\.(16|17)/
irb(main):057:0> x =~ y
=> nil
  • Loading branch information
Ruslaideemin authored and Ruslaideemin committed Jun 11, 2013
1 parent 69c2501 commit 4e41e87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/exploits/windows/browser/mozilla_reduceright.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def junk(n=4)

def on_request_uri(cli, request)
agent = request.headers['User-Agent']
if agent !~ /Firefox\/3\.6\.[16|17]/
if agent !~ /Firefox\/3\.6\.(16|17)/
print_error("This browser is not supported: #{agent.to_s}")
send_not_found(cli)
return
Expand Down

0 comments on commit 4e41e87

Please sign in to comment.