ductotaha commited on
Commit
3c42293
·
verified ·
1 Parent(s): 45ad6dc

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +84 -0
Dockerfile ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM opensecurity/mobile-security-framework-mobsf:latest
2
+
3
+ USER root
4
+
5
+ # Install sudo, apt-utils, and nano
6
+ RUN apt-get update -y > /dev/null 2>&1 && \
7
+ apt-get upgrade -y > /dev/null 2>&1 && \
8
+ apt-get install -y sudo apt-utils nano > /dev/null 2>&1 && \
9
+ apt-get install -y python3-pip > /dev/null 2>&1 && \
10
+ pip3 install --upgrade pip > /dev/null 2>&1
11
+ RUN apt install python3.10-venv -y
12
+ 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
13
+
14
+ RUN add-apt-repository ppa:flexiondotorg/nvtop > /dev/null 2>&1
15
+ RUN apt-get upgrade -y > /dev/null 2>&1
16
+ RUN apt-get install -y nvtop > /dev/null 2>&1
17
+
18
+ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
19
+ RUN sudo sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
20
+ RUN apt update && apt install google-chrome-stable -y
21
+ RUN google-chrome --version
22
+
23
+ # Add mobsf user to sudoers and grant passwordless sudo
24
+ #RUN adduser mobsf
25
+ RUN echo "mobsf ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/mobsf && \
26
+ chmod 0440 /etc/sudoers.d/mobsf
27
+
28
+ # Set ownership and permissions
29
+ RUN chown -R mobsf:mobsf /var/lib/apt/lists && \
30
+ chmod -R 755 /var/lib/apt/lists
31
+
32
+ RUN chown -R mobsf:mobsf /var/cache/apt/archives/partial && \
33
+ chmod -R 755 /var/cache/apt/archives/partial
34
+
35
+ # Find and set permissions, ignoring errors
36
+ RUN find / -type d -exec chown -R mobsf:mobsf {} + > /dev/null 2>&1 || true > /dev/null 2>&1
37
+ RUN find / -type d -exec chmod -R 755 {} + > /dev/null 2>&1 || true > /dev/null 2>&1
38
+ RUN find / -type f -exec chown mobsf:mobsf {} + > /dev/null 2>&1 || true > /dev/null 2>&1
39
+ RUN find / -type f -exec chmod 777 {} + > /dev/null 2>&1 || true > /dev/null 2>&1
40
+
41
+ # Fix permissions for /etc/sudo.conf
42
+ RUN chmod 644 /etc/sudo.conf
43
+
44
+ # Disable the "no new privileges" flag for sudo
45
+ RUN echo 'Defaults !attach_warning' > /etc/sudo.conf
46
+
47
+ # Ensure sudoers.so has the correct ownership
48
+ RUN chown root:root /usr/lib/sudo/sudoers.so || true && \
49
+ chmod 644 /usr/lib/sudo/sudoers.so || true
50
+
51
+ # Set the root password (replace 'your_password' with your desired password)
52
+ RUN echo "root:your_password" | chpasswd
53
+
54
+ RUN touch ~/.bashrc || true
55
+ RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash > /dev/null 2>&1
56
+ RUN apt install nodejs -y
57
+ RUN apt install npm -y
58
+
59
+ RUN npm install -g tunnelmole > /dev/null 2>&1
60
+
61
+ # Install PHP, Apache, and MySQL
62
+ RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install apache2 mysql-server php libapache2-mod-php php-mysql > /dev/null 2>&1
63
+
64
+ # PHP extensions and tools
65
+ RUN apt-get install -y php-mbstring php-xml composer > /dev/null 2>&1
66
+
67
+
68
+ # Find and set permissions, ignoring errors
69
+ RUN find /home/ -type d -exec chown -R mobsf:mobsf {} + > /dev/null 2>&1 || true > /dev/null 2>&1
70
+ RUN find /home/ -type d -exec chmod -R 755 {} + > /dev/null 2>&1 || true > /dev/null 2>&1
71
+ RUN find /home/ -type f -exec chown mobsf:mobsf {} + > /dev/null 2>&1 || true > /dev/null 2>&1
72
+ RUN find /home/ -type f -exec chmod 777 {} + > /dev/null 2>&1 || true > /dev/null 2>&1
73
+
74
+
75
+ RUN pip install selenium
76
+ RUN pip install webdriver-manager
77
+ RUN pip install undetected-chromedriver
78
+
79
+ USER mobsf
80
+
81
+ EXPOSE 8000
82
+
83
+ #ENTRYPOINT [ "/bin/sh", "-c", "exec ${OPENVSCODE_SERVER_ROOT}/bin/mobsf --host 0.0.0.0 --port 8000 --connection-token ${VS_ACCESS} \"${@}\"", "--" ]
84
+ CMD ["/home/mobsf/Mobile-Security-Framework-MobSF/scripts/entrypoint.sh"]