Beispiel #1
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
Beispiel #2
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
Beispiel #3
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")