ronin-rb / ronin-recon

A micro-framework and tool for performing reconnaissance.
https://ronin-rb.dev
GNU Lesser General Public License v3.0
34 stars 9 forks source link

Uninitialized constant URI::WSS error when running ronin-recon #170

Open yantongggg opened 3 months ago

yantongggg commented 3 months ago
ronin-recon run: /var/lib/gems/3.1.0/gems/async-http-0.72.0/lib/async/http/endpoint.rb:25:in `<class:Endpoint>': uninitialized constant URI::WSS (NameError)

                                'wss' => URI::WSS,
                                            ^^^^^
        from /var/lib/gems/3.1.0/gems/async-http-0.72.0/lib/async/http/endpoint.rb:20:in `<module:HTTP>'
        from /var/lib/gems/3.1.0/gems/async-http-0.72.0/lib/async/http/endpoint.rb:18:in `<module:Async>'
        from /var/lib/gems/3.1.0/gems/async-http-0.72.0/lib/async/http/endpoint.rb:17:in `<top (required)>'
        from /var/lib/gems/3.1.0/gems/async-http-0.72.0/lib/async/http/internet.rb:8:in `require_relative'
        from /var/lib/gems/3.1.0/gems/async-http-0.72.0/lib/async/http/internet.rb:8:in `<top (required)>'
        from /var/lib/gems/3.1.0/gems/async-http-0.72.0/lib/async/http.rb:11:in `require_relative'
        from /var/lib/gems/3.1.0/gems/async-http-0.72.0/lib/async/http.rb:11:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:86:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:86:in `require'
        from /var/lib/gems/3.1.0/gems/ronin-recon-0.1.0/lib/ronin/recon/mixins/http.rb:21:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:86:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:86:in `require'
        from /var/lib/gems/3.1.0/gems/ronin-recon-0.1.0/lib/ronin/recon/web_worker.rb:22:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:86:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:86:in `require'
        from /var/lib/gems/3.1.0/gems/ronin-recon-0.1.0/lib/ronin/recon/builtin/web/dir_enum.rb:21:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:86:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:86:in `require'
        from /var/lib/gems/3.1.0/gems/ronin-core-0.2.0/lib/ronin/core/class_registry.rb:233:in `load_class'
        from /var/lib/gems/3.1.0/gems/ronin-recon-0.1.0/lib/ronin/recon/workers.rb:158:in `load'
        from /var/lib/gems/3.1.0/gems/ronin-recon-0.1.0/lib/ronin/recon/workers.rb:63:in `block in load'
        from /usr/lib/ruby/3.1.0/set.rb:511:in `each_key'
        from /usr/lib/ruby/3.1.0/set.rb:511:in `each'
        from /var/lib/gems/3.1.0/gems/ronin-recon-0.1.0/lib/ronin/recon/config.rb:158:in `each'
        from /var/lib/gems/3.1.0/gems/ronin-recon-0.1.0/lib/ronin/recon/workers.rb:62:in `load'
        from /var/lib/gems/3.1.0/gems/ronin-recon-0.1.0/lib/ronin/recon/cli/commands/run.rb:377:in `load_workers'
        from /var/lib/gems/3.1.0/gems/ronin-recon-0.1.0/lib/ronin/recon/cli/commands/run.rb:260:in `run'
        from /var/lib/gems/3.1.0/gems/command_kit-0.6.0/lib/command_kit/main.rb:97:in `main'
        from /var/lib/gems/3.1.0/gems/command_kit-0.6.0/lib/command_kit/arguments.rb:194:in `main'
        from /var/lib/gems/3.1.0/gems/command_kit-0.6.0/lib/command_kit/options/parser.rb:101:in `main'
        from /var/lib/gems/3.1.0/gems/command_kit-0.6.0/lib/command_kit/exception_handler.rb:41:in `main'
        from /var/lib/gems/3.1.0/gems/command_kit-0.6.0/lib/command_kit/commands.rb:257:in `invoke'
        from /var/lib/gems/3.1.0/gems/command_kit-0.6.0/lib/command_kit/commands.rb:304:in `run'
        from /var/lib/gems/3.1.0/gems/command_kit-0.6.0/lib/command_kit/main.rb:97:in `main'
        from /var/lib/gems/3.1.0/gems/command_kit-0.6.0/lib/command_kit/arguments.rb:194:in `main'
        from /var/lib/gems/3.1.0/gems/command_kit-0.6.0/lib/command_kit/options/parser.rb:101:in `main'
        from /var/lib/gems/3.1.0/gems/command_kit-0.6.0/lib/command_kit/main.rb:79:in `main'
        from /var/lib/gems/3.1.0/gems/command_kit-0.6.0/lib/command_kit/main.rb:54:in `start'
        from /var/lib/gems/3.1.0/gems/ronin-recon-0.1.0/bin/ronin-recon:16:in `<top (required)>'
        from /usr/local/bin/ronin-recon:25:in `load'
        from /usr/local/bin/ronin-recon:25:in `<main>'
