Exemplo n.º 1
0
 def run(self):
     OS.check_os("windows")
     keys = self.getAllKeys()
     if self.isShellRun:
         print(
             generate_table([['XP', keys['XP']], ['IE', keys['IE']],
                             ['WPA', keys['WPA']]],
                            title="Product Keys",
                            headings=['Type', 'Key']))
         return keys
     return keys
Exemplo n.º 2
0
 def run(self):
     if self.isShellRun:
         OSInfo = OS.getOS()[1]
         max_k = 0
         for i in OSInfo.keys():
             if len(i) > max_k:
                 max_k = len(i)
         for name, data in zip(OSInfo.keys(), OSInfo.values()):
             print(f"{name}{' '*(max_k-len(name))} : {data}")
     else:
         return OS.getOS()
Exemplo n.º 3
0
 def run(self):
     if self.isShellRun:
         OSInfo = OS.get_OS()[1]
         table_show = OSInfo.copy()
         print(table_show)
         del table_show["uname"]
         print(generate_table(list(zip(table_show.keys(), table_show.values())),
                              title="OS Info",
                              headings=["Key", "Value"]))
         print(f"Uname: {OSInfo.get('uname')}")
     else:
         return OS.get_OS()[1]
Exemplo n.º 4
0
    def run(self):
        command = ["net", "user"]
        OS.check_os("windows")
        output_file, split_size, write_mode, args = self.get_vars()

        out = self.get_command_out(args, command)
        write_file_exists(output_file, out, write_mode)
        user_stripped_list = self.sort_to_lists(out, split_size)

        if self.isShellRun:
            print(generate_table(user_stripped_list[0], title="Local Users"))
            if user_stripped_list[1]:
                print(generate_table(user_stripped_list[1], title="Remote Users"))
            else:
                print(colored("No remote users", "red"))
        return user_stripped_list
Exemplo n.º 5
0
    def run(self):
        command = ["ipconfig"]
        OS.check_os("windows")
        output_file, write_mode, args = self.get_vars()

        out = self.get_command_out(args, command)
        write_file_exists(output_file, out, write_mode)

        interfaces = self.output_to_interfaces(out)
        interface_dictionaries = self.interfaces_to_dict(interfaces)
        if self.isShellRun:
            for interface in interface_dictionaries:
                name = interface["name"]
                del interface["name"]
                print(generate_table(list(zip(interface.keys(), interface.values())),
                                     title=name,
                                     headings=["Key", "Value"]))
                interface["name"] = name
        return interface_dictionaries
Exemplo n.º 6
0
    def run(self):
        args = []

        platform_name = OS.get_os_type()
        write_mode = self.shell.vars[
            "write_mode"] if "write_mode" in self.shell.vars.keys() else "w"
        output_file = self.shell.vars[
            "output_file"] if "output_file" in self.shell.vars.keys() else ""
        path = "dependencies/peass/" + 'winPEASany.bat' \
            if platform_name == "Windows" else 'peass.sh'

        if OS.path_exists(path):
            path = OS.absolute_path(path)
            if "args" in self.shell.vars.keys():
                args = self.shell.vars["args"].split(" ")
            print("Running PEASS, this might take sometime!")
            args.insert(0, path)
            out = Command.tee_or_return_output(self.isShellRun, args)
            write_file_exists(output_file, out, write_mode)
            return out
        raise IncompatibleSystemError("Unsupported OS or Architecture")
Exemplo n.º 7
0
 def check_os():
     platform_name = OS.get_os_type()
     if platform_name != "windows":
         raise IncompatibleSystemError("System Is Not Running Windows")
Exemplo n.º 8
0
 def run(self):
     if self.isShellRun:
         print(OS.getLMAddress())
     else:
         return OS.getLMAddress()