Last active
January 26, 2020 10:20
-
-
Save tsundokul/a4a5550dd94b6ce97481957d677ef988 to your computer and use it in GitHub Desktop.
ODAT: Oracle Database Attacking Tool Dockerfile updated [Jan 26, 2020]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://github.com/quentinhardy/odat | |
# Download Oracle rpms from https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html | |
FROM debian:stretch | |
SHELL ["/bin/bash", "-cl"] | |
# Reduce output from debconf | |
env DEBIAN_FRONTEND noninteractive | |
# Install python-dev, alien and libaio1 package (for sqlplus) and some python libraries | |
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils git wget libaio1 alien build-essential dpkg-dev python3-dev python3-setuptools python3-pip ca-certificates | |
WORKDIR /tmp | |
# Generate DEB files from RPM files to install instant client basic, sdk and sqlplus | |
ADD oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm /tmp/oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm | |
ADD oracle-instantclient12.1-tools-12.1.0.2.0-1.x86_64.rpm /tmp/oracle-instantclient12.1-tools-12.1.0.2.0-1.x86_64.rpm | |
ADD oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm /tmp/oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm | |
RUN alien --to-deb oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-tools-12.1.0.2.0-1.x86_64.rpm | |
RUN dpkg -i oracle-instantclient12.1-basic_12.1.0.2.0-2_amd64.deb oracle-instantclient12.1-sqlplus_12.1.0.2.0-2_amd64.deb oracle-instantclient12.1-tools_12.1.0.2.0-2_amd64.deb | |
RUN rm *.{deb,rpm} | |
# Define Oracle env variables | |
RUN echo "export ORACLE_HOME=/usr/lib/oracle/12.1/client64" >> /etc/profile | |
RUN echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$ORACLE_HOME/lib" >> /etc/profile | |
RUN echo "export PATH=\$ORACLE_HOME/bin:\$PATH" >> /etc/profile | |
# Create the /etc/ld.so.conf.d/oracle.conf file and add the path to Oracle home | |
RUN echo "/usr/lib/oracle/12.1/client64/lib/" > /etc/ld.so.conf.d/oracle.conf | |
RUN ldconfig | |
# Install CX_Oracle | |
RUN ln -s /usr/bin/python3 /usr/bin/python | |
RUN pip3 install --upgrade pip | |
RUN pip3 install passlib cx_Oracle --no-binary :all: -i https://pypi.python.org/simple/ | |
# Install some python libraries and pyinstaller | |
RUN pip3 install colorlog termcolor pycrypto argcomplete pyinstaller scapy -i https://pypi.python.org/simple/ | |
RUN activate-global-python-argcomplete | |
# Change to /root et clone odat project | |
WORKDIR /root | |
RUN git clone https://github.com/quentinhardy/odat.git | |
WORKDIR odat | |
ENTRYPOINT ["bash", "-l"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment