Skip to content

Commit

Permalink
Merge pull request #560 from ndmalc/master
Browse files Browse the repository at this point in the history
Add setup & docker support for Cent0S 7 and Rocky Linux 8
  • Loading branch information
ChrisTruncer authored Mar 5, 2022
2 parents aec6425 + 35e7f85 commit 319c78b
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Python/Dockerfile.el7
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM centos:centos7
LABEL maintainer ???

ARG USER=eyewitness
ARG UID=1000
ARG GID=1000

ENV LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8 \
PIP_NO_CACHE_DIR=off

RUN groupadd -g $GID -r $USER && \
useradd $USER -u $UID -g $USER -m

COPY setup.sh /tmp/setup.sh

RUN yum install -y git && \
git clone --depth 1 https://github.com/FortyNorthSecurity/EyeWitness.git /home/$USER/EyeWitness && \
cp /tmp/setup.sh /home/$USER/EyeWitness/Python/setup/setup.sh && \
yum remove -y git

WORKDIR /home/$USER/EyeWitness

RUN cd Python/setup && \
./setup.sh && \
cd .. && \
chown -R $USER:$USER /home/$USER/EyeWitness && \
mkdir -p /tmp/EyeWitness && \
chown $USER:$USER /tmp/EyeWitness

USER $USER

ENTRYPOINT ["python3", "Python/EyeWitness.py", "-d", "/tmp/EyeWitness/results", "--no-prompt"]
35 changes: 35 additions & 0 deletions Python/Dockerfile.el8
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM rockylinux:8
LABEL maintainer ???

ARG USER=eyewitness
ARG UID=1000
ARG GID=1000

ENV LC_ALL=C.UTF-8 \
LANG=C.UTF-8 \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8 \
PIP_NO_CACHE_DIR=off

RUN groupadd -g $GID -r $USER && \
useradd $USER -u $UID -g $USER -m

COPY setup.sh /tmp/setup.sh

RUN dnf install -y git && \
git clone --depth 1 https://github.com/FortyNorthSecurity/EyeWitness.git /home/$USER/EyeWitness && \
cp /tmp/setup.sh /home/$USER/EyeWitness/Python/setup/setup.sh && \
dnf remove -y git

WORKDIR /home/$USER/EyeWitness

RUN cd Python/setup && \
./setup.sh && \
cd .. && \
chown -R $USER:$USER /home/$USER/EyeWitness && \
mkdir -p /tmp/EyeWitness && \
chown $USER:$USER /tmp/EyeWitness

USER $USER

ENTRYPOINT ["python3", "Python/EyeWitness.py", "-d", "/tmp/EyeWitness/results", "--no-prompt"]
109 changes: 109 additions & 0 deletions Python/setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ if [[ `cat /etc/issue | cut -d" " -f3 | head -n1 | grep "Alpine"` ]]; then
osinfo="Alpine"
fi

if [[ `cat /etc/redhat-release | grep "CentOS Linux release 7\.[0-9]\.[0-9]\+ (Core)"` ]]; then
osinfo="CentOS7"
fi

if [[ `cat /etc/redhat-release | grep "Rocky Linux release 8\.[0-9]"` ]]; then
osinfo="RockyLinux8"
fi

# make sure we run from this directory
pushd . > /dev/null && cd "$(dirname "$0")"

Expand Down Expand Up @@ -303,6 +311,107 @@ case ${osinfo} in
fi
cd ..
;;
# CentOS 7 Dependency Installation
CentOS7)
echo '[*] Installing Centos 7 Dependencies'
yum install -y python3 xorg-x11-server-Xvfb python3-pip firefox
echo
echo '[*] Installing Centos 7 Build Dependencies'
build_pkg=
for pkg_name in gcc cmake python3-devel; do
yum list installed 2>/dev/null | grep -q "^${pkg_name}\."
if [ $? -eq 1 ]; then
yum install -y ${pkg_name}
build_pkg="${build_pkg} $pkg_name"
fi
done
echo
echo '[*] Installing Python Modules'
python3 -m pip install fuzzywuzzy
python3 -m pip install selenium --upgrade
python3 -m pip install python-Levenshtein
python3 -m pip install pyvirtualdisplay
python3 -m pip install netaddr
echo
cd ../bin/
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
#curl because wget is not installed by default
curl ${geckodriver_x86_64} -LO
tar -xvf geckodriver-v0.30.0-linux64.tar.gz
rm -f geckodriver-v0.30.0-linux64.tar.gz
mv -f geckodriver /usr/sbin
if [ -e /usr/bin/geckodriver ]
then
rm -f /usr/bin/geckodriver
fi
ln -s /usr/sbin/geckodriver /usr/bin/geckodriver
else
curl ${geckodriver_x86_32} -LO
tar -xvf geckodriver-v0.30.0-linux32.tar.gz
rm -f geckodriver-v0.30.0-linux32.tar.gz
mv -f geckodriver /usr/sbin
if [ -e /usr/bin/geckodriver ]
then
rm -f /usr/bin/geckodriver
fi
ln -s /usr/sbin/geckodriver /usr/bin/geckodriver
fi
echo
echo '[*] Clean Centos 7 Install Dependencies'
yum remove -y ${build_pkg}
cd ..
;;
# Rocky Linux 8 Dependency Installation
RockyLinux8)
echo '[*] Installing Rocky Linux 8 Dependencies'
dnf install -y python3 xorg-x11-server-Xvfb python3-pip python3-netaddr firefox
echo
echo '[*] Installing Rocky Linux 8 Build Dependencies'
build_pkg=
for pkg_name in gcc cmake python3-devel; do
dnf list installed 2>/dev/null | grep -q "^${pkg_name}\."
if [ $? -eq 1 ]; then
dnf install -y ${pkg_name}
build_pkg="${build_pkg} $pkg_name"
fi
done
echo
echo '[*] Installing Python Modules'
python3 -m pip install fuzzywuzzy
python3 -m pip install selenium --upgrade
python3 -m pip install python-Levenshtein
python3 -m pip install pyvirtualdisplay
echo
cd ../bin/
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
#curl because wget is not installed by default
curl ${geckodriver_x86_64} -LO
tar -xvf geckodriver-v0.30.0-linux64.tar.gz
rm -f geckodriver-v0.30.0-linux64.tar.gz
mv -f geckodriver /usr/sbin
if [ -e /usr/bin/geckodriver ]
then
rm -f /usr/bin/geckodriver
fi
ln -s /usr/sbin/geckodriver /usr/bin/geckodriver
else
curl ${geckodriver_x86_32} -LO
tar -xvf geckodriver-v0.30.0-linux32.tar.gz
rm -f geckodriver-v0.30.0-linux32.tar.gz
mv -f geckodriver /usr/sbin
if [ -e /usr/bin/geckodriver ]
then
rm -f /usr/bin/geckodriver
fi
ln -s /usr/sbin/geckodriver /usr/bin/geckodriver
fi
echo
echo '[*] Clean Rocky Linux 8 Install Dependencies'
dnf remove -y ${build_pkg}
cd ..
;;
# Notify Manual Installation Requirement And Exit
*)
case ${distinfo} in
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ EyeWitness.exe --file C:\Path\to\urls.txt --delay [timeout in seconds] --compres
###### Supported Linux Distros:
* Kali Linux
* Debian 7+ (at least stable, looking into testing) (Thanks to @themightyshiv)
* CentOS 7
* Rocky Linux 8

**E-Mail:** EyeWitness [@] christophertruncer [dot] com

Expand Down

0 comments on commit 319c78b

Please sign in to comment.