def banner(): Color.log('Printing Banner..') print('\n\n\n\n') Color.writenolog( ' {C}############################\n') Color.writenolog( ' {G}RootSec Toolin\' Up Install Script\n') Color.writenolog(' {C}############################') print('\n\n\n')
def kali_metas(): clear() banner() options = [('99', 'Continue')] from core.metapackages import packages count = 0 for item in packages.items(): count += 1 options.append((str(count), str(item[0]).upper())) step = 1 poptions = int(len(options)) for package in range(1, poptions): if step == 1: option_str = (' {G}{D}[{W}{G}%s{D}]{W} : %s' % (options[package][0], options[package][1])) if len(option_str) < 66: Color.printlnnolog('\n ' + f'{option_str: <77}') if step == 2: Color.printlnnolog('{G}{D}[{W}{G}%s{D}]{W} : %s\n' % (options[package][0], options[package][1])) step = 1 continue step = 2 Color.writenolog('\n {G}{D}[{W}{G}%s{D}]{W}{G} :{W} %s {W}' % (options[0])) Color.println('\n {+} Please Choose an Option: ') try: choice = int(input('')) if choice == 99: return if choice not in range(1, poptions): Color.write(' {-} Not a viable option, try again') raise ValueError option = str(options[choice][1]).lower() for apt_package in packages.get(option): if apt_package in packages.keys(): Color.log('Found Dependancy: ' + apt_package + ' installing now..') Color.write( '\n\n\n {!} %s is required for this Meta Package \n\n\n' % apt_package) for depend in packages.get(apt_package): os.system('apt-get install -y %s' % depend) continue try: Color.log('Installing apt-package ' + apt_package) os.system('apt-get install %s -y' % apt_package) except: Color.println('') except ValueError: Color.write(' {-} Please Select an number from the options above') time.sleep(1) return kali_metas() Color.write('\n\n {+} Cleaning up extra Packages') time.sleep(3) os.system('apt autoremove -y') Color.write(' \n\n{+} Completed installing: ' + option) time.sleep(5) return kali_metas()
def ask(question): print('\n') Color.writenolog(' {?} ') if (input('Would you like to %s (Y/N)? ' % question) == ('y' or 'Y')): print('\n') return True