Strange Behavior Within Docker Containers

Docker
ParrotSec
Security
msfconsole
image
execution
solution
This article discusses a problem with the ParrotSec security image in Docker, where executing `msfconsole` is not possible. The solution provided involves changing directories and running the binary from its correct location.
Published

May 29, 2024


The default directory after starting parrotsec container is the filesystem root directory, which cannot run msfconsole. Change to home directory using cd and run metasploit afterwards.

docker run --rm -it -w /root parrotsec/security

Symlinked files are not working properly from the start. Taking msfconsole for example, when running container from image parrotsec/security, it will get stuck if we immediately execute msfconsole once logged in, but we can mitigate the problem by first change into the directory where msfconsole really locates, then execute it from there.

docker run --rm -it parrotsec/security
# it will stuck
msfconsole
# note the following will also stuck
/usr/share/metasploit-framework/msfconsole
# instead let's first change directory
cd /usr/share/metasploit-framework
# then invoke the binary
./msfconsole