コード例 #1
0
ファイル: bind_tcp.py プロジェクト: VanirLab/commi3
def configure_bind_tcp(separator):

    # Set up rhost for the bind TCP connection
    while True:
        option = eval(
            eval(
                input("""commix(""" + Style.BRIGHT + Fore.RED +
                      """bind_tcp""" + Style.RESET_ALL + """) > """)))
        if option.lower() == "bind_tcp":
            warn_msg = "You are already into the '" + option.lower(
            ) + "' mode."
            print((settings.print_warning_msg(warn_msg)))
            continue
        elif option.lower() == "?":
            menu.bind_tcp_options()
            continue
        elif option.lower() == "quit":
            raise SystemExit()
        elif option.lower() == "os_shell" or option.lower() == "back":
            settings.BIND_TCP = False
            break
        elif option.lower() == "reverse_tcp":
            settings.REVERSE_TCP = True
            settings.BIND_TCP = False
            break
        elif len(settings.LPORT) != 0 and len(settings.RHOST) != 0:
            break
        elif option[0:4].lower() == "set ":
            if option[4:10].lower() == "rhost ":
                if check_rhost(option[10:]):
                    if len(settings.LPORT) == 0:
                        pass
                    else:
                        break
                else:
                    continue
            elif option[4:10].lower() == "lhost ":
                err_msg = "The '" + option[4:9].upper() + "' option, is not "
                err_msg += "usable for 'bind_tcp' mode. Use 'RHOST' option."
                print((settings.print_error_msg(err_msg)))
                continue
            elif option[4:10].lower() == "lport ":
                if check_lport(option[10:]):
                    if len(settings.RHOST) == 0:
                        pass
                    else:
                        break
                else:
                    continue
            else:
                err_msg = "The '" + option + "' option, is not valid."
                print((settings.print_error_msg(err_msg)))
                pass
        else:
            err_msg = "The '" + option + "' option, is not valid."
            print((settings.print_error_msg(err_msg)))
            pass


# eof
コード例 #2
0
ファイル: bind_tcp.py プロジェクト: security-geeks/commix
def configure_bind_tcp(separator):

  # Set up rhost for the bind TCP connection
  while True:
    option = raw_input("""commix(""" + Style.BRIGHT + Fore.RED + """bind_tcp""" + Style.RESET_ALL + """) > """)
    if option.lower() == "bind_tcp": 
      warn_msg = "You are already into the '" + option.lower() + "' mode."
      print settings.print_warning_msg(warn_msg)
      continue
    elif option.lower() == "?": 
      menu.bind_tcp_options()
      continue
    elif option.lower() == "quit": 
      raise SystemExit()
    elif option.lower() == "os_shell" or option.lower() == "back": 
      settings.BIND_TCP = False
      break
    elif option.lower() == "reverse_tcp":
      settings.REVERSE_TCP = True
      settings.BIND_TCP = False
      break 
    elif len(settings.LPORT) != 0 and len(settings.RHOST) != 0:
      break 
    elif option[0:4].lower() == "set ":
      if option[4:10].lower() == "rhost ":
        if check_rhost(option[10:]):
          if len(settings.LPORT) == 0:
            pass
          else:
            break
        else:
          continue  
      elif option[4:10].lower() == "lhost ":
        err_msg =  "The '" + option[4:9].upper() + "' option, is not "
        err_msg += "usable for 'bind_tcp' mode. Use 'RHOST' option."
        print settings.print_error_msg(err_msg)  
        continue  
      elif option[4:10].lower() == "lport ":
        if check_lport(option[10:]):
          if len(settings.RHOST) == 0:
            pass
          else:
            break
        else:
          continue
      else:
        err_msg = "The '" + option + "' option, is not valid."
        print settings.print_error_msg(err_msg)
        pass
    else:
      err_msg = "The '" + option + "' option, is not valid."
      print settings.print_error_msg(err_msg)
      pass

# eof