sekomer/Victim

Some lacks about installation commands

CihatAltiparmak opened this issue · 1 comments

Hello @sekomer ,
The installation commands run when i run installation commands on /home/cihat directory which is my home directory. When i run the installation commands on /tmp directory, i get error. But unfortunately, i cannot give you an error due to the fact that i tried long time ago. But i can talk my workings on docker image.

Firstly, the following dockerfile has seems to be working perfectly.

dockerfile1

FROM ubuntu:20.04

RUN apt update
RUN apt install openssh-server sudo -y
RUN useradd -rm -d /home/jarbay51 -s /bin/bash -g root -G sudo -u 1000 test 
RUN usermod -aG sudo test
RUN service ssh start
RUN echo 'test:test' | chpasswd

RUN apt update
RUN apt install build-essential -y
RUN apt install gdb -y

RUN apt-get update -y \
    && apt-get upgrade -y \
    && apt-get install -y git jq bc make automake libnuma-dev \
    && apt-get install -y rsync htop curl build-essential \
    && apt-get install -y pkg-config libffi-dev libgmp-dev \
    && apt-get install -y libssl-dev libtinfo-dev libsystemd-dev \
    && apt-get install -y zlib1g-dev make g++ wget libncursesw5 libtool autoconf


WORKDIR "/root"

RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
RUN git clone https://github.com/Sekomer/Victim
WORKDIR "/root/Victim"

RUN /bin/bash -c "source /root/.ghcup/env && cabal install -O2 --overwrite-policy=always"


EXPOSE 22
CMD ["/usr/sbin/sshd","-D"]

In this dockerfile, i changed the working directory before the installation commands run. After that, i run cabal install command by sourcing like source /root/.ghcup/env, otherwise, cabal is not recognised by /bin/sh. It is already suggested in ghcup installation following.

sekomer_issue

But i try this one, i get error on cabal install command.

dockerfile2

FROM ubuntu:20.04

RUN apt update
RUN apt install openssh-server sudo -y
RUN useradd -rm -d /home/jarbay51 -s /bin/bash -g root -G sudo -u 1000 test 
RUN usermod -aG sudo test
RUN service ssh start
RUN echo 'test:test' | chpasswd

RUN apt update
RUN apt install build-essential -y
RUN apt install gdb -y

RUN apt-get update -y \
    && apt-get upgrade -y \
    && apt-get install -y git jq bc make automake libnuma-dev \
    && apt-get install -y rsync htop curl build-essential \
    && apt-get install -y pkg-config libffi-dev libgmp-dev \
    && apt-get install -y libssl-dev libtinfo-dev libsystemd-dev \
    && apt-get install -y zlib1g-dev make g++ wget libncursesw5 libtool autoconf


# WORKDIR "/root"

RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
RUN git clone https://github.com/Sekomer/Victim
WORKDIR "/root/Victim"

RUN /bin/bash -c "source /root/.ghcup/env && cabal install -O2 --overwrite-policy=always"


EXPOSE 22
CMD ["/usr/sbin/sshd","-D"]

Here is error.

sekomer_issues_2

The only difference between two docrkerfile is to install ghcup in different directories. I guess, this is cause of problem.

Shortly, i'm going to create a new pull request such that the users install this project unproblematically. In addition, there will be docker option for this project.

This Dockerfile may be badly written. I leave it to the mercy of the audience :p

Thank you in advance.

hello @CihatAltiparmak,

thanks for your work, appreciated 😃