Пример #1
0
def show_host(id):
  host = get_host(id)
  if host != None:
      txt = ("[+] HOST:" + str(host.id) + " | IP address: " + host.address + "\n" +
           " [+] SPECIFICATIONS:" + "\n" +
           "  [*] hostname: " +host.hostname + "\n" +
           "  [*] os_type: " +host.os_type + "\n" +
           "  [*] os_vendor: " +host.os_vendor + "\n" +
           "  [*] os_family: " +host.os_family + "\n" +
           "  [*] os_gen: " +host.os_gen + "\n" +
           "  [*] os_accuracy: " +host.os_accuracy + "\n")

      ports = host.openPorts
      txt += " [+] PORTS opened:" + "\n"
      if len(ports) != 0:
        for p in ports:
          txt += "   [*] Port: " + p + " open." + "\n"

      center_frame.bottom_tx_box_print(txt)
  else:
    txt = "[!] No Host with ID: " + str(id) 
    center_frame.bottom_tx_box_print(txt)
Пример #2
0
def print_hosts():

  if len(hosts.keys()) == 0:
    center_frame.bottom_tx_box_print("[-] No targets in the scope yet.")

  else: 
    table = []
    for hst in hosts.keys():
      selected_host = hosts[hst]
      table.append([selected_host.id, 
                    selected_host.address, 
                    selected_host.hostname,
                    global_variables.SCANNED[selected_host.scanned],
                    global_variables.SCANNED[selected_host.controlled],
                    global_variables.SCANNED[selected_host.hardened]])

    headers = tabulate(table, 
               headers=["ID","IP ADDRESS", "HOSTNAME", "SCANNED", "CONTROLLED", "HARDENED"], 
               tablefmt="fancy_grid", 
               stralign="center",
               numalign="center")
    center_frame.bottom_tx_box_print(headers)