Giter VIP home page Giter VIP logo

katana's Introduction

Run on Repl.it Katana

John Hammond | Caleb Stewart | February 18th, 2019


Documentation: https://ctf-katana.readthedocs.io

This repository attempts to offer code and material to automate "running through the check-list" or hitting the "low-hanging fruit" in a Capture the Flag challenge. It is meant to act as a utility to help an individual do things they might otherwise forget to do.

A lot of the context and ideas from this stem from the living document at https://github.com/JohnHammond/ctf-katana

Katana is written in Python 3.

Please note that this project is not heavily maintained.

DISCLAIMER

Katana will automatically run code and do potentially "malicious" things to its target. It may throw SQL injection, it may try test for local file inclusion, uploading web shells or finding a means of remote code execution. DO NOT, by any means, run this utility against ANYTHING that you do not have explicit permission and authorization to test.

We do not claim responsibility or involvement for anything you break or any trouble you may get into by using this tool.

Getting Started

We recommend running this with the latest version of Python and inside of a virtual environment.

On Ubuntu

sudo apt update
sudo apt-get install -y python-tk tk-dev libffi-dev libssl-dev pandoc \
	libgmp3-dev libzbar-dev tesseract-ocr xsel libpoppler-cpp-dev libmpc-dev \
	libdbus-glib-1-dev ruby libenchant-2-dev apktool nodejs groff binwalk \
	foremost tcpflow poppler-utils exiftool steghide stegsnow bison ffmpeg \
	libgd-dev less

Setup

python3.7 -m venv env
source env/bin/activate
python setup.py install

If things seemed to go wrong during your installation, and you just want a clean slate, you can tear down your virtual environment and start again. Note that you will need to run python setup.py install one more time.

If you're on a very old Ubuntu distribution and had to install Python 3.7 manually, you may need to install virtualenv manually, and use virtualenv vice python3.7 -m venv like so:

pip3.7 install virtualenv
virtualenv env
source env/bin/activate

After installation, Katana will still require multiple external dependencies. The installation of each of these depends on your distribution and package manager, so an easier solution is to run Katana through Docker. You can read more about this in the docker/ directory.

Usage

Whenever Katana runs, it creates a results directory where it stores its findings and artifacts (files et. al.) that may be generated from units.

Katana will not run if the results directory already exists. You can have Katana automatically remove the results directory before it runs with the --force command-line argument.

katana --force -f "FLAG{.*?}" "RkxBR3t0aGlzX2lzX2FfYmFzZTY0X2ZsYWd9"

Known issues

