View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003446 | Kali Linux | Kali Package Bug | public | 2016-07-25 16:11 | 2016-07-28 09:35 |
Reporter | pgrohe | Assigned To | sbrun | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 2016.1 | ||||
Fixed in Version | 2016.2 | ||||
Summary | 0003446: Metasploit Framework - pattern_create.rb fails with Gem::LoadError for rex-text after Kali dist-upgrade | ||||
Description | The pattern_create.rb script that comes with Metasploit fails to execute after doing a dist-upgrade on a fresh install of the latest Kali Linux 64 bit ISO. Prior to dist-upgrade pattern_create.rb runs correctly. After dist-upgrade, the following error is generated: root@kali:/usr/share/metasploit-framework/tools/exploit# ./pattern_create.rb 500 FixRunning 'gem install rex-text' resolved the issue for me. I'm not too familiar with Ruby gem / environment management so I'm unsure if this is a clean way of resolving the problem. Ideally this would not be required and it would work 'out of of the box' after the dist-upgrade. NOTE - I'm unclear whether this is a Kali packaging issue or this is a Metasploit codebase issue. Please advise if this needs to go to Metasploit's bug tracker. | ||||
Steps To Reproduce | Steps to Reproduce | ||||
Additional Information | root@kali:/usr/share/metasploit-framework/tools/exploit# gem query --local LOCAL GEMS addressable (2.4.0) | ||||
I tried this again from a fresh install. Just want to add that after doing the dist-upgrade, simply running 'bundle install' from /usr/share/metasploit-framework/ does not resolve the issue even though rex-text is mentioned in the output when running 'bundle install'. Output of 'bundle install' from /usr/share/metasploit-framework Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will |
|
Running the ruby script directly means running outside of the bundle... so it doesn't find the gem. You should try to execute it through "bundle exec tools/exploit/pattern_create.rb 500". Does it work that way when run from /usr/share/metasploit-framework/ ? Version 4.12.11 added “gem 'rex-text'” line and only that line in this script. I'm not sure why. It might be worth asking upstream the reason for this. |
|
Here's the change I mentioned: |
|
Running 'bundle exec tools/exploit/pattern_create.rb 500' from /usr/share/metasploit-framework does work. Note that it looks like they added a -l switch to specify length of the patterns now, so the command above will complain about missing arguments to pattern_create.rb, but the script does execute without the gem error. |
|
Works from the msfconsole prompt as well. You'll need to specify the full path to pattern_create.rb when running it. So if I understand correctly the gems required for this script are in a seperate, isolated Ruby environment (bundle?) for metasploit-framework and are not 'visible' to Ruby when just running from the terminal? Like virtualenv in Python. Not that big a deal to have to 'bundle exec' or run from msfconsole I guess but it is a change from how these scripts could be executed previously. Regarding following up with upstream about the reasons for this, is that something I should do? What is the upstream being referred to in this case? Raise an issue on metasploit-framework github? |
|
I filed this ticket against metasploit: https://github.com/rapid7/metasploit-framework/issues/7123 |
|
@pgrohe, yes bundler is ruby's virtualenv. Let's see what upstream has to say on the issue I filed. |
|
the new version 4.12.15-0kali2 fixes this issue (we change the ruby interpreter of the tools/exploit/*.rb files) |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2016-07-25 16:11 | pgrohe | New Issue | |
2016-07-25 18:14 | pgrohe | Note Added: 0005589 | |
2016-07-25 19:19 | rhertzog | Note Added: 0005592 | |
2016-07-25 19:21 | rhertzog | Note Added: 0005593 | |
2016-07-25 19:21 | rhertzog | Assigned To | => sbrun |
2016-07-25 19:21 | rhertzog | Status | new => assigned |
2016-07-25 19:28 | pgrohe | Note Added: 0005594 | |
2016-07-25 19:37 | pgrohe | Note Added: 0005595 | |
2016-07-25 19:40 | pgrohe | Note Edited: 0005595 | |
2016-07-25 19:43 | pgrohe | Note Edited: 0005595 | |
2016-07-25 19:43 | pgrohe | Note Edited: 0005595 | |
2016-07-25 19:43 | pgrohe | Note Edited: 0005595 | |
2016-07-25 19:50 | rhertzog | Note Added: 0005596 | |
2016-07-25 19:52 | rhertzog | Note Added: 0005597 | |
2016-07-28 09:35 | sbrun | Note Added: 0005610 | |
2016-07-28 09:35 | sbrun | Status | assigned => resolved |
2016-07-28 09:35 | sbrun | Resolution | open => fixed |
2016-07-28 09:35 | sbrun | Fixed in Version | => 2016.2 |