From c1fe528081152226b748461bbef67c71bc1ff074 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 11 Oct 2021 18:22:54 +0200 Subject: [PATCH 1/2] Python 2 died 650 days ago on 1/1/2020 Python 2 died 650 days ago on 1/1/2020 so it might no longer be installed on newer operating systems. * print() is a function in Python 3 * `raw_input()` was removed from Python 3 in favor of `input()`. --- katoolin.py | 130 +++++++++++++++++++++++++++------------------------- 1 file changed, 68 insertions(+), 62 deletions(-) diff --git a/katoolin.py b/katoolin.py index 102c17a..c1445e3 100644 --- a/katoolin.py +++ b/katoolin.py @@ -1,15 +1,21 @@ #!/usr/bin/python import os -import sys, traceback +import sys +import traceback + +try: + raw_input +except NameError: + raw_input = input if os.getuid() != 0: - print "Sorry. This script requires sudo privledges" + print("Sorry. This script requires sudo privledges") sys.exit() def main(): try: - print (''' + print(''' $$\ $$\ $$\ $$\ $$\ $$ | $$ | $$ | $$ |\__| @@ -29,7 +35,7 @@ def main(): ''') def inicio1(): while True: - print (''' + print(''' 1) Add Kali repositories & Update 2) View Categories 3) Install classicmenu indicator @@ -41,7 +47,7 @@ def inicio1(): opcion0 = raw_input("\033[1;36mkat > \033[1;m") while opcion0 == "1": - print (''' + print(''' 1) Add kali linux repositories 2) Update 3) Remove all kali linux repositories @@ -68,7 +74,7 @@ def inicio1(): fout.write(line) fin.close() fout.close() - print ("\033[1;31m\nAll kali linux repositories have been deleted !\n\033[1;m") + print("\033[1;31m\nAll kali linux repositories have been deleted !\n\033[1;m") elif repo == "back": inicio1() elif repo == "gohome": @@ -76,14 +82,14 @@ def inicio1(): elif repo == "4": file = open('/etc/apt/sources.list', 'r') - print (file.read()) + print(file.read()) else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") if opcion0 == "3": - print (''' + print(''' ClassicMenu Indicator is a notification area applet (application indicator) for the top panel of Ubuntu's Unity desktop environment. It provides a simple way to get a classic GNOME-style application menu for those who prefer this over the Unity dash menu. @@ -103,7 +109,7 @@ def inicio1(): if repo == "y": cmd1 = os.system("apt-get install kali-menu") elif opcion0 == "5": - print (''' + print(''' ****************** +Commands+ ****************** @@ -116,7 +122,7 @@ def inicio1(): def inicio(): while opcion0 == "2": - print (''' + print(''' \033[1;36m**************************** All Categories *****************************\033[1;m 1) Information Gathering 8) Exploitation Tools @@ -130,7 +136,7 @@ def inicio(): 0) All ''') - print ("\033[1;32mSelect a category or press (0) to install all Kali linux tools .\n\033[1;m") + print("\033[1;32mSelect a category or press (0) to install all Kali linux tools .\n\033[1;m") opcion1 = raw_input("\033[1;36mkat > \033[1;m") if opcion1 == "back": @@ -140,7 +146,7 @@ def inicio(): elif opcion1 == "0": cmd = os.system("apt-get -f install acccheck ace-voip amap automater braa casefile cdpsnarf cisco-torch cookie-cadger copy-router-config dmitry dnmap dnsenum dnsmap dnsrecon dnstracer dnswalk dotdotpwn enum4linux enumiax exploitdb fierce firewalk fragroute fragrouter ghost-phisher golismero goofile lbd maltego-teeth masscan metagoofil miranda nmap p0f parsero recon-ng set smtp-user-enum snmpcheck sslcaudit sslsplit sslstrip sslyze thc-ipv6 theharvester tlssled twofi urlcrazy wireshark wol-e xplico ismtp intrace hping3 bbqsql bed cisco-auditing-tool cisco-global-exploiter cisco-ocs cisco-torch copy-router-config doona dotdotpwn greenbone-security-assistant hexorbase jsql lynis nmap ohrwurm openvas-cli openvas-manager openvas-scanner oscanner powerfuzzer sfuzz sidguesser siparmyknife sqlmap sqlninja sqlsus thc-ipv6 tnscmd10g unix-privesc-check yersinia aircrack-ng asleap bluelog blueranger bluesnarfer bully cowpatty crackle eapmd5pass fern-wifi-cracker ghost-phisher giskismet gqrx kalibrate-rtl killerbee kismet mdk3 mfcuk mfoc mfterm multimon-ng pixiewps reaver redfang spooftooph wifi-honey wifitap wifite apache-users arachni bbqsql blindelephant burpsuite cutycapt davtest deblaze dirb dirbuster fimap funkload grabber jboss-autopwn joomscan jsql maltego-teeth padbuster paros parsero plecost powerfuzzer proxystrike recon-ng skipfish sqlmap sqlninja sqlsus ua-tester uniscan vega w3af webscarab websploit wfuzz wpscan xsser zaproxy burpsuite dnschef fiked hamster-sidejack hexinject iaxflood inviteflood ismtp mitmproxy ohrwurm protos-sip rebind responder rtpbreak rtpinsertsound rtpmixsound sctpscan siparmyknife sipp sipvicious sniffjoke sslsplit sslstrip thc-ipv6 voiphopper webscarab wifi-honey wireshark xspy yersinia zaproxy cryptcat cymothoa dbd dns2tcp http-tunnel httptunnel intersect nishang polenum powersploit pwnat ridenum sbd u3-pwn webshells weevely casefile cutycapt dos2unix dradis keepnote magictree metagoofil nipper-ng pipal armitage backdoor-factory cisco-auditing-tool cisco-global-exploiter cisco-ocs cisco-torch crackle jboss-autopwn linux-exploit-suggester maltego-teeth set shellnoob sqlmap thc-ipv6 yersinia beef-xss binwalk bulk-extractor chntpw cuckoo dc3dd ddrescue dumpzilla extundelete foremost galleta guymager iphone-backup-analyzer p0f pdf-parser pdfid pdgmail peepdf volatility xplico dhcpig funkload iaxflood inviteflood ipv6-toolkit mdk3 reaver rtpflood slowhttptest t50 termineter thc-ipv6 thc-ssl-dos acccheck burpsuite cewl chntpw cisco-auditing-tool cmospwd creddump crunch findmyhash gpp-decrypt hash-identifier hexorbase john johnny keimpx maltego-teeth maskprocessor multiforcer ncrack oclgausscrack pack patator polenum rainbowcrack rcracki-mt rsmangler statsprocessor thc-pptp-bruter truecrack webscarab wordlists zaproxy apktool dex2jar python-distorm3 edb-debugger jad javasnoop jd ollydbg smali valgrind yara android-sdk apktool arduino dex2jar sakis3g smali && wget http://www.morningstarsecurity.com/downloads/bing-ip2hosts-0.4.tar.gz && tar -xzvf bing-ip2hosts-0.4.tar.gz && cp bing-ip2hosts-0.4/bing-ip2hosts /usr/local/bin/") while opcion1 == "1": - print (''' + print(''' \033[1;36m=+[ Information Gathering\033[1;m 1) acccheck 30) lbd @@ -176,7 +182,7 @@ def inicio(): 0) Install all Information Gathering tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("apt-get install acccheck") @@ -251,7 +257,7 @@ def inicio(): elif opcion2 == "35": cmd = os.system("apt-get install nmap") elif opcion2 == "36": - print ('ntop is unavailable') + print('ntop is unavailable') elif opcion2 == "37": cmd = os.system("apt-get install p0f") elif opcion2 == "38": @@ -301,12 +307,12 @@ def inicio(): elif opcion2 == "0": cmd = os.system("apt-get install -y acccheck ace-voip amap automater braa casefile cdpsnarf cisco-torch cookie-cadger copy-router-config dmitry dnmap dnsenum dnsmap dnsrecon dnstracer dnswalk dotdotpwn enum4linux enumiax exploitdb fierce firewalk fragroute fragrouter ghost-phisher golismero goofile lbd maltego-teeth masscan metagoofil miranda nmap p0f parsero recon-ng set smtp-user-enum snmpcheck sslcaudit sslsplit sslstrip sslyze thc-ipv6 theharvester tlssled twofi urlcrazy wireshark wol-e xplico ismtp intrace hping3 && wget http://www.morningstarsecurity.com/downloads/bing-ip2hosts-0.4.tar.gz && tar -xzvf bing-ip2hosts-0.4.tar.gz && cp bing-ip2hosts-0.4/bing-ip2hosts /usr/local/bin/") else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "2": - print (''' + print(''' \033[1;36m=+[ Vulnerability Analysis\033[1;m 1) BBQSQL 18) Nmap @@ -331,7 +337,7 @@ def inicio(): 0) Install all Vulnerability Analysis tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("apt-get install bbqsql") @@ -364,7 +370,7 @@ def inicio(): elif opcion2 == "14": cmd = os.system("apt-get install hexorbase") elif opcion2 == "15": - print ("Please download inguma from : http://inguma.sourceforge.net") + print("Please download inguma from : http://inguma.sourceforge.net") elif opcion2 == "16": cmd = os.system("apt-get install jsql") elif opcion2 == "17": @@ -412,10 +418,10 @@ def inicio(): elif opcion2 == "0": cmd = os.system("apt-get install -y bbqsql bed cisco-auditing-tool cisco-global-exploiter cisco-ocs cisco-torch copy-router-config doona dotdotpwn greenbone-security-assistant hexorbase jsql lynis nmap ohrwurm openvas-cli openvas-manager openvas-scanner oscanner powerfuzzer sfuzz sidguesser siparmyknife sqlmap sqlninja sqlsus thc-ipv6 tnscmd10g unix-privesc-check yersinia") else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "3": - print (''' + print(''' \033[1;36m=+[ Wireless Attacks\033[1;m 1) Aircrack-ng 17) kalibrate-rtl @@ -437,7 +443,7 @@ def inicio(): 0) Install all Wireless Attacks tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("apt-get install aircrack-ng") @@ -510,9 +516,9 @@ def inicio(): elif opcion2 == "gohome": inicio1() else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "4": - print (''' + print(''' \033[1;36m=+[ Web Applications\033[1;m 1) apache-users 21) Parsero @@ -540,7 +546,7 @@ def inicio(): 0) Install all Web Applications tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") @@ -615,7 +621,7 @@ def inicio(): elif opcion2 == "34": cmd = os.system("apt-get install webscarab") elif opcion2 == "35": - print ("Webshag is unavailable") + print("Webshag is unavailable") elif opcion2 == "36": cmd = os.system("apt-get install git && git clone git://git.kali.org/packages/webslayer.git") elif opcion2 == "37": @@ -635,9 +641,9 @@ def inicio(): elif opcion2 == "0": cmd = os.system("apt-get install -y apache-users arachni bbqsql blindelephant burpsuite cutycapt davtest deblaze dirb dirbuster fimap funkload grabber jboss-autopwn joomscan jsql maltego-teeth padbuster paros parsero plecost powerfuzzer proxystrike recon-ng skipfish sqlmap sqlninja sqlsus ua-tester uniscan vega w3af webscarab websploit wfuzz wpscan xsser zaproxy") else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "5": - print (''' + print(''' \033[1;36m=+[ Sniffing & Spoofing\033[1;m 1) Burp Suite 17) rtpmixsound @@ -660,7 +666,7 @@ def inicio(): 0) Install all Sniffing & Spoofing tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("apt-get install burpsuite") @@ -737,10 +743,10 @@ def inicio(): elif opcion2 == "0": cmd = os.system("apt-get install -y burpsuite dnschef fiked hamster-sidejack hexinject iaxflood inviteflood ismtp mitmproxy ohrwurm protos-sip rebind responder rtpbreak rtpinsertsound rtpmixsound sctpscan siparmyknife sipp sipvicious sniffjoke sslsplit sslstrip thc-ipv6 voiphopper webscarab wifi-honey wireshark xspy yersinia zaproxy") else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "6": - print (''' + print(''' \033[1;36m=+[ Maintaining Access\033[1;m 1) CryptCat @@ -763,7 +769,7 @@ def inicio(): 0) Install all Maintaining Access tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("apt-get install cryptcat") @@ -806,9 +812,9 @@ def inicio(): elif opcion2 == "0": cmd = os.system("apt-get install -y cryptcat cymothoa dbd dns2tcp http-tunnel httptunnel intersect nishang polenum powersploit pwnat ridenum sbd u3-pwn webshells weevely") else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "7": - print (''' + print(''' \033[1;36m=+[ Reporting Tools\033[1;m 1) CaseFile @@ -824,7 +830,7 @@ def inicio(): 0) Install all Reporting Tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("apt-get install casefile") @@ -853,10 +859,10 @@ def inicio(): elif opcion2 == "0": cmd = os.system("apt-get install -y casefile cutycapt dos2unix dradis keepnote magictree metagoofil nipper-ng pipal") else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "8": - print (''' + print(''' \033[1;36m=+[ Exploitation Tools\033[1;m 1) Armitage @@ -880,7 +886,7 @@ def inicio(): 0) Install all Exploitation Tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("apt-get install armitage") @@ -925,10 +931,10 @@ def inicio(): elif opcion2 == "0": cmd = os.system("apt-get install -y armitage backdoor-factory cisco-auditing-tool cisco-global-exploiter cisco-ocs cisco-torch crackle jboss-autopwn linux-exploit-suggester maltego-teeth set shellnoob sqlmap thc-ipv6 yersinia beef-xss") else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "9": - print (''' + print(''' \033[1;36m=+[ Forensics Tools\033[1;m 1) Binwalk 11) extundelete @@ -948,7 +954,7 @@ def inicio(): 0) Install all Forensics Tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("apt-get install binwalk") @@ -967,7 +973,7 @@ def inicio(): elif opcion2 == "7": cmd = os.system("apt-get install ddrescue") elif opcion2 == "8": - print ('dff is unavailable') + print('dff is unavailable') elif opcion2 == "9": cmd = os.system("apt-get install git && git clone git://git.kali.org/packages/distorm3.git") elif opcion2 == "10": @@ -993,7 +999,7 @@ def inicio(): elif opcion2 == "20": cmd = os.system("apt-get install peepdf") elif opcion2 == "21": - print ("Regripper is unavailable") + print("Regripper is unavailable") elif opcion2 == "22": cmd = os.system("apt-get install volatility") elif opcion2 == "23": @@ -1005,9 +1011,9 @@ def inicio(): elif opcion2 == "0": cmd = os.system("apt-get install -y binwalk bulk-extractor chntpw cuckoo dc3dd ddrescue dumpzilla extundelete foremost galleta guymager iphone-backup-analyzer p0f pdf-parser pdfid pdgmail peepdf volatility xplico") else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "10": - print (''' + print(''' \033[1;36m=+[ Stress Testing\033[1;m 1) DHCPig @@ -1028,7 +1034,7 @@ def inicio(): 0) Install all Stress Testing tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("apt-get install dhcpig") @@ -1067,9 +1073,9 @@ def inicio(): elif opcion2 == "0": cmd = os.system("apt-get install -y dhcpig funkload iaxflood inviteflood ipv6-toolkit mdk3 reaver rtpflood slowhttptest t50 termineter thc-ipv6 thc-ssl-dos") else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "11": - print (''' + print(''' \033[1;36m=+[ Password Attacks\033[1;m 1) acccheck 19) Maskprocessor @@ -1094,7 +1100,7 @@ def inicio(): 0) Install all Password Attacks tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("apt-get install acccheck") @@ -1157,7 +1163,7 @@ def inicio(): elif opcion2 == "29": cmd = os.system("apt-get install rsmangler") elif opcion2 == "30": - print ("Sqldict is unavailable") + print("Sqldict is unavailable") elif opcion2 == "31": cmd = os.system("apt-get install statsprocessor") elif opcion2 == "32": @@ -1177,9 +1183,9 @@ def inicio(): elif opcion2 == "0": cmd = os.system("apt-get install -y acccheck burpsuite cewl chntpw cisco-auditing-tool cmospwd creddump crunch findmyhash gpp-decrypt hash-identifier hexorbase john johnny keimpx maltego-teeth maskprocessor multiforcer ncrack oclgausscrack pack patator polenum rainbowcrack rcracki-mt rsmangler statsprocessor thc-pptp-bruter truecrack webscarab wordlists zaproxy") else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "12" : - print (''' + print(''' \033[1;36m=+[ Reverse Engineering\033[1;m 1) apktool @@ -1197,7 +1203,7 @@ def inicio(): 0) Install all Reverse Engineering tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("apt-get install apktool") @@ -1230,9 +1236,9 @@ def inicio(): elif opcion2 == "0": cmd = os.system("apt-get install -y apktool dex2jar python-diStorm3 edb-debugger jad javasnoop JD OllyDbg smali Valgrind YARA") else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "13" : - print (''' + print(''' \033[1;36m=+[ Hardware Hacking\033[1;m 1) android-sdk @@ -1245,7 +1251,7 @@ def inicio(): 0) Install all Hardware Hacking tools ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("apt-get install android-sdk") @@ -1269,22 +1275,22 @@ def inicio(): elif opcion2 == "0": cmd = os.system("apt-get install -y android-sdk apktool arduino dex2jar sakis3g smali") else: - print ("\033[1;31mSorry, that was an invalid command!\033[1;m") + print("\033[1;31mSorry, that was an invalid command!\033[1;m") while opcion1 == "14" : - print (''' + print(''' \033[1;36m=+[ Extra\033[1;m 1) Wifresti 2) Squid3 ''') - print ("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") + print("\033[1;32mInsert the number of the tool to install it .\n\033[1;m") opcion2 = raw_input("\033[1;36mkat > \033[1;m") if opcion2 == "1": cmd = os.system("git clone https://github.com/LionSec/wifresti.git && cp wifresti/wifresti.py /usr/bin/wifresti && chmod +x /usr/bin/wifresti && wifresti") - print (" ") + print(" ") elif opcion2 == "2": cmd = os.system("apt-get install squid3") - print (" ") + print(" ") elif opcion2 == "back": inicio() elif opcion2 == "gohome": @@ -1293,7 +1299,7 @@ def inicio(): inicio() inicio1() except KeyboardInterrupt: - print ("Shutdown requested...Goodbye...") + print("Shutdown requested...Goodbye...") except Exception: traceback.print_exc(file=sys.stdout) sys.exit(0) From 7587eb55787a29de2c4f354b25974139ab665a40 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 11 Oct 2021 18:30:48 +0200 Subject: [PATCH 2/2] print() is a function in Python 3 --- core/gear.py | 70 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/core/gear.py b/core/gear.py index 0dc1e42..8e5ec02 100644 --- a/core/gear.py +++ b/core/gear.py @@ -1,6 +1,15 @@ #!/usr/bin/env python +from __future__ import print_function + +import os +import sys + from core.categories import * -import sys, os + +try: + raw_input +except NameError: + raw_input = input # colors red = "\033[1;31m" @@ -40,15 +49,15 @@ def show_categories(): """ Displays the categories available in the 'categories' dictionary of the core/categories.py file """ - print "\n%s:: Categories:%s\n" %(green, reset) + print("\n%s:: Categories:%s\n" %(green, reset)) for name in categories.items(): category = name[1][0] category = format(category) if name[0]%2 != 0: - print " "+str(name[0]).rjust(2) + ")", category.ljust(23)[:23], + print(" "+str(name[0]).rjust(2) + ")", category.ljust(23)[:23], end="") else: - print " "+str(name[0]).rjust(2) + ")", category - print " " + print(" "+str(name[0]).rjust(2) + ")", category) + print(" ") def load_category(key): """ @@ -58,7 +67,7 @@ def load_category(key): os.system('clear') category = categories[int(key)][0] category = format(category) - print green + ":: " + category + reset + "\n" + print(green + ":: " + category + reset + "\n") show_tools(categories[int(key)][1]) tools = categories[int(key)][1] site = categories[int(key)][0] @@ -68,7 +77,8 @@ def load_category(key): option = raw_input(": katoolin (%s%s%s) > " %(yellow, site, reset)) except KeyboardInterrupt: delete_repository() - print "..."; break + print("...") + break try: if option == 'back': delete_repository() @@ -91,20 +101,20 @@ def load_category(key): except: pass else: - print red + "E: The command is invalid!" + reset + print(red + "E: The command is invalid!" + reset) def search_tool(tool): """ Shows in which category the tool you are looking for is available """ - print ": Find " + yellow + tool + reset - print ": Available in:" + print(": Find " + yellow + tool + reset) + print(": Available in:") for lists in categories.items(): tools = lists[1][1] category = lists[1][0] category = format(category) if tool in tools: - print " [%s+%s] %s" %(green, reset, category) + print(" [%s+%s] %s" %(green, reset, category)) def show_tools(tools): """ @@ -112,10 +122,10 @@ def show_tools(tools): """ for tool in enumerate(tools): if tool[0]%2 == 0: - print " "+str(tool[0]+1).rjust(2) + ")", tool[1].ljust(23)[:23], + print(" "+str(tool[0]+1).rjust(2) + ")", tool[1].ljust(23)[:23], end="") else: - print " "+str(tool[0]+1).rjust(2) + ")", tool[1] - print "\n 99) ALL" + print(" "+str(tool[0]+1).rjust(2) + ")", tool[1]) + print("\n 99) ALL") def add_repository(): """ @@ -128,10 +138,10 @@ def add_repository(): f = open("/etc/apt/sources.list.d/katoolin.list", "wb") f.write("#Katoolin\ndeb http://http.kali.org/kali kali-rolling main contrib non-free\n# For source package access, uncomment the following line\n# deb-src http://http.kali.org/kali kali-rolling main contrib non-free\n") f.close() - print green + "\n[+] Add repository\n" + reset + print(green + "\n[+] Add repository\n" + reset) add_key() except IOError: - print red+"E: Please run as root"+reset + print(red+"E: Please run as root"+reset) sys.exit() def delete_repository(): @@ -141,7 +151,7 @@ def delete_repository(): repository = "/etc/apt/sources.list.d/katoolin.list" if os.path.exists(repository): os.remove(repository) - print green + "\n[+] Repository deleted\n" + reset + print(green + "\n[+] Repository deleted\n" + reset) def add_key(): """ @@ -155,9 +165,9 @@ def add_key(): f = open(tmp_key, "wb") f.write("katoolin\n") f.close() - print green + "\n[+] Add keyserver\n" + reset + print(green + "\n[+] Add keyserver\n" + reset) os.system('apt-get update -o Dir::Etc::sourcelist="sources.list.d/katoolin.list" -o Dir::Etc::sourceparts="-" -o apt::Get::List-Cleanup="0"') - print green + "\n[+] Update\n" + reset + print(green + "\n[+] Update\n" + reset) def banner(): version = "v1.3b" @@ -169,7 +179,7 @@ def banner(): 4) Exit """ - print """ + print(""" $$\ $$\ $$\ $$\ $$\ $$ | $$ | $$ | $$ |\__| $$ |$$ / $$$$$$\ $$$$$$\ $$$$$$\ $$$$$$\ $$ |$$\ $$$$$$$\ @@ -180,8 +190,8 @@ def banner(): \__| \__| \_______| \____/ \______/ \______/ \__|\__|\__| \__| %s%s %s+ -- -- +=[ Original project: https://github.com/LionSec/katoolin | LionSec - + -- -- +=[ %s Tools%s""" %(cyan,reset,cyan,version,reset,green,tools,reset) - print options + + -- -- +=[ %s Tools%s""" %(cyan,reset,cyan,version,reset,green,tools,reset)) + print(options) def update(): """ @@ -189,36 +199,36 @@ def update(): """ try: os.system('git pull') - print yellow + "W: Please restart katoolin" + reset + print(yellow + "W: Please restart katoolin" + reset) except: - print red + "E: can't start update please use "+reset + print(red + "E: can't start update please use "+reset) def help(x=False): """ Displays tool help """ if x != True: - print """: load= Load category + print(""": load= Load category : search= Find tool : clear Clean screen : 1, show Show categories : 2, update Update katoolin (git pull) : 3, help Show help -: 4, exit Exit katoolin""" +: 4, exit Exit katoolin""") else: - print """: