Sign inSign up

deen666/offensive-docker

By deen666

•Updated almost 5 years ago

Offensive Docker for arm64.

Image
0

310

deen666/offensive-docker repository overview

⁠Usage

You can use the docker image by the next two options:

⁠Option 1 - Use the github repository
git clone --depth 1 https://github.com/deen666/offensive-docker-arm64.git
cd offensive-docker
docker build -t offensive-docker .
docker run --rm -it --name my-offensive-docker offensive-docker /bin/zsh
⁠Option 2 - Use the image from docker hub

Use image from docker hub: deen666/offensive-docker⁠

docker pull deen666/offensive-docker
docker run --rm -it --name my-offensive-docker deen666/offensive-docker /bin/zsh
⁠Considerations to run the container

There are differents use cases for use the image and you should know how to run the container properly.

  1. Use the container to access HTB (Hack the Box) machines by HTB vpn.

     docker run --rm -it --cap-add=NET_ADMIN --device=/dev/net/tun --sysctl net.ipv6.conf.all.disable_ipv6=0 --name my-offensive-docker deen666/offensive-docker /bin/zsh
    
  2. Share information from your local directory to container directory and save information on your local directory. You should save information under /offensive directory.

     docker run --rm -it -v /path/to/local/directory:/offensive --name my-offensive-docker deen666/offensive-docker /bin/zsh
    
  3. Expose internal container services (apache, squid) for your local environment.

     docker run --rm -it --name my-offensive-docker -p 80:80 -p 3128:3128 deen666/offensive-docker /bin/zsh
    

    Inside the container start apache2 and squid services by the aliases.

     apacheUp
     squidUp
    
  4. Mount directories by umount command.

     docker run --rm -it --privileged --name my-offensive-docker deen666/offensive-docker /bin/zsh
    
  5. Tools are downloaded in /tools directory.

⁠Nice configurations

You can set up the docker image with nice configurations like as:

⁠1. Configure credentials in the docker

To use access keys, tokens or API Keys in the docker review the next repo Offensive Docker Custom⁠ (See an original version)

⁠2. Alias to connect to HTB (Hack the Box) VPN

To use both options you should use -v option to map local directoty with /offensive container directory.

⁠Option 1 - HTB VPN using github repository

Add the next line in step "Create shorcuts" in Dockerfile, build a new image and run a new container with the -v option.

RUN echo "alias vpnhtb=\"openvpn /offensive/path/to/ovpn/file\"" >> /root/.zshrc
⁠Option 2 - HTB VPN using docker hub image

Create a new Dockerfile with the next steps, build a new image and run a new container with -v option.

FROM deen666/offensive-docker

# Create a shortcut and load the ovpn file from workstation
RUN echo "alias vpnhtb=\"openvpn /offensive/path/to/ovpn/file\"" >> /root/.zshrc
⁠3. Save and load command history in your local environment

When you delete a container all information is deleted incluide command history. The next configuration provides you an option for save the command history in your local environment and load it when you run a new container. So, you wont lose your command history when run a new container.

To use both options you should use -v option to map local directoty with /offensive container directory.

⁠Option 1 - Command history using github repository

Add the next line in step "Create shorcuts" in Dockerfile, build a new image and run a new container.

# Save and load command history in your local environment
RUN sed -i '1i export HISTFILE="/history/.zsh_history"' /root/.zshrc
⁠Option 2 - Command history using docker hub image

Create a new Dockerfile with the next steps, build a new image and run a new container.

FROM deen666/offensive-docker

# Save and load command history in your local environment
RUN sed -i '1i export HISTFILE="/history/.zsh_history"' /root/.zshrc

Tag summary

Content type

Image

Digest

Size

4.7 GB

Last updated

almost 5 years ago

docker pull deen666/offensive-docker