Skip to content

Commit

Permalink
Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxsoft committed Jan 20, 2019
1 parent 441e83c commit 4567d1f
Show file tree
Hide file tree
Showing 8 changed files with 35,355 additions and 11 deletions.
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM alpine

ENV LANG=zh_CN.UTF-8 \
LC_ALL=zh_CN.UTF-8 \
DISPLAY=:99

COPY docker-items/d99net.reg /tmp/d99net.reg
COPY docker-items/override.reg /tmp/override.reg
COPY docker-items/run-xvfb /usr/local/bin/run-xvfb

RUN echo "x86" > /etc/apk/arch && \
chmod +x /usr/local/bin/run-xvfb && \
apk add --no-cache wine xvfb wget unzip ncurses-libs cabextract

RUN WINEARCH=win32 wine wineboot && \
wine regedit.exe /s /tmp/d99net.reg && \
wine regedit.exe /s /tmp/override.reg && \
mkdir /tmp/mdac && \
wget https://download.microsoft.com/download/4/a/a/4aafff19-9d21-4d35-ae81-02c48dcbbbff/MDAC_TYP.EXE -O /tmp/mdac/mdac.exe && \
cd /tmp/mdac && cabextract mdac.exe && cabextract *.cab && rm -rf *.cab && cp * /root/.wine/drive_c/windows/system32/ && \
# for unknown reason `regsvr32` run under Dockerfile and /bin/sh will make different results...
# So that i directly copied ``system.reg``
rm -rf /tmp/mdac && cd /

ENV WEBSHELLKILL_URL=http://d99net.net/down/WebShellKill_V2.0.9.zip \
VERSION_DLL=https://github.com/zsxsoft/webshellkill-cli/releases/download/0.0.2/Version.dll \
DISPLAY=:99

COPY docker-items/run.sh /usr/local/bin/webshellkill
# This system.reg is generated by
# cd /tmp/mdac && for i in *.dll; do wine regsvr32 "c:\\windows\\system32\\$i"; echo $i; done
COPY docker-items/system.reg /root/.wine/system.reg

RUN wget $WEBSHELLKILL_URL -O /root/webshellkill.zip && \
wget $VERSION_DLL -O /root/version.dll && \
echo 'Unzipping WebShellKill ...' && \
cd /root && LC_ALL=zh_CN.UTF-8 unzip /root/webshellkill.zip && \
rm /root/webshellkill.zip && \
chmod +x /usr/local/bin/webshellkill

ENTRYPOINT webshellkill
4 changes: 4 additions & 0 deletions HookDLL/cpp.hint
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// 提示文件帮助 Visual Studio IDE 解释 Visual C++ 标识符,
// 如函数和宏的名称。
// 有关详细信息,请参见 https://go.microsoft.com/fwlink/?linkid=865984
#define WM_ENABLE
Binary file added docker-items/d99net.reg
Binary file not shown.
Binary file added docker-items/override.reg
Binary file not shown.
2 changes: 2 additions & 0 deletions docker-items/run-xvfb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
nohup /usr/bin/Xvfb :99 -screen 0 1280x720x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
6 changes: 6 additions & 0 deletions docker-items/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
export LC_CTYPE=zh_CN.UTF-8
export WINEDEBUG=-all
export DISPLAY=:99
nohup /usr/bin/Xvfb :99 -screen 0 1280x720x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
wine /root/WebShellKill.exe $@ | iconv -f GBK -t UTF8
Loading

0 comments on commit 4567d1f

Please sign in to comment.