postmodern/wordlist.rb

Does not seem to work with newer version of spidr?

evoltech opened this issue · 2 comments

With the following code:

require 'wordlist/builders/website'
ws = Wordlist::Builders::Website.build( file, {
   :host => 'ronin-ruby.github.com'
})

The following error results:

<path>/.rvm/gems/ruby-1.9.3-p194/gems/spidr-0.4.1/lib/spidr/session_cache.rb:78:in `[]': undefined method `[]' for nil:NilClass (NoMethodError)
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/spidr-0.4.1/lib/spidr/agent.rb:683:in `prepare_request'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/spidr-0.4.1/lib/spidr/agent.rb:512:in `get_page'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/spidr-0.4.1/lib/spidr/agent.rb:578:in `visit_page'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/spidr-0.4.1/lib/spidr/agent.rb:249:in `run'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/spidr-0.4.1/lib/spidr/agent.rb:231:in `start_at'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/spidr-0.4.1/lib/spidr/agent.rb:184:in `site'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/spidr-0.4.1/lib/spidr/agent.rb:204:in `host'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/spidr-0.4.1/lib/spidr/spidr.rb:89:in `host'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/wordlist-0.1.0/lib/wordlist/builders/website.rb:240:in `build!'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/wordlist-0.1.0/lib/wordlist/builder.rb:83:in `block in build'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/wordlist-0.1.0/lib/wordlist/builder.rb:55:in `call'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/wordlist-0.1.0/lib/wordlist/builder.rb:55:in `initialize'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/wordlist-0.1.0/lib/wordlist/builders/website.rb:207:in `initialize'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/wordlist-0.1.0/lib/wordlist/builder.rb:81:in `new'
    from <path>/.rvm/gems/ruby-1.9.3-p194/gems/wordlist-0.1.0/lib/wordlist/builder.rb:81:in `build'

I spent some time trying to trace the issue here but could not figure it out. I also assume that this lib is deprecated since the wordlist code migrated over to ronin-support, but the builders class is still really nice. Is this a user error?

OK, @proxy was defaulting to nil instead of Spidr.spidr (which is a Hash). Yeah I'd prefer people use Ronin::Wordlist, since it uses the combinatorics library and is faster at performing mutations.

I confirmed this fixed the issue