Module: Gobuster::Parsers::Fuzz

Defined in:
lib/gobuster/parsers/fuzz.rb

Class Method Summary collapse

Class Method Details

.parse(io) {|response| ... } ⇒ Enumerator

Parses gobuster fuzz output.

Parameters:

  • io (IO)

    The IO stream to parse.

Yields:

  • (response)

    The given block will be passed each parsed response.

Yield Parameters:

  • response (Response)

    The parsed response.

Returns:

  • (Enumerator)

    If no block is given, an Enumerator will be returned.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/gobuster/parsers/fuzz.rb', line 21

def self.parse(io)
  return enum_for(__method__,io) unless block_given?

  line_regexp = /^Found:\s+\[Status=(\d{3})\]\s+\[Length=(\d+)\]\s+([^\s]++)/

  io.each_line do |line|
    if (match = line.match(line_regexp))
      yield Response.new(
        status: match[1].to_i,
        size:   match[2].to_i,
        url:    match[3],
      )
    end
  end
end