def toggle_ntopng(): try: status = kalipi.run_cmd("/usr/sbin/service ntopng status") if ("is running" in status) or ("active (running)") in status: kalipi.run_cmd("/usr/sbin/service ntopng stop") kalipi.run_cmd("/bin/systemctl stop redis-server") return False else: kalipi.run_cmd("/bin/systemctl start redis-server") kalipi.run_cmd("/usr/sbin/service ntopng start") return True except: return False
def check_mana_loud(): try: check = "sudo /usr/lib/mana-toolkit/hostapd_cli -p /var/run/hostapd mana_loud_state | grep 'ENABLE'" status = kalipi.run_cmd(check) if ("ENABLE" in status): return True else: return False except: return False
def verifyPin(): global pin, c if pin == "": retPage = kalipi.get_retPage() kalipi.screensaver(retPage) menuPin() elif pin == "111": pygame.quit() page = os.environ["MENUDIR"] + "menu-9p.py" retPage = kalipi.get_retPage() args = [page, retPage] os.execvp("python", ["python"] + args) sys.exit() elif pin == "110": pygame.quit() kalipi.run_cmd("/usr/bin/sudo /sbin/shutdown -h now") sys.exit() else: file = ".kalipi" pinFile = os.environ["MENUDIR"] + ".kalipi" file_conn = open(pinFile) file_pin = file_conn.readline()[:-1] file_conn.close() hashed_pin = hashlib.sha512(file + pin).hexdigest() if file_pin == hashed_pin: pygame.quit() launch_bg = os.environ["MENUDIR"] + "launch-bg.sh" process = subprocess.call(launch_bg, shell=True) retPage = kalipi.get_retPage() page = os.environ["MENUDIR"] + retPage args = [page] os.execvp("python", ["python"] + args) sys.exit() else: pin = "" c = 0 return
def button(number): if number == 1: if button1.disable == 1: return # Metasploit process = subprocess.call( "setterm -term linux -back default -fore white -clear all", shell=True) pygame.quit() kalipi.run_cmd("/usr/bin/sudo -u pi screen -R -S msf msfconsole") process = subprocess.call( "setterm -term linux -back default -fore black -clear all", shell=True) os.execv(__file__, sys.argv) if check_msf(): button1.fntColor = green button1.draw() pygame.display.update() else: button1.fntColor = tron_whi button1.draw() pygame.display.update() return if number == 2: if button2.disable == 1: return # SDR-Scanner pygame.quit() prog = "/bin/bash " + os.environ[ "MENUDIR"] + "/SDR-Scanner/sdr-scanner.sh" kalipi.run_cmd(prog) os.execv(__file__, sys.argv) if number == 3: if button3.disable == 1: return # Kismet process = subprocess.call( "setterm -term linux -back default -fore white -clear all", shell=True) pygame.quit() kalipi.run_cmd( "/usr/bin/sudo -u pi screen -R -S kismet /usr/bin/kismet") process = subprocess.call( "setterm -term linux -back default -fore black -clear all", shell=True) os.execv(__file__, sys.argv) if check_kismet(): button3.fntColor = green button3.draw() pygame.display.update() else: button3.fntColor = tron_whi button3.draw() pygame.display.update() return if number == 4: if button4.disable == 1: return # OpenVAS if toggle_openvas(): button4.fntColor = green button4.draw() pygame.display.update() else: button4.fntColor = tron_whi button4.draw() pygame.display.update() return if number == 5: if button5.disable == 1: return # Snort if toggle_snort(): button5.fntColor = green button5.draw() pygame.display.update() else: button5.fntColor = tron_whi button5.draw() pygame.display.update() return if number == 6: if button6.disable == 1: return # Pulledpork pygame.quit() cmd = "/usr/bin/sudo /bin/bash " + os.environ[ "MENUDIR"] + "pulledpork.sh" call(cmd, shell=True) os.execv(__file__, sys.argv) if number == 7: if button7.disable == 1: return # Previous page pygame.quit() page = os.environ["MENUDIR"] + "menu-2.py" os.execvp("python", ["python", page]) sys.exit() if number == 8: if button8.disable == 1: return # Screen off retPage = "menu-3.py" kalipi.screensaver(retPage) menu3() if number == 9: if button9.disable == 1: return # Next page pygame.quit() page = os.environ["MENUDIR"] + "menu-4.py" os.execvp("python", ["python", page]) sys.exit()
def button(number): if number == 1: if button1.disable == 1: return # NAT Full script="/usr/bin/sudo bash " + os.environ["MENUDIR"] + "mana/kalipi-nat-full.sh" if kalipi.toggle_script(script): button1.fntColor = green button1.draw() pygame.display.update() else: button1.fntColor = tron_light button1.draw() pygame.display.update() return if number == 2: if button2.disable == 1: return # NAT Simple script="/usr/bin/sudo bash " + os.environ["MENUDIR"] + "mana/kalipi-nat-simple.sh" if kalipi.toggle_script(script): button2.fntColor = green button2.draw() pygame.display.update() else: button2.fntColor = tron_light button2.draw() pygame.display.update() return if number == 3: if button3.disable == 1: return # No Upstream script="/usr/bin/sudo bash " + os.environ["MENUDIR"] + "mana/kalipi-noupstream.sh" if kalipi.toggle_script(script): button3.fntColor = green button3.draw() pygame.display.update() else: button3.fntColor = tron_light button3.draw() pygame.display.update() return if number == 4: if button4.disable == 1: return # No Upstream EAP script="/usr/bin/sudo bash " + os.environ["MENUDIR"] + "mana/kalipi-noupstream-eap.sh" if kalipi.toggle_script(script): button4.fntColor = green button4.draw() pygame.display.update() else: button4.fntColor = tron_light button4.draw() pygame.display.update() return if number == 5: if button5.disable == 1: return # No Upstream EAP only script="/usr/bin/sudo bash " + os.environ["MENUDIR"] + "mana/kalipi-noupstream-eaponly.sh" if kalipi.toggle_script(script): button5.fntColor = green button5.draw() pygame.display.update() else: button5.fntColor = tron_light button5.draw() pygame.display.update() return if number == 6: if button6.disable == 1: return # No Upstream All script="/usr/bin/sudo bash " + os.environ["MENUDIR"] + "mana/kalipi-noupstream-all.sh" if kalipi.toggle_script(script): button6.fntColor = green button6.draw() pygame.display.update() else: button6.fntColor = tron_light button6.draw() pygame.display.update() return if number == 7: if button7.disable == 1: return # Previous page pygame.quit() page=os.environ["MENUDIR"] + "menu-3.py" os.execvp("python", ["python", page]) sys.exit() if number == 8: if button8.disable == 1: return #Cleanup script="/usr/bin/sudo /bin/bash " + os.environ["MENUDIR"] + "mana/cleanmana.sh" kalipi.run_cmd(script) button1.fntColor = tron_light button1.draw() button2.fntColor = tron_light button2.draw() button3.fntColor = tron_light button3.draw() button4.fntColor = tron_light button4.draw() button5.fntColor = tron_light button5.draw() button6.fntColor = tron_light button6.draw() button8.fntColor = tron_light button8.draw() return if number == 9: if button9.disable == 1: return # Next page pygame.quit() page=os.environ["MENUDIR"] + "menu-9.py" os.execvp("python", ["python", page]) sys.exit()
def button(number): if number == 1: if button1.disable == 1: return # Exit process = subprocess.call("setterm -term linux -back default -fore white -clear all", shell=True) pygame.quit() sys.exit(37) if number == 2: if button2.disable == 1: return # X TFT pygame.quit() ## Requires "Anybody" in dpkg-reconfigure x11-common if we have scrolled pages previously ## kalipi.run_cmd("/usr/bin/sudo -u pi FRAMEBUFFER=/dev/fb1 startx") kalipi.run_cmd("/usr/bin/sudo FRAMEBUFFER=/dev/fb1 startx") os.execv(__file__, sys.argv) if number == 3: if button3.disable == 1: return # X HDMI pygame.quit() ## Requires "Anybody" in dpkg-reconfigure x11-common if we have scrolled pages previously ## kalipi.run_cmd("/usr/bin/sudo -u pi FRAMEBUFFER=/dev/fb0 startx") kalipi.run_cmd("/usr/bin/sudo FRAMEBUFFER=/dev/fb0 startx") os.execv(__file__, sys.argv) if number == 4: if button4.disable == 1: return # Shutdown pygame.quit() kalipi.run_cmd("/usr/bin/sudo /sbin/shutdown -h now") sys.exit() if number == 5: if button5.disable == 1: return # VNC if check_vnc(): kalipi.run_cmd("/usr/bin/vncserver -kill :1") button5.fntColor = tron_whi button5.draw() pygame.display.update() else: kalipi.run_cmd("/usr/bin/vncserver :1") button5.fntColor = green button5.draw() pygame.display.update() return if number == 6: if button6.disable == 1: return # Terminal process = subprocess.call("setterm -term linux -back default -fore white -clear all", shell=True) pygame.quit() kalipi.run_cmd("/usr/bin/sudo -u pi screen -R -S term") process = subprocess.call("setterm -term linux -back default -fore black -clear all", shell=True) os.execv(__file__, sys.argv) if check_terminal(): button6.fntColor = green button6.draw() pygame.display.update() else: button6.fntColor = tron_whi button6.draw() pygame.display.update() return if number == 7: if button7.disable == 1: return # Reboot pygame.quit() kalipi.run_cmd("/usr/bin/sudo /sbin/shutdown -r now") sys.exit() if number == 8: if button8.disable == 1: return # Lock retPage="menu-1.py" kalipi.screensaver(retPage) menu1() if number == 9: if button9.disable == 1: return # Next page pygame.quit() page=os.environ["MENUDIR"] + "menu-2.py" os.execvp("python", ["python", page]) sys.exit()
def button(number): if number == 1: if button1.disable == 1: return # Bettercap run_cmd("sudo /usr/lib/mana-toolkit/hostapd_cli -p /var/run/hostapd bettercap_enable") if kalipi.toggle_script(script): button1.fntColor = green button1.draw() pygame.display.update() else: button1.fntColor = tron_light button1.draw() pygame.display.update() return if number == 2: if button2.disable == 1: return # Warberry script="/usr/bin/sudo bash " + os.environ["MENUDIR"] + "mana/kalipi-nat-simple.sh" if kalipi.toggle_script(script): button2.fntColor = green button2.draw() pygame.display.update() else: button2.fntColor = tron_light button2.draw() pygame.display.update() return if number == 3: if button3.disable == 1: return # Wifiphiser script="/usr/bin/sudo bash " + os.environ["MENUDIR"] + "mana/kalipi-noupstream.sh" if kalipi.toggle_script(script): button3.fntColor = green button3.draw() pygame.display.update() else: button3.fntColor = tron_light button3.draw() pygame.display.update() return if number == 4: if button4.disable == 1: return # No Upstream EAP script="/usr/bin/sudo bash " + os.environ["MENUDIR"] + "mana/kalipi-noupstream-eap.sh" if kalipi.toggle_script(script): button4.fntColor = green button4.draw() pygame.display.update() else: button4.fntColor = tron_light button4.draw() pygame.display.update() return if number == 5: if button5.disable == 1: return # No Upstream EAP only script="/usr/bin/sudo bash " + os.environ["MENUDIR"] + "mana/kalipi-noupstream-eaponly.sh" if kalipi.toggle_script(script): button5.fntColor = green button5.draw() pygame.display.update() else: button5.fntColor = tron_light button5.draw() pygame.display.update() return if number == 6: if button6.disable == 1: return # No Upstream All script="/usr/bin/sudo bash " + os.environ["MENUDIR"] + "mana/kalipi-noupstream-all.sh" if kalipi.toggle_script(script): button6.fntColor = green button6.draw() pygame.display.update() else: button6.fntColor = tron_light button6.draw() pygame.display.update() return if number == 7: if button7.disable == 1: return # Previous page pygame.quit() page=os.environ["MENUDIR"] + "menu-4.py" os.execvp("python", ["python", page]) sys.exit() if number == 8: if button8.disable == 1: return #Cleanup script="/usr/bin/sudo /bin/bash " + os.environ["MENUDIR"] + "mana/cleanmana.sh" kalipi.run_cmd(script) button1.fntColor = tron_light button1.draw() button2.fntColor = tron_light button2.draw() button3.fntColor = tron_light button3.draw() button4.fntColor = tron_light button4.draw() button5.fntColor = tron_light button5.draw() button6.fntColor = tron_light button6.draw() button8.fntColor = tron_light button8.draw() return if number == 9: if button9.disable == 1: return # Next page pygame.quit() page=os.environ["MENUDIR"] + "menu-9.py" os.execvp("python", ["python", page]) sys.exit()
def button(number): if number == 1: if button1.disable == 1: return # Hostapd Open script=os.environ["MENUDIR"] + "mana/manaSimple.sh" if kalipi.toggle_script(script): button1.color = green make_button(button1) pygame.display.update() else: button1.color = tron_light make_button(button1) pygame.display.update() return if number == 2: if button2.disable == 1: return # Hostapd Secure script=os.environ["MENUDIR"] + "mana/manaSecure.sh" if kalipi.toggle_script(script): # Stop Service button2.color = green make_button(button2) pygame.display.update() else: #Start Service button2.color = tron_light make_button(button2) pygame.display.update() if number == 3: if button3.disable == 1: return #Mana Attack if check_mana(): # Stop Mana kalipi.run_cmd("sudo /usr/lib/mana-toolkit/hostapd_cli -p /var/run/hostapd mana_disable") button3.color = tron_light make_button(button3) pygame.display.update() else: # Start Mana run_cmd("sudo /usr/lib/mana-toolkit/hostapd_cli -p /var/run/hostapd mana_enable") button3.color = green make_button(button3) pygame.display.update() if number == 4: if button4.disable == 1: return # Beef if kalipi.toggle_service("beef-xss"): button4.color = green make_button(button4) pygame.display.update() else: button4.color = tron_light make_button(button4) pygame.display.update() return if number == 5: if button5.disable == 1: return # FireLamb firelamb="/usr/bin/sudo bash " + os.environ["MENUDIR"] + "mana/firelamb.sh" if kalipi.toggle_script(firelamb): button5.color = green make_button(button5) pygame.display.update() else: button5.color = red make_button(button5) pygame.display.update() return if number == 6: if button6.disable == 1: return #Mana Loud Attack if check_mana_loud(): #Stop Mana kalipi.run_cmd("sudo /usr/lib/mana-toolkit/hostapd_cli -p /var/run/hostapd mana_loud_off") button6.color = tron_light make_button(button6) pygame.display.update() else: #Start Mana Loud Attack kalipi.run_cmd("sudo /usr/lib/mana-toolkit/hostapd_cli -p /var/run/hostapd mana_loud_on") button6.color = green make_button(button6) pygame.display.update() if number == 7: if button7.disable == 1: return # Previous page pygame.quit() page=os.environ["MENUDIR"] + "menu-4.py" os.execvp("python", ["python", page]) sys.exit() if number == 8: if button8.disable == 1: return #DNS2Proxy script=os.environ["MENUDIR"] + "dns2proxy/dns2proxy.sh" if kalipi.toggle_script(script): #Stop Service button8.color = green make_button(button8) pygame.display.update() else: #Start Service button8.color = tron_light make_button(button8) pygame.display.update() return if number == 9: if button9.disable == 1: return # Next page pygame.quit() page=os.environ["MENUDIR"] + "menu-9.py" os.execvp("python", ["python", page]) sys.exit()