ThePorgs / Exegol-images

Docker images of the Exegol project
https://exegol.readthedocs.io/
GNU General Public License v3.0
87 stars 67 forks source link

Ruby "rex-text" dependency missing ? #332

Closed Bigyls closed 5 months ago

Bigyls commented 5 months ago

Describe the bug

When I start a new exegol container and I want to use /opt/tools/metasploit-framework/tools/exploit/pattern_create.rb (installed by default), I get an error with a missing dependency (rex-text). After gem install rex-text everything is good.

Because pattern_create.rb is installed by default on exegol, shouldn't the rex-text dependency be installed too?

[Apr 13, 2024 - 21:16:48 (UTC)] exegol /workspace # /opt/tools/metasploit-framework/tools/exploit/pattern_create.rb -l 133
/usr/local/rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/dependency.rb:314:in `to_specs': Could not find 'rex-text' (>= 0) among 91 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/usr/local/rvm/gems/ruby-3.2.2:/usr/local/rvm/rubies/ruby-3.2.2/lib/ruby/gems/3.2.0' , execute `gem env` for more information
        from /usr/local/rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/dependency.rb:326:in `to_spec'
        from /usr/local/rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_gem.rb:57:in `gem'
        from /opt/tools/metasploit-framework/tools/exploit/pattern_create.rb:16:in `<main>'
[Apr 13, 2024 - 21:17:30 (UTC)] exegol /workspace # gem install rex-text
Fetching rex-text-0.2.57.gem
Successfully installed rex-text-0.2.57
Parsing documentation for rex-text-0.2.57
Installing ri documentation for rex-text-0.2.57
Done installing documentation for rex-text after 0 seconds
1 gem installed

A new release of RubyGems is available: 3.4.10 → 3.5.9!
Run `gem update --system 3.5.9` to update your installation.

[Apr 13, 2024 - 21:17:54 (UTC)] exegol /workspace # /opt/tools/metasploit-framework/tools/exploit/pattern_create.rb -l 133
Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3A

Steps To Reproduce

gem install rex-text

Exegol Wrapper Version

v4.3.1

Host OS

None

Configuration of the concerned container

No response

Execution logs in debug mode

/dev/null

Exception

No response

Anything else?

No response

QU35T-code commented 5 months ago

Hey @Bigyls,

Nice catch ! The missing dependency will be added to the build.

Temp fix :

rvm use 3.2.2@metasploit
gem install rex-text
rvm use 3.2.2@default

Solution 1 :

root@exegol metasploit-framework # /usr/local/rvm/gems/ruby-3.2.2@metasploit/wrappers/ruby /opt/tools/metasploit-framework/tools/exploit/pattern_create.rb -l 10
Aa0Aa1Aa2A

Solution 2 :

root@exegol metasploit-framework # rvm use 3.2.2@metasploit
Using /usr/local/rvm/gems/ruby-3.2.2 with gemset metasploit

root@exegol metasploit-framework # /opt/tools/metasploit-framework/tools/exploit/pattern_create.rb -l 10
Aa0Aa1Aa2A
Bigyls commented 5 months ago

Good to know, I think the issue can be done ?

QU35T-code commented 5 months ago

Don't worry, I'll close when I push the fix :)