AI-Mozi commented 2 months ago

Hm.. I looks like a bug in async-http @postmodern ? What arguments did you pass to ronin-recon run @yantongggg ?

postmodern commented 2 months ago

@yantongggg nice find. This does appear to be a async-http bug. I'll report it upstream.

postmodern commented 2 months ago

@yantongggg also what version of Ruby are using? I'm trying to reproduce this bug locally.

yantongggg commented 2 months ago

@AI-Mozi i running this command ronin-recon run youtube.com but run for example.com also coming out this error

yantongggg commented 2 months ago

@postmodern ruby version: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu]

postmodern commented 2 months ago

@yantongggg confirmed that this occurs on ruby-3.1.2, but not 3.1.6.

$ gem install async-http
$ irb -r async/http
/home/postmodern/.gem/ruby/3.1.2/gems/async-http-0.72.0/lib/async/http/endpoint.rb:25:in `<class:Endpoint>': uninitialized constant URI::WSS (NameError)

                'wss' => URI::WSS,
                            ^^^^^
    from /home/postmodern/.gem/ruby/3.1.2/gems/async-http-0.72.0/lib/async/http/endpoint.rb:20:in `<module:HTTP>'
    from /home/postmodern/.gem/ruby/3.1.2/gems/async-http-0.72.0/lib/async/http/endpoint.rb:18:in `<module:Async>'
    from /home/postmodern/.gem/ruby/3.1.2/gems/async-http-0.72.0/lib/async/http/endpoint.rb:17:in `<top (required)>'
    from /home/postmodern/.gem/ruby/3.1.2/gems/async-http-0.72.0/lib/async/http/internet.rb:8:in `require_relative'
    from /home/postmodern/.gem/ruby/3.1.2/gems/async-http-0.72.0/lib/async/http/internet.rb:8:in `<top (required)>'
    from /home/postmodern/.gem/ruby/3.1.2/gems/async-http-0.72.0/lib/async/http.rb:11:in `require_relative'
    from /home/postmodern/.gem/ruby/3.1.2/gems/async-http-0.72.0/lib/async/http.rb:11:in `<top (required)>'
    from <internal:/home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
    from <internal:/home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
    from <internal:/home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
    from /home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/irb/init.rb:395:in `block in load_modules'
    from /home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/irb/init.rb:393:in `each'
    from /home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/irb/init.rb:393:in `load_modules'
    from /home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/irb/init.rb:21:in `setup'
    from /home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/irb.rb:412:in `start'
    from /home/postmodern/.rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
    from /home/postmodern/.rubies/ruby-3.1.2/bin/irb:25:in `load'
    from /home/postmodern/.rubies/ruby-3.1.2/bin/irb:25:in `<main>'
<internal:/home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- async/http (LoadError)
    from <internal:/home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from /home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/irb/init.rb:395:in `block in load_modules'
    from /home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/irb/init.rb:393:in `each'
    from /home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/irb/init.rb:393:in `load_modules'
    from /home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/irb/init.rb:21:in `setup'
    from /home/postmodern/.rubies/ruby-3.1.2/lib/ruby/3.1.0/irb.rb:412:in `start'
    from /home/postmodern/.rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
    from /home/postmodern/.rubies/ruby-3.1.2/bin/irb:25:in `load'
    from /home/postmodern/.rubies/ruby-3.1.2/bin/irb:25:in `<main>'
$ irb -r uri/wss -r async/http
irb(main):001:0> 

Apparently in uri/wss isn't required by default. However, there's a quick fix for this. Running gem update uri will install a newer version of the uri gem.

$ gem update uri
$ irb -r async/http
irb(main):001:0> 

You may want to run sudo gem update uri since you're using the system's ruby.