def set_host_port(self): try: lhost = h.getip() lport = None choice = raw_input(h.info_general_raw("Local Host: ")) if choice != "": lhost = choice while True: lport = raw_input(h.info_general_raw("Local Port: ")) if not lport: lport = 4444 try: lport = int(lport) except ValueError: h.info_error("Invalid port, please enter a valid integer.") continue if lport < 1024: h.info_error("Invalid port, please enter a value >= 1024.") continue break h.info_general("Using " + lhost + ":" + str(lport) + "...") self.host = socket.gethostbyname(lhost) self.port = lport return True except KeyboardInterrupt: return
def set_host_port(self): try: lhost = h.getip() lport = None choice = raw_input( h.info_general_raw("SET LHOST (Leave blank for " + lhost + ")>")) if choice != "": lhost = choice h.info_general("LHOST = " + lhost) while True: lport = raw_input( h.info_general_raw("SET LPORT (Leave blank for 4444)>")) if not lport: lport = 4444 try: lport = int(lport) except ValueError: h.info_general( "invalid port, please enter a valid integer") continue if lport < 1024: h.info_general( "invalid port, please enter a value >= 1024") continue break h.info_general("LPORT = " + str(lport)) self.host = socket.gethostbyname(lhost) self.port = lport return True except KeyboardInterrupt: return
def set_host_port(self): try: lhost = h.getip() lport = None choice = raw_input( h.info_general_raw("Set Listening Host (Leave blank for " + lhost + ")>")) if choice != "": lhost = choice h.info_general("LHOST = " + lhost) while True: lport = raw_input( h.info_general_raw( "Set Listening Port (Leave blank for 1337)>")) if not lport: lport = 1337 try: lport = int(lport) except ValueError: h.info_general( "Invalid Port. Please Enter A Valid Integer Value.") continue if lport < 1024: h.info_general( "Invalid Port. Please Enter A Port With Value >= 1024") continue break h.info_general("LPORT = " + str(lport)) self.host = socket.gethostbyname(lhost) self.port = lport return True except KeyboardInterrupt: return
def get_handle(self): """Interact with an active session""" if self.needs_refresh: return h.info_general_raw("Waiting for connection...") os.system("printf '\033]2;Mouse CLI\a'") mousel = "\033[4;77m" return h.WHITE + "(" + h.GREEN + self.hostname + h.WHITE + "@" + h.GREEN + self.username + h.WHITE + ")> "
def get_handle(self): """Interact with an active session""" if self.needs_refresh: return h.info_general_raw("Waiting for connection...") os.system("printf '\033]2;Mouse CLI\a'") return h.GREEN + "[" + self.hostname + h.WHITE + "@" + h.GREEN + self.username + h.ENDC + " " + WHITE_C + self.current_directory + h.GREEN + "]" + h.WHITE + "$ " + h.ENDC