Our IT/Blog

[Solved] Katoolin for Ubuntu 20.04
Katoolin for Ubuntu 19.10

Written by Derrick Thomas

Derrick Thomas is a Network\Security Engineer with years of experience solving issues for International Companies as well as home users. He has performed both Red Team and Blue Team exercises for his clients in the Healthcare and Defense fields.

February 17, 2020

Many of us would like the stability of Ubuntu with the tools of Kali Linux. However, there are slight issues when running on Ubuntu 19.10. Below we will address how to get Katoolin to run on Ubuntu 18 and Ubuntu 19.

We Love the Update….. But it’s causing problems.

Katoolin Not Running on Ubuntu 19.10…

Simply put, Katoolin was written in Python2, but your Ubuntu installation comes default with Python3.

You might be asking, “Can’t I just install Python2 and run Katoolin!?” YES! You can.

But if you are willing to make a couple changes to the code (Literally 2 changes) then you can keep Python3 and run Katoolin. Don’t worry, it is real easy….

The Easy Way.

  1. You can download the modified file and unzip them to your home directory and run without making any changes to the code. I have done the hard work for you. (I know sometimes you just want to get something running…)

[wpdm_package id=’2326′]

Steps to mod Katoolin yourself

Print Issue Fix

Error Code you will receive:

File “katoolin.py”, line 8 print “sorry. This script requires sudo privledges”

SyntaxError: Missing parentheses in call to ‘print’. Did you mean print(“Sorry. This script requires sudo privledges”)?

Print in python2 only requires ” ” to print. Python3 Requires (). (Yes the answer is in the error….)

  1. Download Katoolin if you haven’t already from this location. Follow the instructions on the Github page. Katoolin
  2. Open your favorite text editor. I use Atom. Download here and open up your Katoolin.py file. Likely located in /home/katoolin/ if you have used the lionsec tutorial to install katoolin.
  3. Go to Line 8
Problem is located here on Line 8!

3. Simply change the code from “Sorry. This script requires sudo privleges” to (“Sorry. This script requires sudo privileges”)

4. Save the document. That will fix your Print Error.

Fix The Raw_Input Error

Python3 doesn’t use raw_input…..
  1. With your text editor still open, press CTRL + F
  2. In the Find type: raw_input
  3. In the Replace type: input

4. Then click Replace all. Doing this will locate all instances of raw_input and replace it with input.

That’s it! Save the document.

Running Katoolin

1 . Change directorys in Terminal to your Katoolin.py directory. Again, likely /home/katoolin. To do this: open terminal and type cd katoolin.

2. Type: sudo python3 katoolin.py

Katoolin should run without any issues.

Conclusion

This is just a problem with running a python2 written code within python3.

If you have any issues with this tutorial, please let me know in the comments. I really love the work the LionSec has done to get Katoolin ironed out and I have used it on every build of Ubuntu in the past. I like the simplicity and ease of operation.

I am sure there are a million different ways to fix the issues listed above. If you have a better way please list it below in the comments as well.

You May Also Like…

4 Comments

  1. baldeagle

    Thanks for this tutorial. i made the changes to the katoolin.py files, but I am still getting the same parenthesis syntax error. To make the change i simply opened the file using the vi command, made the changes, saved them before exiting the terminal. Any idea why i might still be getting this error? Much Thanks

    Reply
    • Derrick Thomas

      You should make sure that you are running python3. If you are still getting the error, you might just be missing a couple. “)”
      I already have the file modified for you that you can download and just run. Make sure you run using $ python3 katoolin.py.

      Also, in answering this, I noticed that my version had outdated keyrings for kali. I have updated the katoolin.py to fix this. Download it from the section under “The Easy Way”

      When you run the katoolin.py, follow these steps:
      1. Add Kali repositories & Update
      2. Choose option “5” Download and Install the latest Kali Repo Keys.
      3. Choose option “1” Add kali linux repositories to sources.list.
      4. Choose option “2” Update.

      Let me know how it goes!

      Reply
      • baldeagle

        It worked. Very useful info. Thanks

        Reply
  2. Abdo

    OMG it’s worked it just like upgrading the python code form V2 to V3, The pirnt”” to print(“”) and the raw_input to input.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *