Skip to content
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

update docker stuff #8689

Merged
merged 3 commits into from
Jul 17, 2017
Merged

update docker stuff #8689

merged 3 commits into from
Jul 17, 2017

Conversation

firefart
Copy link
Contributor

@firefart firefart commented Jul 10, 2017

This PR changes the following:

  • Add the rebuild parameter to msfvenom
  • Add a msfvenom-dev binstub so the local directory gets mounted
  • Fix a bug in the gemspec. Currently we have no git binary in the Dockerfile but when running a *-dev binstub the local directory including the .git dir is added so we hit this if branch and ruby tries to execute git. This change searches the PATH environment variable for a git binary.

Error message before this change (run MSF_BUILD=1 msfconsole-dev):

[!] There was an error parsing `Gemfile`: 
[!] There was an error while loading `metasploit-framework.gemspec`: No such file or directory - git. Bundler cannot continue.

 #  from /usr/src/metasploit-framework/metasploit-framework.gemspec:28
 #  -------------------------------------------
 #    if File.directory?(File.join(File.dirname(__FILE__), ".git"))
 >      spec.files         = `git ls-files`.split($/).reject { |file|
 #        file =~ /^documentation|^external/
 #  -------------------------------------------
. Bundler cannot continue.

 #  from /usr/src/metasploit-framework/Gemfile:4
 #  -------------------------------------------
 #  #   spec.add_runtime_dependency '<name>', [<version requirements>]
 >  gemspec name: 'metasploit-framework'
 #  
 #  -------------------------------------------

@busterb busterb self-assigned this Jul 16, 2017
if File.directory?(File.join(File.dirname(__FILE__), ".git"))
# only do a git ls-files if the .git folder exists and we have a git binary in PATH
if File.directory?(File.join(File.dirname(__FILE__), ".git")) &&
ENV['PATH'].split(':').collect {|d| Dir.entries d if Dir.exists? d}.flatten.include?("git")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we're missing some Windows corner cases per https://stackoverflow.com/questions/2108727/which-in-ruby-checking-if-program-exists-in-path-from-ruby but I doubt people are building the metasploit gem from a stock Windows environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@busterb I pushed some changes can you please take a look again?

@busterb
Copy link
Contributor

busterb commented Jul 17, 2017

Thanks, looks good to me.

@@ -0,0 +1,21 @@
# -*- coding: binary -*-
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks for splitting this out.

@busterb busterb merged commit 3c7d6c3 into rapid7:master Jul 17, 2017
busterb pushed a commit that referenced this pull request Jul 17, 2017
@busterb
Copy link
Contributor

busterb commented Jul 17, 2017

Release Notes

The usability of Metasploit in Docker containers has been improved.

@firefart firefart deleted the docker_changes branch July 17, 2017 18:13
@alrosenthal-r7 alrosenthal-r7 added the rn-enhancement release notes enhancement label Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants