Module: Gobuster::Parsers::DNS

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

Class Method Summary collapse

Class Method Details

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

Parses gobuster dns output.

Parameters:

  • io (IO)

    The IO stream to parse.

Yields:

  • (hostname)

    The given block will be passed each parsed hostname.

Yield Parameters:

  • hostname (Hostname)

    The parsed hostname.

Returns:

  • (Enumerator)

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



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

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

  io.each_line do |line|
    if line.start_with?('Found: ')
      line.chomp!
      line.sub!('Found: ','')

      yield Hostname.new(line)
    end
  end
end