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

Rails Error Access Denied in docker-compose run #13161

Closed
haxpak opened this issue Mar 28, 2020 · 1 comment
Closed

Rails Error Access Denied in docker-compose run #13161

haxpak opened this issue Mar 28, 2020 · 1 comment
Labels
question Questions about Metasploit Usage

Comments

@haxpak
Copy link

haxpak commented Mar 28, 2020

Steps to reproduce

How'd you do it?

  1. Fork the repo
  2. git clone github.cm/haxpak/metasploit-framework.git
  3. add upstream
  4. sudo docker-compose build
  5. sudo docker-compose run --rm --service-ports -e MSF_UID=$(id -u) -e MSF_GID=$(id -g) ms

Expected behavior

What should happen?

The metasploit docker should run succesfully

Current behavior

Starting metasploitframework_db_1 ... 
Starting metasploitframework_db_1 ... done
Rails Error: Unable to access log file. Please ensure that /home/msf/.msf4/logs/production.log exists and is writable (ie, make it writable for user and group: chmod 0664 /home/msf/.msf4/logs/production.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
Traceback (most recent call last):ork console...\
	16: from ./msfconsole:17:in `<main>'
	15: from /usr/src/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
	14: from /usr/src/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
	13: from /usr/src/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in `driver'
	12: from /usr/src/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in `new'
	11: from /usr/src/metasploit-framework/lib/msf/ui/console/driver.rb:82:in `initialize'
	10: from /usr/src/metasploit-framework/lib/msf/base/simple/framework.rb:75:in `create'
	 9: from /usr/src/metasploit-framework/lib/msf/base/simple/framework.rb:112:in `simplify'
	 8: from /usr/src/metasploit-framework/lib/msf/base/config.rb:216:in `init'
	 7: from /usr/src/metasploit-framework/lib/msf/base/config.rb:393:in `init'
	 6: from /usr/local/lib/ruby/2.6.0/fileutils.rb:200:in `mkdir_p'
	 5: from /usr/local/lib/ruby/2.6.0/fileutils.rb:200:in `each'
	 4: from /usr/local/lib/ruby/2.6.0/fileutils.rb:215:in `block in mkdir_p'
	 3: from /usr/local/lib/ruby/2.6.0/fileutils.rb:215:in `reverse_each'
	 2: from /usr/local/lib/ruby/2.6.0/fileutils.rb:217:in `block (2 levels) in mkdir_p'
	 1: from /usr/local/lib/ruby/2.6.0/fileutils.rb:239:in `fu_mkdir'
/usr/local/lib/ruby/2.6.0/fileutils.rb:239:in `mkdir': Permission denied @ dir_s_mkdir - /home/msf/.msf4/logs (Errno::EACCES)
@haxpak
Copy link
Author

haxpak commented Mar 28, 2020

Resolved

  • Figured that metasploit maps the $HOME/.msf4 folder inside the docker.
sudo chown -R $(whoami):$(whoami) /home/$(whoami)/.msf4

@haxpak haxpak closed this as completed Mar 28, 2020
@bcoles bcoles added the question Questions about Metasploit Usage label Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions about Metasploit Usage
Projects
None yet
Development

No branches or pull requests

2 participants