python3 Ninja.py
Closed this issue · 8 comments
Traceback (most recent call last):
File "/root/Ninja/Ninja.py", line 19, in
from core import webserver
File "/root/Ninja/core/webserver.py", line 16, in
from pypykatz.pypykatz import pypykatz
File "/usr/local/lib/python3.9/dist-packages/pypykatz/pypykatz.py", line 8, in
from .commons.common import *
File "/usr/local/lib/python3.9/dist-packages/pypykatz/commons/common.py", line 10, in
from .readers.local.common.version import PROCESSOR_ARCHITECTURE
File "/usr/local/lib/python3.9/dist-packages/pypykatz/commons/readers/local/common/version.py", line 37, in
from .defines import *
File "/usr/local/lib/python3.9/dist-packages/pypykatz/commons/readers/local/common/defines.py", line 74, in
WINFUNCTYPE = ctypes.WINFUNCTYPE
AttributeError: module 'ctypes' has no attribute 'WINFUNCTYPE'
Can you show the steps in order to reproduce the error?
git clone https://github.com/ahmedkhlief/Ninja/
cd Ninja
chmod +x ./install.sh
sudo ./install.sh
python3 start_campaign.py
Urls will be used in this campaign
raw_payload='/uddigui'
b52_payload='/jboss-net'
b64_stager='/uddisoap'
b52_stager='/interface'
hjf_payload='/query'
b64_payload='/xmethods'
hjfs_payload='/default'
sct_payload='/services'
hta_payload='/inspection'
register_url='/methods'
download_url='/ws4ee'
upload_url='/uddilistener'
image_url='/svce'
command_url='/juddi'
result_url='/inquire'
modules_url='/extwsdl'
Enter a DN/IP:port for this campaign 127.0.0.1:5554
You chosed IP: 127.0.0.1and port: 5554
Enter the default beacon period ( connect back) for this campaign in seconds 30
please enter kill date for this campaign ( format dd/MM/yyyy ) ? 20/03/2047
Do you want to use SSL ? (yes/no) yes
Do you want to use default self signed SSL certificate ? (yes/no) yes
Do you want to disable donut shellcodes ( this will disable migrate command in the agents ) ? ( yes/no )
some users reported issues with donut if you have startup crash then disable it .python3 start_campaign.py
Urls will be used in this campaign
raw_payload='/uddigui'
b52_payload='/jboss-net'
b64_stager='/uddisoap'
b52_stager='/interface'
hjf_payload='/query'
b64_payload='/xmethods'
hjfs_payload='/default'
sct_payload='/services'
hta_payload='/inspection'
register_url='/methods'
download_url='/ws4ee'
upload_url='/uddilistener'
image_url='/svce'
command_url='/juddi'
result_url='/inquire'
modules_url='/extwsdl'
Enter a DN/IP:port for this campaign 127.0.0.1:5554
You chosed IP: 127.0.0.1and port: 5554
Enter the default beacon period ( connect back) for this campaign in seconds 30
please enter kill date for this campaign ( format dd/MM/yyyy ) ? 20/03/2047
Do you want to use SSL ? (yes/no) yes
Do you want to use default self signed SSL certificate ? (yes/no) yes
Do you want to disable donut shellcodes ( this will disable migrate command in the agents ) ? ( yes/no )
some users reported issues with donut if you have startup crash then disable it .
no
python3 Ninja.py
Traceback (most recent call last):
File "/root/Ninja/Ninja.py", line 6, in
from core import config
File "/root/Ninja/core/config.py", line 25
SSL=
^
SyntaxError: invalid syntax
python3 start_campaign.py 1 ⨯
Urls will be used in this campaign
raw_payload='/methods'
b52_payload='/jboss-net'
b64_stager='/operation'
b52_stager='/wsdl'
hjf_payload='/interface'
b64_payload='/atom'
hjfs_payload='/inspection'
sct_payload='/inquire'
hta_payload='/oracle'
register_url='/webserviceclient+ssl'
download_url='/uddi'
upload_url='/uddiexplorer'
image_url='/uddisoap'
command_url='/proxy'
result_url='/webservices'
modules_url='/uddilistener'
Enter a DN/IP:port for this campaign 127.0.0.1:5554
You chosed IP: 127.0.0.1and port: 5554
Enter the default beacon period ( connect back) for this campaign in seconds 100
please enter kill date for this campaign ( format dd/MM/yyyy ) ? 20/03/2047
Do you want to use SSL ? (yes/no) no
Do you want to disable donut shellcodes ( this will disable migrate command in the agents ) ? ( yes/no )
some users reported issues with donut if you have startup crash then disable it . yes
Donut will be disabled
Everything Done you can run ninja by : python3 Ninja.py
python3 Ninja.py
Traceback (most recent call last):
File "/root/Ninja/Ninja.py", line 19, in
from core import webserver
File "/root/Ninja/core/webserver.py", line 16, in
from pypykatz.pypykatz import pypykatz
File "/usr/local/lib/python3.9/dist-packages/pypykatz/pypykatz.py", line 8, in
from .commons.common import *
File "/usr/local/lib/python3.9/dist-packages/pypykatz/commons/common.py", line 10, in
from .readers.local.common.version import PROCESSOR_ARCHITECTURE
File "/usr/local/lib/python3.9/dist-packages/pypykatz/commons/readers/local/common/version.py", line 37, in
from .defines import *
File "/usr/local/lib/python3.9/dist-packages/pypykatz/commons/readers/local/common/defines.py", line 74, in
WINFUNCTYPE = ctypes.WINFUNCTYPE
AttributeError: module 'ctypes' has no attribute 'WINFUNCTYPE'
Seem like you have a dependency error...
Try running the tool from a virtual environment
python3 -m venv tutorial-env
┌──(root💀zxsec)-[~/Ninja]
└─# tutorial-env\Scripts\activate.bat
tutorial-envScriptsactivate.bat: command not found
┌──(root💀zxsec)-[~/Ninja]
└─# source tutorial-env/bin/activate 127 ⨯
┌──(tutorial-env)─(root💀zxsec)-[~/Ninja]
└─# pip show
WARNING: ERROR: Please provide a package name or names.
┌──(tutorial-env)─(root💀zxsec)-[~/Ninja]
└─# pip list 1 ⨯
Package Version
pip 20.3.4
pkg-resources 0.0.0
setuptools 44.1.1
┌──(tutorial-env)─(root💀zxsec)-[~/Ninja]
└─# pip freeze
┌──(tutorial-env)─(root💀zxsec)-[~/Ninja]
└─# pip install
ERROR: You must give at least one requirement to install (see "pip help install")
┌──(tutorial-env)─(root💀zxsec)-[~/Ninja]
└─# pip install -r requirements.txt 1 ⨯
Collecting pycrypto
Using cached pycrypto-2.6.1-cp39-cp39-linux_x86_64.whl
Collecting cheroot
Downloading cheroot-8.6.0-py2.py3-none-any.whl (104 kB)
|████████████████████████████████| 104 kB 194 kB/s
Collecting flask
Downloading Flask-2.0.2-py3-none-any.whl (95 kB)
|████████████████████████████████| 95 kB 117 kB/s
Collecting donut-shellcode==0.9.2
Using cached donut_shellcode-0.9.2-cp39-cp39-linux_x86_64.whl
Collecting pypykatz
Downloading pypykatz-0.5.2-py3-none-any.whl (422 kB)
|████████████████████████████████| 422 kB 297 kB/s
Collecting prettytable
Downloading prettytable-3.0.0-py3-none-any.whl (24 kB)
Collecting more-itertools>=2.6
Downloading more_itertools-8.12.0-py3-none-any.whl (54 kB)
|████████████████████████████████| 54 kB 102 kB/s
Collecting six>=1.11.0
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting jaraco.functools
Downloading jaraco.functools-3.5.0-py3-none-any.whl (7.0 kB)
Collecting click>=7.1.2
Downloading click-8.0.3-py3-none-any.whl (97 kB)
|████████████████████████████████| 97 kB 600 kB/s
Collecting itsdangerous>=2.0
Downloading itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Collecting Werkzeug>=2.0
Downloading Werkzeug-2.0.2-py3-none-any.whl (288 kB)
|████████████████████████████████| 288 kB 524 kB/s
Collecting Jinja2>=3.0
Downloading Jinja2-3.0.3-py3-none-any.whl (133 kB)
|████████████████████████████████| 133 kB 401 kB/s
Collecting MarkupSafe>=2.0
Downloading MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
Collecting wcwidth
Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Collecting minidump>=0.0.18
Downloading minidump-0.0.21-py3-none-any.whl (75 kB)
|████████████████████████████████| 75 kB 127 kB/s
Collecting aiosmb>=0.2.50
Downloading aiosmb-0.2.50-py3-none-any.whl (769 kB)
|████████████████████████████████| 769 kB 191 kB/s
Collecting winacl>=0.1.1
Downloading winacl-0.1.2-py3-none-any.whl (48 kB)
|████████████████████████████████| 48 kB 494 kB/s
Collecting msldap>=0.3.30
Downloading msldap-0.3.30-py3-none-any.whl (176 kB)
|████████████████████████████████| 176 kB 635 kB/s
Collecting aiowinreg>=0.0.7
Downloading aiowinreg-0.0.7-py3-none-any.whl (28 kB)
Collecting minikerberos>=0.2.14
Downloading minikerberos-0.2.14-py3-none-any.whl (127 kB)
|████████████████████████████████| 127 kB 704 kB/s
Collecting winsspi>=0.0.9
Downloading winsspi-0.0.9-py3-none-any.whl (22 kB)
Collecting colorama
Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting asn1crypto
Downloading asn1crypto-1.4.0-py2.py3-none-any.whl (104 kB)
|████████████████████████████████| 104 kB 674 kB/s
Collecting tqdm
Downloading tqdm-4.62.3-py2.py3-none-any.whl (76 kB)
|████████████████████████████████| 76 kB 562 kB/s
Collecting pycryptodomex
Downloading pycryptodomex-3.12.0-cp35-abi3-manylinux2010_x86_64.whl (2.0 MB)
|████████████████████████████████| 2.0 MB 500 kB/s
Collecting prompt-toolkit>=3.0.2
Downloading prompt_toolkit-3.0.24-py3-none-any.whl (374 kB)
|████████████████████████████████| 374 kB 709 kB/s
Collecting asysocks>=0.1.2
Downloading asysocks-0.1.2-py3-none-any.whl (47 kB)
|████████████████████████████████| 47 kB 442 kB/s
Collecting oscrypto>=1.2.1
Downloading oscrypto-1.2.1-py2.py3-none-any.whl (192 kB)
|████████████████████████████████| 192 kB 404 kB/s
Installing collected packages: asn1crypto, oscrypto, asysocks, wcwidth, minikerberos, winsspi, winacl, tqdm, six, pycryptodomex, prompt-toolkit, more-itertools, MarkupSafe, colorama, Werkzeug, msldap, minidump, Jinja2, jaraco.functools, itsdangerous, click, aiowinreg, aiosmb, pypykatz, pycrypto, prettytable, flask, donut-shellcode, cheroot
Successfully installed Jinja2-3.0.3 MarkupSafe-2.0.1 Werkzeug-2.0.2 aiosmb-0.2.50 aiowinreg-0.0.7 asn1crypto-1.4.0 asysocks-0.1.2 cheroot-8.6.0 click-8.0.3 colorama-0.4.4 donut-shellcode-0.9.2 flask-2.0.2 itsdangerous-2.0.1 jaraco.functools-3.5.0 minidump-0.0.21 minikerberos-0.2.14 more-itertools-8.12.0 msldap-0.3.30 oscrypto-1.2.1 prettytable-3.0.0 prompt-toolkit-3.0.24 pycrypto-2.6.1 pycryptodomex-3.12.0 pypykatz-0.5.2 six-1.16.0 tqdm-4.62.3 wcwidth-0.2.5 winacl-0.1.2 winsspi-0.0.9
┌──(tutorial-env)─(root💀zxsec)-[~/Ninja]
└─# python3 start_campaign.py
Urls will be used in this campaign
raw_payload='/names'
b52_payload='/juddi'
b64_stager='/default'
b52_stager='/interface'
hjf_payload='/proxy'
b64_payload='/uddigui'
hjfs_payload='/jboss-net'
sct_payload='/services'
hta_payload='/webserviceclient+ssl'
register_url='/inquiryapi'
download_url='/oracle'
upload_url='/inquire'
image_url='/uddisoap'
command_url='/manual'
result_url='/admin'
modules_url='/query'
Enter a DN/IP:port for this campaign 127.0.0.1:5554
You chosed IP: 127.0.0.1and port: 5554
Enter the default beacon period ( connect back) for this campaign in seconds 50
please enter kill date for this campaign ( format dd/MM/yyyy ) ? 20/03/2047
Do you want to use SSL ? (yes/no) yes
Do you want to use default self signed SSL certificate ? (yes/no) yes
Do you want to disable donut shellcodes ( this will disable migrate command in the agents ) ? ( yes/no )
some users reported issues with donut if you have startup crash then disable it . no
Donut will be Enabled
Everything Done you can run ninja by : python3 Ninja.py
┌──(tutorial-env)─(root💀zxsec)-[~/Ninja]
└─# python3 Ninja.py
Traceback (most recent call last):
File "/root/Ninja/Ninja.py", line 7, in
from core import webshell
File "/root/Ninja/core/webshell.py", line 1, in
import requests
ModuleNotFoundError: No module named 'requests'
┌──(tutorial-env)─(root💀zxsec)-[/Ninja]=2.0.0
└─# pip install requests 1 ⨯
Collecting requests
Downloading requests-2.27.1-py2.py3-none-any.whl (63 kB)
|████████████████████████████████| 63 kB 267 kB/s
Collecting certifi>=2017.4.17
Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
|████████████████████████████████| 149 kB 313 kB/s
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.8-py2.py3-none-any.whl (138 kB)
|████████████████████████████████| 138 kB 856 kB/s
Collecting charset-normalizer
Downloading charset_normalizer-2.0.10-py3-none-any.whl (39 kB)
Collecting idna<4,>=2.5
Downloading idna-3.3-py3-none-any.whl (61 kB)
|████████████████████████████████| 61 kB 1.3 MB/s
Installing collected packages: urllib3, idna, charset-normalizer, certifi, requests
Successfully installed certifi-2021.10.8 charset-normalizer-2.0.10 idna-3.3 requests-2.27.1 urllib3-1.26.8
┌──(tutorial-env)─(root💀zxsec)-[/Ninja]=2.0.0 in ./tutorial-env/lib/python3.9/site-packages (from requests) (2.0.10)
└─# pip3 install requests
Requirement already satisfied: requests in ./tutorial-env/lib/python3.9/site-packages (2.27.1)
Requirement already satisfied: certifi>=2017.4.17 in ./tutorial-env/lib/python3.9/site-packages (from requests) (2021.10.8)
Requirement already satisfied: charset-normalizer
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./tutorial-env/lib/python3.9/site-packages (from requests) (1.26.8)
Requirement already satisfied: idna<4,>=2.5 in ./tutorial-env/lib/python3.9/site-packages (from requests) (3.3)
┌──(tutorial-env)─(root💀zxsec)-[~/Ninja]
└─# python3 Ninja.py
Traceback (most recent call last):
File "/root/Ninja/Ninja.py", line 21, in
from core.cmd import cmd
File "/root/Ninja/core/cmd.py", line 14, in
from tabulate import tabulate
ModuleNotFoundError: No module named 'tabulate'
┌──(tutorial-env)─(root💀zxsec)-[~/Ninja]
└─# which pip 1 ⨯
/root/Ninja/tutorial-env/bin/pip
┌──(tutorial-env)─(root💀zxsec)-[~/Ninja]
└─# python3 -m pip install tabulate
Collecting tabulate
Downloading tabulate-0.8.9-py3-none-any.whl (25 kB)
Installing collected packages: tabulate
Successfully installed tabulate-0.8.9
┌──(tutorial-env)─(root💀zxsec)-[~/Ninja]
└─# python3 Ninja.py
88 88
"" ""
8888 8888
8b,dPPYba, 88 8b,dPPYba, 88 ,adPPYYba, 88 88 88
88P' "8a 88 88P'
"8a 88 "" Y8 88 88 88 88 88 88 88 88 ,adPPPPP88 88 88 88 88 88 88 88 88 88, ,88 88 88 88 88 88 88 88 88
"8bbdP"Y8 88 88
,88 8888 888888
888P"
Version 2.0
Ninja C2 | Stealthy Pwn like a Ninja
- Serving Flask app 'core.webserver' (lazy loading)
- Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead. - Debug mode: off
got it to work
Great, have fun
Thanks for your help @zAbuQasem