mazen160 / shennina

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

Memory: zsh: killed ./shennina.py #9

Open Semperfi1775 opened 1 year ago

Semperfi1775 commented 1 year ago

Hello, I've run into an issue with Shennina.
So far, It seems when running in "training mode", it uses up all my memory and kills the process.
Here I am training a metasploitable3 system.
Shennina is running on Kali inside UTM, on my M1 Mac. I've bumped the memory to 16 GB.
Once it's OOM, it kills the process.

The screenshot is not too long after the process was killed. Screenshot 2023-03-22 at 1 21 09 PM

Semperfi1775 commented 1 year ago

So, I wanted to provide an update. I’m not sure if there is continued work on this project or not. However, I was able to solve my memory issue. Maybe it'll help. Whenever I launch it in training mode; it would run for a few hours and then receive an OOM error with Python.

My setup was as follows; Mac M1, using UTM Kali VM.

So, I decided to run inside a Python Virtual Environment & install all requirements.

python3 -m venv shennina/venv source shennina/venv/bin/activate

Verison: Python 3.11.2

Installed when in venv:

┌──(venv)─(yemx㉿kali)-[~]
        python3 -m pip install matplotlib==3.4.3
    python3 -m pip install tensorflow-hub==0.12.0
    python3 -m pip install pymetasploit3
    python3 -m pip install termcolor
    python3 -m pip install python-nmap
    python3 -m pip install requests
    python3 -m pip install flask
    python3 -m pip install pandas==1.1.5
    python3 -m pip install numpydoc==0.9.1
    python3 -m pip install tensorflow-estimator==2.7.0
    python3 -m pip install tensorflow==2.12

Verified Requirements ./verify-pre-requirements.sh

Need to Install Docker

        sudo apt install docker.io
    sudo groupadd docker
    sudo usermod -aG docker $USER

Config.py default settings were fine.

Setup msfrpc sudo nano msfrpc-config.json

Msfrpc - no issues running ./run-msfrpc.py

Exfiltration Server - no issues running ./run-server.sh

Launching Shennina - when using privileged access: need to use the venv path

Which Python
┌──(venv)─(yemx㉿kali)-[~]
└─$ `which python3`
    /home/kali/shennina/venv/bin/python3

(venv)─(kali㉿kali)-[~/shennina]
└─$ `sudo /home/kali/shennina/venv/bin/python ./shennina.py --training-mode --lhost 172.17.0.2 --target 192.168.64.21 `

Then proceeded with the next phase: exploitation

1124672065 commented 4 months ago

不知道你最后结果怎么样了,有没有运行成功,我遇到的问题与你一样,无法训练,所以不能得到.h5文件这个模型文件,导致shennina.py 也无法顺利运行