-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
175 lines (122 loc) · 5.95 KB
/
Dockerfile
File metadata and controls
175 lines (122 loc) · 5.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
FROM ubuntu:20.04
RUN sed -i 's@archive.ubuntu.com@mirror.kakao.com@g' /etc/apt/sources.list
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update --fix-missing && apt-get install -y nodejs npm aria2 curl wget virtualenvwrapper git && \
/bin/bash -c "$(curl -sL https://git.io/vokNn) " && \
apt-fast update && apt-fast -y upgrade && apt-fast update --fix-missing
###### Download Chromium ######
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN apt update -y
RUN apt-get install google-chrome-stable -y
RUN apt-fast install -y git build-essential \
libxml2-dev libxslt1-dev libffi-dev cmake libreadline-dev \
libtool debootstrap debian-archive-keyring libglib2.0-dev libpixman-1-dev \
libssl-dev qtdeclarative5-dev libcapnp-dev libtool-bin \
libsqlite3-dev autoconf re2c libonig-dev libcurl4-openssl-dev \
libcurl4-openssl-dev libpng-dev libgmp-dev libzip-dev \
python3-pip python3-pexpect ipython3 \
sudo openssh-server automake rsync net-tools netcat \
ccache make g++-multilib pkg-config coreutils rsyslog \
manpages-dev ninja-build capnproto software-properties-common zip unzip pwgen \
openssh-server mysql-server \
vim qemu gdb patchelf apache2 apache2-dev supervisor \
autoconf bison libjpeg-dev libfreetype6-dev
RUN rm -rf /var/lib/mysql
RUN /usr/sbin/mysqld --initialize-insecure
RUN mkdir /app
COPY config/supervisord.conf /etc/supervisord.conf
RUN if [ ! -d /run/sshd ]; then mkdir /run/sshd; chmod 0755 /run/sshd; fi
RUN mkdir /var/run/mysqld ; chown mysql:mysql /var/run/mysqld
COPY config/network_config.sh /netconf.sh
RUN chmod +x /netconf.sh
COPY afl /afl
RUN cd /afl && make
ENV AFL_PATH=/afl
COPY wclibs /wclibs
##################### APACHE INSTALL ##########################
RUN wget https://dlcdn.apache.org/httpd/httpd-2.4.58.tar.gz
RUN tar zxvf httpd-2.4.58.tar.gz
RUN wget https://dlcdn.apache.org//apr/apr-1.7.4.tar.gz
RUN tar zxvf apr-1.7.4.tar.gz
RUN mv apr-1.7.4 httpd-2.4.58/srclib/apr
RUN wget https://dlcdn.apache.org//apr/apr-util-1.6.3.tar.gz
RUN tar zxvf apr-util-1.6.3.tar.gz
RUN mv apr-util-1.6.3 httpd-2.4.58/srclib/apr-util
ENV CFLAGS="-DBIG_SECURITY_HOLE"
RUN cd httpd-2.4.58 && export CFLAGS && ./configure --prefix=/usr/local/apache \
--enable-rewrite \
--enable-speling \
--with-included-apr && make && make install
COPY httpd.conf /usr/local/apache/conf/httpd.conf
RUN mkdir /var/run/apache2 && chmod 777 -R /var/run/apache2
####################### LD_PRELOAD ######################
COPY /wclibs/lib_db_fault_escalator.so /lib/lib_db_fault_escalator.so
RUN rm -f /wclibs/lib_db_fault_escalator.so && \
ln -s /lib/lib_db_fault_escalator.so /lib/libcgiwrapper.so && \
ln -s /lib/lib_db_fault_escalator.so /wclibs/lib_db_fault_escalator.so
COPY php8 /phpsrc
RUN cd /phpsrc && ./buildconf --force
RUN cd /phpsrc && \
./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--enable-cgi \
--enable-ftp \
--enable-mbstring \
--enable-exif \
--enable-intl \
--enable-gd \
--with-jpeg \
--with-freetype \
--with-gettext \
--with-openssl \
--with-curl \
--with-mysql \
--with-ssl \
--with-mysqli \
--with-pdo-mysql \
--with-zlib \
--with-zip
RUN cd /phpsrc \
&& make clean && EXTRA_CFLAGS="-DWITCHER_DEBUG=1" make -j $(nproc)
RUN cd /phpsrc && make install
RUN sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf && \
sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/mysql.conf.d/mysqld.cnf
COPY config/supervisord.conf /etc/supervisord.conf
COPY config/php.ini /usr/local/lib/php.ini
RUN rm -fr /var/www/html && ln -s /app /var/www/html
### Composer install
RUN curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin/
RUN sudo ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
#### XDEBUG
COPY xdebug /xdebug
RUN cd /xdebug && phpize && ./configure --enable-xdebug && make -j $(nproc) && make install
RUN git clone https://github.com/krakjoe/uopz.git
RUN cd /uopz && phpize && ./configure --enable-uopz && make -j $(nproc) && make install
RUN mkdir /home/tmp
RUN chmod 777 -R /home/tmp
COPY hook.php /lib/hook.php
COPY config/httpreqr /tmp/httpreqr
RUN cd /tmp/httpreqr && make && mv httpreqr /
RUN printf '\nauto_prepend_file=/lib/hook.php\nextension=uopz\nuopz.exit=1\nzend_extension=/usr/local/lib/php/extensions/no-debug-zts-20220829/xdebug.so\nxdebug.mode=debug\nxdebug.start_with_request=yes\nxdebug.client_port = 9003\n\n' >> $(php -i |egrep "Loaded Configuration File.*php.ini"|cut -d ">" -f2|cut -d " " -f2)
######## WORDPRESS INSTALL ######
WORKDIR /app/
RUN wget https://ko.wordpress.org/latest-ko_KR.zip && unzip latest-ko_KR.zip
RUN mv wordpress/* ./ && rmdir wordpress
######## Install NVM , Upgrade Node version #######
ENV NVM_DIR /root/.nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
RUN . $NVM_DIR/nvm.sh && nvm install 20 && nvm use 20
######## Install Golang & GoFuzzer, CrawlerGo #######
WORKDIR /
RUN wget https://go.dev/dl/go1.21.3.linux-amd64.tar.gz
RUN rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.3.linux-amd64.tar.gz
ENV PATH=$PATH:/usr/local/go/bin
RUN git clone https://github.com/BoB-WebFuzzing/fuzzer.git && cd /fuzzer && make && npm install puppeteer
RUN git clone https://github.com/BoB-WebFuzzing/WTF-crawlergo.git && cd /WTF-crawlergo && make build
######## DASH ######
COPY dash /dash
RUN chmod 777 /dash && cp -rf /dash /bin/dash
####### FUZZER TEST #######
COPY client_test /
CMD /netconf.sh && /usr/bin/supervisord