New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with ruby/gems #1
Comments
Just to give more information, I have tried it with 'ruby shank.rb' and 'ruby1.9.2 shank.rb' here is gem env: root@bt:~/shank# gem env
Which makes me think the gems are being installed with the /usr/bin/ruby1.9.2 installation. Here is the gem list: root@bt:~/shank# gem list *** LOCAL GEMS *** addressable (2.2.8, 2.2.6) I can see it there... I know I am using the same ruby executable that RubyGems is using. Maybe gem is installing gems in the wrong spot? |
I haven't messed around with the ruby environment on BT5, myself, so it could be that there are some "particulars" that go with the platform... There are several components to rubygems, but you can sometimes have partial installs of rubygems if the install failed, at some point. I'd first recommend uninstalling packetfu, and then reinstalling it:
One way to verify that a gem is installed is using the "gem which" command like so:
This should tell you where rubygems found packetfu.rb in the ruby lib search path. The following command will print out the entire ruby lib search path... Could you give me the output of:
Amongst all the paths, you should see something along the lines of
If you don't see it there, then try loading rubygems first. This shouldn't be necessary under versions of ruby 1.9.x... but, you never know:
If it suddenly shows up, then that would mean that you need to specify "-rrubygems" when you want to run shank. Finally, you're bouncing between "ruby" and "ruby1.9.2" ... It's possible that /usr/bin/ruby is symlinked to ruby1.9.2... If it's not, then you could be installing your gems in one environment, and running ruby in another. Typically, if you see "ruby1.9.2" as a bin, you'll also see "gem1.9.2" ... Do you get different output if you run:
? |
I'm also experiencing the same issue in BT5R3. 'gem list', shows PacketFu as installed, as does, 'gem which packetfu'. The path is: /root/.gem/ruby/1.9.2/gems/packetfu-1.1.5/lib/packetfu.rb I was getting this error: ./shank.rb:22:in I was able to fix this running: gem install --user-install packetfu I then got the following error: shank.rb:25:in To fix this I ran: gem install --user-install rest-client Now I receive the error: /root/.gem/ruby/1.9.2/gems/packetfu-1.1.5/lib/packetfu/utils.rb:92:in Looking at the shank code, line 120 calls PacketFu: I'm no ruby expert so not sure where to go from here. Any other suggestions would be much appreciated. Also I'm running shank.rb from within the Beef directory using the command 'ruby shank.rb 192.168.1.0/24'. |
So following owndizzle's instructions I did the following: gem1.9.2 install --user-install packetfu and finally** ruby1.9.2 shank.rb 192.168.1.0/24** Which leaves me with the same error: root@bt:~/shank#** ruby1.9.2 shank.rb 192.168.1.0/24** So I do ruby1.8 shank.rb 192.168.1.0/24 shank.rb:349: undefined (?...) sequence: /\A(? HTTP/\d+.\d+ +200.Content-type: *text/html.?\r?\n\r?\n)(?.*)/Now I know shank needs ruby1.9.x but I figured I would give it a shot This command: gem1.9.2 which packetfu /root/.gem/ruby/1.9.2/gems/packetfu-1.1.5/lib/packetfu.rb This command: ruby1.9.2 -rpp -e "pp $:" So basically I am stuck at the same spot pwndizzle is. The gems are working, but for some reason the script isnt |
myjoyce014, Packetfu's capture/injection capabilities are only made available if you also have pcaprub installed. Try
That should resolve the "uninitialized constant PacketFu::Capture" issue. Try that and let us know how it goes. Mike |
Thank the lord it works! root@bt:~/shank# ./shank.rb 192.168.0.1/23 poison root@bt:~/shank# ./autorun.rb DEFAULT USER/PASSWORD: beef/beef [11:03:55][] Browser Exploitation Framework (BeEF) So, a little FYI for everyone on BT5 logged in as root type this: gem1.9.2 install --user-install rest-client and it should work :) Why not make a Gemfile.lock so bundle install can handle this crap? |
pcaprub was the missing piece of the puzzle. It now works fine for me too, issue resolved. |
I always run into issues with ruby versioning and gems and was wondering if perhaps you could help me understand this issue.
I am using BT5RC3 from Blackhat.
I git pulled the repository and ruby shank.rb leaves me with this:
root@bt:~/shank# ruby shank.rb -x
'shank.rb:22:in
require': no such file to load -- packetfu (LoadError) from shank.rb:22:in
Oh yea, I say to myself, I gotta install packetfu:
root@bt:~/shank# gem install packetfu
Successfully installed packetfu-1.1.5
1 gem installed
Installing ri documentation for packetfu-1.1.5...
Installing RDoc documentation for packetfu-1.1.5...
I try again:
root@bt:~/shank# ruby shank.rb -x
'shank.rb:22:in
require': no such file to load -- packetfu (LoadError) from shank.rb:22:in
I noticed it said that ruby version 1.9 was required. Here is my ruby -v
root@bt:~/shank# ruby -v
ruby 1.9.2dev (2010-07-02) [i486-linux]
Are my gems getting put in another installation of ruby or something? Do you know why this is happening?
The text was updated successfully, but these errors were encountered: