mazen160 / shennina

Automating Host Exploitation with AI
https://mazinahmed.net/blog/shennina-exploitation-framework/
483 stars 94 forks source link

Having difficulties with the exfiltration-server pull #10

Open relder251 opened 3 months ago

relder251 commented 3 months ago

After updating the requirements.txt document for the initial install / setup of shennina, I attempted to start the exfiltration-server, following the below steps: cd ./exfiltration-server ./run-server.sh

I am having the following issue pop up: " => ERROR [ 5/11] RUN pip3 install flask 1.4s


[ 5/11] RUN pip3 install flask:
1.087 error: externally-managed-environment
1.087
1.087 × This environment is externally managed
1.087 ╰─> 1.087 The system-wide python installation should be maintained using the system 1.087 package manager (apk) only. 1.087
1.087 If the package in question is not packaged already (and hence installable via 1.087 "apk add py3-somepackage"), please consider installing it inside a virtual 1.087 environment, e.g.: 1.087
1.087 python3 -m venv /path/to/venv 1.087 . /path/to/venv/bin/activate 1.087 pip install mypackage 1.087
1.087 To exit the virtual environment, run: 1.087
1.087 deactivate 1.087
1.087 The virtual environment is not deleted, and can be re-entered by re-sourcing 1.087 the activate file. 1.087
1.087 To automatically manage virtual environments, consider using pipx (from the 1.087 pipx package). 1.087 1.087 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. 1.087 hint: See PEP 668 for the detailed specification.

Dockerfile:7

5 | RUN apk add py-pip 6 |
7 | >>> RUN pip3 install flask 8 |
9 | WORKDIR /app

ERROR: failed to solve: process "/bin/sh -c pip3 install flask" did not complete successfully: exit code: 1 Unable to find image 'exfiltration-server:latest' locally docker: Error response from daemon: pull access denied for exfiltration-server, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. See 'docker run --help'. "

Any ideas on how I might solve this issue?

relder251 commented 3 months ago

Found the issue. The latest Alpine (v3.19) doesn't have the py-pip package. My workaround is to update the Dockerfile line 1 to: USING Alpine:3.18

fvkd commented 3 months ago

I'm getting an instruction error after changing line 1. Would you mind posting your Dockerfile contents please?

forme9 commented 3 months ago

Hi, I also encountered that access to pull docker was denied. Did you solve it?

fuzmik commented 2 weeks ago

`FROM python:3.7.17-slim-bullseye

RUN apt update
RUN apt install -y nmap bash WORKDIR /app

COPY requirements.txt . RUN ls -ah1l RUN pip3 install -U pip wheels setuptools RUN pip3 install -r requirements.txt COPY . .

EXPOSE 8040:8040 CMD python3 exfiltration-server/server.py `

fuzmik commented 2 weeks ago

install a python 3.7.17 works for me. easy way is using pyenv. as for alpine. this dockerfile works for me. `FROM alpine

RUN apk update RUN apk add python3 RUN apk add py3-pip RUN apk add py3-flask

RUN pip install flask

WORKDIR /app

COPY server.py . COPY agent.sh . COPY agent.ps1 . COPY ransomware-simulation.sh . COPY ransomware-simulation.ps1 .

USER nobody

CMD python3 server.py `