Dockerfile / Dockerfile
ductotaha's picture
Create Dockerfile
3c42293 verified
raw
history blame
3.5 kB
FROM opensecurity/mobile-security-framework-mobsf:latest
USER root
# Install sudo, apt-utils, and nano
RUN apt-get update -y > /dev/null 2>&1 && \
apt-get upgrade -y > /dev/null 2>&1 && \
apt-get install -y sudo apt-utils nano > /dev/null 2>&1 && \
apt-get install -y python3-pip > /dev/null 2>&1 && \
pip3 install --upgrade pip > /dev/null 2>&1
RUN apt install python3.10-venv -y
RUN apt-get install -y curl gnupg wget htop sudo git git-lfs software-properties-common build-essential libgl1 zip unzip > /dev/null 2>&1
RUN add-apt-repository ppa:flexiondotorg/nvtop > /dev/null 2>&1
RUN apt-get upgrade -y > /dev/null 2>&1
RUN apt-get install -y nvtop > /dev/null 2>&1
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
RUN sudo sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN apt update && apt install google-chrome-stable -y
RUN google-chrome --version
# Add mobsf user to sudoers and grant passwordless sudo
#RUN adduser mobsf
RUN echo "mobsf ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/mobsf && \
chmod 0440 /etc/sudoers.d/mobsf
# Set ownership and permissions
RUN chown -R mobsf:mobsf /var/lib/apt/lists && \
chmod -R 755 /var/lib/apt/lists
RUN chown -R mobsf:mobsf /var/cache/apt/archives/partial && \
chmod -R 755 /var/cache/apt/archives/partial
# Find and set permissions, ignoring errors
RUN find / -type d -exec chown -R mobsf:mobsf {} + > /dev/null 2>&1 || true > /dev/null 2>&1
RUN find / -type d -exec chmod -R 755 {} + > /dev/null 2>&1 || true > /dev/null 2>&1
RUN find / -type f -exec chown mobsf:mobsf {} + > /dev/null 2>&1 || true > /dev/null 2>&1
RUN find / -type f -exec chmod 777 {} + > /dev/null 2>&1 || true > /dev/null 2>&1
# Fix permissions for /etc/sudo.conf
RUN chmod 644 /etc/sudo.conf
# Disable the "no new privileges" flag for sudo
RUN echo 'Defaults !attach_warning' > /etc/sudo.conf
# Ensure sudoers.so has the correct ownership
RUN chown root:root /usr/lib/sudo/sudoers.so || true && \
chmod 644 /usr/lib/sudo/sudoers.so || true
# Set the root password (replace 'your_password' with your desired password)
RUN echo "root:your_password" | chpasswd
RUN touch ~/.bashrc || true
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1
RUN apt install nodejs -y
RUN apt install npm -y
RUN npm install -g tunnelmole > /dev/null 2>&1
# Install PHP, Apache, and MySQL
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install apache2 mysql-server php libapache2-mod-php php-mysql > /dev/null 2>&1
# PHP extensions and tools
RUN apt-get install -y php-mbstring php-xml composer > /dev/null 2>&1
# Find and set permissions, ignoring errors
RUN find /home/ -type d -exec chown -R mobsf:mobsf {} + > /dev/null 2>&1 || true > /dev/null 2>&1
RUN find /home/ -type d -exec chmod -R 755 {} + > /dev/null 2>&1 || true > /dev/null 2>&1
RUN find /home/ -type f -exec chown mobsf:mobsf {} + > /dev/null 2>&1 || true > /dev/null 2>&1
RUN find /home/ -type f -exec chmod 777 {} + > /dev/null 2>&1 || true > /dev/null 2>&1
RUN pip install selenium
RUN pip install webdriver-manager
RUN pip install undetected-chromedriver
USER mobsf
EXPOSE 8000
#ENTRYPOINT [ "/bin/sh", "-c", "exec ${OPENVSCODE_SERVER_ROOT}/bin/mobsf --host 0.0.0.0 --port 8000 --connection-token ${VS_ACCESS} \"${@}\"", "--" ]
CMD ["/home/mobsf/Mobile-Security-Framework-MobSF/scripts/entrypoint.sh"]