ModuleNotFoundError: No module named 'colorama' -- Run pip install colorama TypeError: init() got a unexpected keyword argument 'choices_method' -- Run `pip uninstall cmd2 && pip install cmd2=="1.0.1"

Framework Methodology

Katana works with a "boss -> worker" topology. One thread (the boss) spins off other threads (the workers) and returns the results once they have all completed. Each worker is called a "unit". The unit is what actually goes about and accomplishes the task.

To add functionality to Katana, you simply need to create units. The boss will then handle them appropriately.

You can read more about it in the docs directory.

Contributing

If you would like to contribute to Katana, please see CONTRIBUTING.md

Thank You and Credits

As we got further along in development, we asked members of my Discord server if they would like to assist in creating units. The following is a list of units that were contributions from these members and their names, to offer our kudos and thank you. This project would not be what it is without your help!

crypto.dna - voidUpdate, Zwedgy
crypto.t9 - Zwedgy, r4j
esoteric.ook - Liikt
esoteric.cow - Drnkn
stego.audio_spectrogram - Zwedgy
stego.dtmf_decoder - Zwedgy
stego.whitespace - l14ck3r0x01
hash.md5 - John Kazantzis
esoteric.jsfuck - Zwedgy
crypto.playfair - voidUpdate
crypto.nato_phonetic - voidUpdate

katana's People

Contributors

asmolich avatar calebstewart avatar dimitrislk avatar dolphinphishing avatar eljeffeg avatar fdellwing avatar h4llow3en avatar henryhjung avatar jandrov avatar johnhammond avatar joshdabosh avatar mariorossi77 avatar mgp25 avatar obafgkmdh avatar qardruss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

katana's Issues

Install_Error

Hi there John!
I have this error i've tryed many times reinstall, but always the same. what i am doing wrong?
Maybe it doesnt work in python 3.8?
thanks.

katana_install_error.txt

ValueError: not enough values to unpack (expected 2, got 1)

I've checked the docs https://ctf-katana.readthedocs.io/en/latest/pdf/pdfinfo.html

When running: > sudo katana --pdfinfo pdf.pdf

INFO:matplotlib.font_manager:Could not open font file /usr/share/fonts/truetype/noto/NotoColorEmoji.ttf: In FT2Font: Could not set the fontsize
INFO:matplotlib.font_manager:generated new fontManager
Traceback (most recent call last):
  File "/usr/local/bin/katana", line 11, in <module>
    load_entry_point('katana==2.0', 'console_scripts', 'katana')()
  File "/usr/local/lib/python3.8/dist-packages/katana-2.0-py3.8.egg/katana/__main__.py", line 155, in main
    name, value = param.split("=")
ValueError: not enough values to unpack (expected 2, got 1)

What am I doing wrong? Awesome tool

Edit: I just fixed it, I thought the command line was different!

Installation is broken

Hi there, latest commit seems to have introduced a bug.

This line in requirements.txt should not have quotes, or even better update it to work with latest versions from cmd2.

cmd2=='1.0.1'

I've went ahead and fixed the conflicts from @eljeffeg PR, I've tried them locally with the basic example and it works fine.

#62

docker installation failed: Unable to locate package libenchant-dev

$ docker build -t katana .
Sending build context to Docker daemon  8.192kB
Step 1/25 : FROM python:3.8
3.8: Pulling from library/python
647acf3d48c2: Pull complete 
b02967ef0034: Pull complete 
e1ad2231829e: Pull complete 
5576ce26bf1d: Pull complete 
a66b7f31b095: Pull complete 
05189b5b2762: Pull complete 
3b0f50bca553: Pull complete 
75eb55df9bc7: Pull complete 
1f2ae3b45e17: Pull complete 
Digest: sha256:68bddbf6e88c9c88d3238e13f02edf1884fc349a0964fad4b3d44f2425791ac7
Status: Downloaded newer image for python:3.8
 ---> 67ec76d9f73b
Step 2/25 : ENV DEBIAN_FRONTEND=noninteractive
 ---> Running in 447af247bfd4
Removing intermediate container 447af247bfd4
 ---> 80b2dc2c337f
Step 3/25 : RUN apt-get update -qq      && apt-get install -y -qq python-tk tk-dev libffi-dev libssl-dev pandoc     libgmp3-dev libzbar-dev tesseract-ocr xsel libpoppler-cpp-dev libmpc-dev         libdbus-glib-1-dev ruby libenchant-dev apktool nodejs groff binwalk  foremost tcpflow poppler-utils exiftool steghide stegsnow bison ffmpeg  libgd-dev less       && apt-get clean        && rm -rf /var/lib/apt/lists/*
 ---> Running in 15dd76dee6fa
E: Unable to locate package libenchant-dev
The command '/bin/sh -c apt-get update -qq      && apt-get install -y -qq python-tk tk-dev libffi-dev libssl-dev pandoc      libgmp3-dev libzbar-dev tesseract-ocr xsel libpoppler-cpp-dev libmpc-dev        libdbus-glib-1-dev ruby libenchant-dev apktool nodejs groff binwalk  foremost tcpflow poppler-utils exiftool steghide stegsnow bison ffmpeg  libgd-dev less       && apt-get clean        && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

No module named 'colorama' when try to run docker

As John mentioned in his video katana is 'infrequently maintained' and if I'm reading correctly the most recent update was 2 years ago. However, I hoped that someone may still be able to assist. EVen if only some of the functionality works I'd be interested to see it in action. I installed Linux for the first time this week and installed docker for the first time today so I may well be doing something simple wrong!

I used 'git clone [address]' to clone the project, I ran from my home directory. I went into katana/docker and ran 'docker build -t katana .'

I then ran the below in my home directory and I have a subdirectory called data, currently empty.

└─$ docker run -v $(pwd)/data:/data -it katana
[+] checking for updates
[+] katana is up to date!
Traceback (most recent call last):
File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/katana/katana/main.py", line 10, in
from katana.repl import Repl, ReplMonitor
File "/katana/katana/repl/init.py", line 20, in
from colorama import Fore, Style
ModuleNotFoundError: No module named 'colorama'

I searched around and believe I know how I would fix this error (pip install colorama) if this was coming up outside docker. However, I wasn't sure how to diagnose a message "within" docker

EXCEPTION of type 'KeyError'

Hello, everytime i run katana i gen an error
EXCEPTION of type 'KeyError' occurred with message: ''solutions'' (verbose version below)
Thought it was a fault with the installation because I had messed around with it quite a bit so i reinstalled my OS and installed it exactly according to the instructions and still get the same error. Any ideas why this is happening?

katana - running - 1576 units queued 
➜ Traceback (most recent call last):
  File "(/home/.../katana/env/lib/python3.8/site-packages/katana-2.0-py3.8.egg/katana/manager.py", line 687, in _thread
    work.unit.evaluate(case)
  File "/home/.../katana/env/lib/python3.8/site-packages/katana-2.0-py3.8.egg/katana/units/crypto/quipqiup.py", line 108, in evaluate
    for sol in j["solutions"]:
KeyError: 'solutions'
EXCEPTION of type 'KeyError' occurred with message: ''solutions''

Kind regards

[BUG] `ctf queue` does not start solving

What is this?

  • Feature
  • Bug
  • Improvement

Please describe the issue
When running ctf queue first-grep--part-ii-485b43c nothing happens. The command is ran, but the CLI says 0 units queued. After waiting for 5 minutes nothing happens.

In case of bug, what is supposed to happen?
The command is ran successfully, and katana starts working. Hopefully managing to extract the flag.

If possible, what CTF and/or task are you trying it on?
PicoCTF, First Grep: Part II

Output of python -v in virtualenv
Python 3.7.5

Version of katana
The one where this was the latest commit.

Did you follow the instructions to install?
Yes

Anything else?
I am running katana in the virtualenv using python -m katana -c configs/picoctf.ini --force.

My config file looks like this:

[DEFAULT]
download=yes

[manager]
flag-format=picoCTF{.*?}

[ctf]
provider=pico
url=https://2019game.picoctf.com
username=[REDACTED]
password=[REDACTED]
auto-submit=yes

It is basically a copy of your example in your walkthrough.

I am running this in WSL.

I have ran this on other challenges where it worked.

CTF Authentication Timeout

The ctfd provider doesn't currently handle session timeouts properly, and results in JSON exceptions. The provider should recognize the timeout and attempt re-authentication, however it doesn't. I can probably wrap this into the generic CTFProvider interface by raising an authentication exception in the individual providers and having the base CTFProvider retry authentication appropriately.

This may also propagate to the pico provider as well. I haven't looked into it yet.

TypeError: __init__() got an unexpected keyword argument 'choices_method'

Hey guys, got this error. Any insight?

(env) petros@DESKTOP-6MF9LET:~/katana$ katana
Traceback (most recent call last):
File "/home/petros/katana/env/bin/katana", line 33, in
sys.exit(load_entry_point('katana==2.0', 'console_scripts', 'katana')())
File "/home/petros/katana/env/bin/katana", line 25, in importlib_load_entry_point
return next(matches).load()
File "/home/petros/katana/env/lib/python3.7/site-packages/importlib_metadata-4.12.0-py3.7.egg/importlib_metadata/init.py", line 203, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/petros/katana/env/lib/python3.7/site-packages/katana-2.0-py3.7.egg/katana/main.py", line 10, in
from katana.repl import Repl, ReplMonitor
File "/home/petros/katana/env/lib/python3.7/site-packages/katana-2.0-py3.7.egg/katana/repl/init.py", line 301, in
class Repl(cmd2.Cmd):
File "/home/petros/katana/env/lib/python3.7/site-packages/katana-2.0-py3.7.egg/katana/repl/init.py", line 591, in Repl
choices_method=get_monitor_choices,
File "/home/petros/katana/env/lib/python3.7/site-packages/cmd2-2.4.1-py3.7.egg/cmd2/argparse_custom.py", line 866, in _add_argument_wrapper
new_arg = orig_actions_container_add_argument(self, *args, **kwargs)
File "/usr/lib/python3.7/argparse.py", line 1368, in add_argument
action = action_class(**kwargs)
TypeError: init() got an unexpected keyword argument 'choices_method'

when i try to compile in ubuntu i get this error

Running pdftotext-2.1.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-viqui05x/pdftotext-2.1.5/egg-dist-tmp-gwl5jj4i
/usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
pdftotext.cpp:1:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

can someone please help me when i try to use python3 install setup.py it runs and always stops at this place can anyone please help me with this

EXCEPTION of type 'KeyError' occurred with message: ''solutions''

katana --force -f "X-MAS{.*?}" "MkVUTThoak44TlROOGR6TThaak44TlROOGR6TThWRE14d0hPMnczTTF3M056d25OMnczTTF3M056d1hPNXdITzJ3M00xdzNOenduTjJ3M00xdzNOendYTndFRGY0WURmelVEZjNNRGYyWURmelVEZjNNRGYwRVRNOGhqTjhOVE44ZHpNOFpqTjhOVE44ZHpNOEZETXh3SE8ydzNNMXczTnp3bk4ydzNNMXczTnp3bk13RURmNFlEZnpVRGYzTURmMllEZnpVRGYzTURmeUlUTThoak44TlROOGR6TThaak44TlROOGR6TThCVE14d0hPMnczTTF3M056d25OMnczTTF3M056dzNOeEVEZjRZRGZ6VURmM01EZjJZRGZ6VURmM01EZjFBVE04aGpOOE5UTjhkek04WmpOOE5UTjhkek04bFRPOGhqTjhOVE44ZHpNOFpqTjhOVE44ZHpNOGRUTzhoak44TlROOGR6TThaak44TlROOGR6TThSVE14d0hPMnczTTF3M056d25OMnczTTF3M056d1hPNXdITzJ3M00xdzNOenduTjJ3M00xdzNOenduTXlFRGY0WURmelVEZjNNRGYyWURmelVEZjNNRGYzRVRNOGhqTjhOVE44ZHpNOFpqTjhOVE44ZHpNOGhETjhoak44TlROOGR6TThaak44TlROOGR6TThGak14d0hPMnczTTF3M056d25OMnczTTF3M056d25NeUVEZjRZRGZ6VURmM01EZjJZRGZ6VURmM01EZjFFVE04aGpOOE5UTjhkek04WmpOOE5UTjhkek04RkRNeHdITzJ3M00xdzNOenduTjJ3M00xdzNOendITndFRGY0WURmelVEZjNNRGYyWURmelVEZjNNRGYxRVRNOGhqTjhOVE44ZHpNOFpqTjhOVE44ZHpNOFZETXh3SE8ydzNNMXczTnp3bk4ydzNNMXczTnp3WE94RURmNFlEZnpVRGYzTURmMllEZnpVRGYzTURmeUlUTThoak44TlROOGR6TThaak44TlROOGR6TThkVE84aGpOOE5UTjhkek04WmpOOE5UTjhkek04WlRNeHdITzJ3M00xdzNOenduTjJ3M00xdzNOendITXhFRGY0WURmelVEZjNNRGYyWURmelVEZjNNRGYza0RmNFlEZnpVRGYzTURmMllEZnpVRGYzTURmMUVUTTAwMDBERVRDQURFUg=="

Output:
katana - running - 3167 units queued
➜ Traceback (most recent call last):
File "/home/ratel/katana/env/lib/python3.7/site-packages/katana-2.0-py3.7.egg/katana/manager.py", line 687, in _thread
work.unit.evaluate(case)
File "/home/ratel/katana/env/lib/python3.7/site-packages/katana-2.0-py3.7.egg/katana/units/crypto/quipqiup.py", line 108, in evaluate
for sol in j["solutions"]:
KeyError: 'solutions'
EXCEPTION of type 'KeyError' occurred with message: ''solutions''

error when run katana --force -f "FLAG{.*?}" "RkxBR3t0aGlzX2lzX2FfYmFzZTY0X2ZsYWd9"

Traceback (most recent call last):
File "/home/kali/katana/env/bin/katana", line 6, in
from pkg_resources import load_entry_point
File "/home/kali/katana/env/lib/python3.9/site-packages/pkg_resources/init.py", line 3252, in
def _initialize_master_working_set():
File "/home/kali/katana/env/lib/python3.9/site-packages/pkg_resources/init.py", line 3235, in _call_aside
f(*args, **kwargs)
File "/home/kali/katana/env/lib/python3.9/site-packages/pkg_resources/init.py", line 3264, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/home/kali/katana/env/lib/python3.9/site-packages/pkg_resources/init.py", line 583, in _build_master
ws.require(requires)
File "/home/kali/katana/env/lib/python3.9/site-packages/pkg_resources/init.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/home/kali/katana/env/lib/python3.9/site-packages/pkg_resources/init.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pytesseract' distribution was not found and is required by katana

can't access docker ...

I create docker image of katana but i can't access it...

(base) ┌─[root@parrot]─[/home/mayomacam/Videos/tool/katana]
└──╼ #docker images
REPOSITORY   TAG       IMAGE ID       CREATED             SIZE
katana       latest    9cc4dabcf59c   About an hour ago   2.29GB
python       3.8       b0358f6298cd   3 days ago          882MB
(base) ┌─[root@parrot]─[/home/mayomacam/Videos/tool/katana]
└──╼ #docker run -it katana
[+] checking for updates
[+] katana is up to date!
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/katana/katana/__main__.py", line 175, in <module>
    main()
  File "/katana/katana/__main__.py", line 36, in main
    manager = Manager(monitor=monitor, config_path=args.config)
  File "/katana/katana/manager.py", line 99, in __init__
    raise RuntimeError("{0}: configuration file not found")
RuntimeError: {0}: configuration file not found

i edit the docker run command above

(base) ┌─[✗]─[root@parrot]─[/home/mayomacam/Videos/tool/katana]
└──╼ #docker run -v "$(CTF_DIRECTORY):data" -it katana
CTF_DIRECTORY: command not found
[+] checking for updates
[+] katana is up to date!
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/katana/katana/__main__.py", line 175, in <module>
    main()
  File "/katana/katana/__main__.py", line 36, in main
    manager = Manager(monitor=monitor, config_path=args.config)
  File "/katana/katana/manager.py", line 99, in __init__
    raise RuntimeError("{0}: configuration file not found")
RuntimeError: {0}: configuration file not found

Too many open files

image
image

Katana keeps throwing these errors, but its running on only 4 files.

System info:
Kali 2021.4
Python 3.9.10
Terminal: xterm-256color
Shell: zsh

ERROR [ 3/22] RUN gem install rdoc --no-document

Hi, I when I try to build the docker image, got this error, on my m1 chip macOS

 => ERROR [ 3/22] RUN gem install rdoc --no-document                                                        1.3s
------                                                                                                           
 > [ 3/22] RUN gem install rdoc --no-document:                                                                   
#7 1.277 Building native extensions. This could take a while...                                                  
#7 1.318 ERROR:  Error installing rdoc:                                                                          
#7 1.318        ERROR: Failed to build gem native extension.                                                     
#7 1.318                                                                                                         
#7 1.318     current directory: /var/lib/gems/2.7.0/gems/psych-4.0.5/ext/psych
#7 1.318 /usr/bin/ruby2.7 -I /usr/lib/ruby/vendor_ruby -r ./siteconf20220922-7-b1g1wo.rb extconf.rb
#7 1.318 mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
#7 1.318 
#7 1.318 You might have to install separate package for the ruby development
#7 1.318 environment, ruby-dev or ruby-devel for example.
#7 1.318 
#7 1.318 extconf failed, exit code 1
#7 1.318 
#7 1.318 Gem files will remain installed in /var/lib/gems/2.7.0/gems/psych-4.0.5 for inspection.
#7 1.318 Results logged to /var/lib/gems/2.7.0/extensions/aarch64-linux/2.7.0/psych-4.0.5/gem_make.out
------
executor failed running [/bin/sh -c gem install rdoc --no-document]: exit code: 1

Installation instructions for arch linux are missing

Installation instructions for dependencies are missing for arch linux, here are the packages required to match dependencies :

pacman -S --needed tk libffi openssl pandoc gmp \ 
zbar tesseract xsel poppler libmpc \
dbus-glib ruby enchant nodejs groff \ 
binwalk foremost tcpflow perl-image-exiftool \
bison ffmpeg less gd

yay android-apktool steghide stegsnow

sword thing no worky

hi ma'am,

How do i use???? When i throw into powershell the sword no cut through CTF challngeds. me thought this solved challenges for me!!!

please advise!!!!

A TypeError occurred in "OutputChannelDefine.py": argument 1 must be string,

A TypeError occurred in "OutputChannelDefine.py": argument 1 must be string, not None root 2022-03-18T10:04:08
Traceback (most recent call last):
File "Widgets/SortableParams.py", line 40, in __menuAction
File "OutputChannelDefine.py", line 669, in AddGroup
TypeError: argument 1 must be string, not None

this error is coming when using the (PrmanOutputChannelDefine) for katana Renderman in windows

Please change requirements.txt to include the following

Hi there,

Please change requirements.txt to include:

cmd2==1.0.1
pillow
image
colorama

This helps in fixing some issues during installation.

Also... If you want npiet support, I made a pull request on the npiet repo for newer distro's that can't compile with sys/malloc.h causing issues during c compilation. sys/malloc.h has been deprecated and obsoleted in favor of stdlib.h in newer distro's. Which is already imported by npiet.

Simply remove the include to malloc.h inside the two c and y files and it should compile on modern distributions.

This might also help in fixing these issues inside the Dockerfile.
If you want I can make a pull request for the requirements.txt, but it's not a big issue I suppose.

enchant.errors.DictNotFoundError: Dictionary for language 'zh_CN' could not be found

root@katana:/opt/katana/docker# pip install pyenchant
/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
from cryptography.utils import int_from_bytes
/usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
from cryptography.utils import int_from_bytes
Requirement already satisfied: pyenchant in /usr/local/lib/python3.8/dist-packages/pyenchant-3.2.1-py3.8.egg (3.2.1)
root@katana:/opt/katana/docker# python3 -m katana -c /data/katana.ini -m monitor=/data/targets,outdir=/data/results
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.8/runpy.py", line 144, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/usr/local/lib/python3.8/dist-packages/katana-2.0-py3.8.egg/katana/init.py", line 7, in
import katana.manager
File "/usr/local/lib/python3.8/dist-packages/katana-2.0-py3.8.egg/katana/manager.py", line 18, in
from katana.target import Target, BadTarget
File "/usr/local/lib/python3.8/dist-packages/katana-2.0-py3.8.egg/katana/target.py", line 41, in
DICTIONARY = enchant.Dict()
File "/usr/local/lib/python3.8/dist-packages/pyenchant-3.2.1-py3.8.egg/enchant/init.py", line 542, in init
super().init()
File "/usr/local/lib/python3.8/dist-packages/pyenchant-3.2.1-py3.8.egg/enchant/init.py", line 144, in init
self._init_this()
File "/usr/local/lib/python3.8/dist-packages/pyenchant-3.2.1-py3.8.egg/enchant/init.py", line 549, in _init_this
this = self._broker._request_dict_data(self.tag)
File "/usr/local/lib/python3.8/dist-packages/pyenchant-3.2.1-py3.8.egg/enchant/init.py", line 287, in _request_dict_data
self._raise_error(e_str % (tag,), DictNotFoundError)
File "/usr/local/lib/python3.8/dist-packages/pyenchant-3.2.1-py3.8.egg/enchant/init.py", line 233, in _raise_error
raise eclass(default)
enchant.errors.DictNotFoundError: Dictionary for language 'zh_CN' could not be found
Please check https://pyenchant.github.io/pyenchant/ for details
root@katana:/opt/katana/docker#

when i run katana ,there have an error is about dbus

i have run it in ubuntu 16.04,python 3.7
i have install python-dbus
but still have error

Traceback (most recent call last):
File "/ctf/katana/env/bin/katana", line 11, in
load_entry_point('katana==2.0', 'console_scripts', 'katana')()
File "/ctf/katana/env/lib/python3.7/site-packages/pkg_resources/init.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/ctf/katana/env/lib/python3.7/site-packages/pkg_resources/init.py", line 2852, in load_entry_point
return ep.load()
File "/ctf/katana/env/lib/python3.7/site-packages/pkg_resources/init.py", line 2443, in load
return self.resolve()
File "/ctf/katana/env/lib/python3.7/site-packages/pkg_resources/init.py", line 2449, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/ctf/katana/env/lib/python3.7/site-packages/katana-2.0-py3.7.egg/katana/main.py", line 10, in
from katana.repl import Repl, ReplMonitor
File "/ctf/katana/env/lib/python3.7/site-packages/katana-2.0-py3.7.egg/katana/repl/init.py", line 12, in
import notify2
File "/ctf/katana/env/lib/python3.7/site-packages/notify2-0.3.1-py3.7.egg/notify2.py", line 39, in
import dbus
File "/usr/lib/python3/dist-packages/dbus/init.py", line 82, in
import dbus.types as types
File "/usr/lib/python3/dist-packages/dbus/types.py", line 6, in
from _dbus_bindings import (
ModuleNotFoundError: No module named '_dbus_bindings'

error with installation

Kali on virtualbox
on env install

Operation not permitted: 'lib' -> lib64

python 3.7.6
Thanks !

Issue with installing dependencies

Hello,
Im having an issue installing dependencies for katana. it keeps getting stuck after python setup.py install comman. It will run for a brief moment then stop at Reading https://pypi.org/simple/watchdog/ . i tried this install on my Ubuntu vm and it did the same thing. has anyone found a fix or have had this issue?
issue

Error use (how can i do plz?) thks

Traceback (most recent call last):
File "/home/ubuntu/Katana/bin/katana", line 11, in
load_entry_point('katana', 'console_scripts', 'katana')()
File "/home/ubuntu/Katana/lib/python3.8/site-packages/pkg_resources/init.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/ubuntu/Katana/lib/python3.8/site-packages/pkg_resources/init.py", line 2852, in load_entry_point
return ep.load()
File "/home/ubuntu/Katana/lib/python3.8/site-packages/pkg_resources/init.py", line 2443, in load
return self.resolve()
File "/home/ubuntu/Katana/lib/python3.8/site-packages/pkg_resources/init.py", line 2449, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/home/ubuntu/Katana/katana.py", line 4, in
import urllib2
ModuleNotFoundError: No module named 'urllib2'

TypeError: __init__() got an unexpected keyword argument 'choices_method'

➜ katana git:(master) katana
Traceback (most recent call last):
File "/usr/local/bin/katana", line 11, in
load_entry_point('katana==2.0', 'console_scripts', 'katana')()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python3.8/dist-packages/katana-2.0-py3.8.egg/katana/main.py", line 10, in
from katana.repl import Repl, ReplMonitor
File "/usr/local/lib/python3.8/dist-packages/katana-2.0-py3.8.egg/katana/repl/init.py", line 301, in
class Repl(cmd2.Cmd):
File "/usr/local/lib/python3.8/dist-packages/katana-2.0-py3.8.egg/katana/repl/init.py", line 587, in Repl
monitor_remove_parser.add_argument(
File "/usr/local/lib/python3.8/dist-packages/cmd2-2.1.1-py3.8.egg/cmd2/argparse_custom.py", line 562, in _add_argument_wrapper
new_arg = orig_actions_container_add_argument(self, *args, **kwargs)
File "/usr/lib/python3.8/argparse.py", line 1380, in add_argument
action = action_class(**kwargs)
TypeError: init() got an unexpected keyword argument 'choices_method'

'os' has no attribute 'sched_getaffinity'

It would be nice if in the manager.py there was an exception value for threads as os.sched_getaffinity is not available on all nix systems. I'm running macOS for example and this fails. If I set it to a static value, it runs fine.

  File "/Users/Jeff/Documents/workspace/katana/env/bin/katana", line 11, in <module>
    load_entry_point('katana==2.0', 'console_scripts', 'katana')()
  File "/Users/Jeff/Documents/workspace/katana/env/lib/python3.7/site-packages/katana-2.0-py3.7.egg/katana/__main__.py", line 36, in main
    manager = Manager(monitor=monitor, config_path=args.config)
  File "/Users/Jeff/Documents/workspace/katana/env/lib/python3.7/site-packages/katana-2.0-py3.7.egg/katana/manager.py", line 70, in __init__
    "threads": len(os.sched_getaffinity(0)),
AttributeError: module 'os' has no attribute 'sched_getaffinity'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.