Exemplo n.º 1
0
 def get(self, comm):
     if comm.lower().strip() == "/?":
         print("%scommands: list, get [network name]\n" %
               colour("magenta", bright=False))
         return
     if comm.lower().strip() == "list":
         a = {"network name": "password", **self.get_all()}
         max_len = max(max(len(str(x)), len(str(a[x]))) for x in a) + 1
         b = [(i + (" " * (max_len - len(i))),
               str(a[i]).replace("None", "") + (" " *
                                                (max_len - len(str(a[i])))))
              for i in a]
         out = "\n".join(i[0] + i[1] for i in b)
         print("%s\n" % out)
         return
     if comm.lower()[0:3] == "get":
         try:
             print("%s\n" % self.get_all()[comm[3::].strip()])
             return
         except KeyError:
             print("%sno network named: %s\n" %
                   (colour("red", bright=False), comm[3::].strip()))
             return
     print(
         "%s'%s' is not a command in this executer.\n" %
         (colour("red", bright=False), comm.strip().split(" ")[0].lower()))
Exemplo n.º 2
0
    def mainloop(self):
        while True:
            comm = self.prompt()
            check_comm = base_interpereter(comm)
            if check_comm == None:
                continue

            if check_comm[0] == "exec":
                if check_comm[1] == "list":
                    maxex = max(
                        len(x) for x in
                        [self.all_exec[y].name for y in self.all_exec]) + 2
                    maxexname = max(
                        len(x) for x in
                        [self.all_exec[y].description for y in self.all_exec])
                    out = "\n".join([
                        ("%s%s%s%s" %
                         (self.all_exec[x].name, " " *
                          (maxex - len(self.all_exec[x].name)),
                          self.all_exec[x].description, " " *
                          (maxexname - len(self.all_exec[x].description))))
                        for x in self.all_exec
                    ])
                    print(colour("magenta", bright=False) + out + "\n")
                    continue
                try:
                    self.exec = self.all_exec[check_comm[1]]
                    print("%sset current executer to %s\n" %
                          (colour("green", bright=False), check_comm[1]))
                except KeyError:
                    print("%sno module named %s\n" %
                          (colour("red", bright=False), check_comm[1]))
                continue
            self.get(check_comm)
Exemplo n.º 3
0
    def get(self, command):
        if command.strip()[0:2].lower() == "ls":
            d = command[3::].lower() if command[3::].strip() != "" else None

            out = []
            for i in os.scandir(d):
                iname = "'%s'"%i.name if " " in i.name else i.name
                if iname[0:10] == "NTUSER.DAT":
                    continue
                if iname[0:8] == "GodMode.":
                    continue

                if i.is_dir():
                    out.append("%s%s%s/"%(colour("blue"), iname, colour("white")))
                else:
                    out.append("%s%s%s"%(colour("white"), iname, colour("white")))

            mxl = max(len(x) for x in out)
            colls = int(round(os.get_terminal_size().columns / mxl, 0))
            colls = 1 if colls <= 0 else colls

            for i in range(len(out)):
                print("%s%s"%(out[i], " "*(mxl-len(out[i]))), end="")
                if i % colls == 0:
                    if i != len(out)-1:
                        print("")
        print("\n")
Exemplo n.º 4
0
    def __init__(self, caller, perms):
        super().__init__("CMD", "Runs and returns the results of CMD commands", colour("cyan"))

        if perms != "Admin":
            os.chdir("C:\\Users\\%s" %os.getlogin())
        else:
            os.chdir("C:\\WINDOWS\\system32")
Exemplo n.º 5
0
    def __init__(self, executer, perms):
        self.name = "bash"
        self.description = "Runs and returns the results of some bash commands"
        self.col = colour("yellow")

        if perms != "root":
            os.chdir("C:\\Users\\%s" %os.getlogin())
        else:
            os.chdir("C:\\WINDOWS\\system32")
Exemplo n.º 6
0
 def get(self, comm):
     try:
         self.exec.get(comm)
     except:
         print("%scall error in for command: %s\n" %
               (colour("red", bright=False), comm))
Exemplo n.º 7
0
 def prompt(self):
     print("%s[%s]%s[%s]%s%s" %
           (self.col, self.perms, self.exec.col, self.exec.name,
            colour("white", bright=False), self.exec.get_linestat()),
           end="")
     return input(colour("white", bright=True))
Exemplo n.º 8
0
                        [self.all_exec[y].description for y in self.all_exec])
                    out = "\n".join([
                        ("%s%s%s%s" %
                         (self.all_exec[x].name, " " *
                          (maxex - len(self.all_exec[x].name)),
                          self.all_exec[x].description, " " *
                          (maxexname - len(self.all_exec[x].description))))
                        for x in self.all_exec
                    ])
                    print(colour("magenta", bright=False) + out + "\n")
                    continue
                try:
                    self.exec = self.all_exec[check_comm[1]]
                    print("%sset current executer to %s\n" %
                          (colour("green", bright=False), check_comm[1]))
                except KeyError:
                    print("%sno module named %s\n" %
                          (colour("red", bright=False), check_comm[1]))
                continue
            self.get(check_comm)


if __name__ == '__main__':
    a = caller("user", colour("blue"))
    a.add_exec(cmd.CMD)
    a.add_exec(python.Python)
    a.add_exec(WiFi_passworder.WiFi_cache)
    a.add_exec(MAC_spoofer.MAC_Spoof)
    a.add_exec(bash.Bash)
    a.mainloop()
Exemplo n.º 9
0
 def __init__(self, caller, perms):
     super().__init__("Python",
                      "Runs and returns the results of Python commands",
                      colour("green"))
     self.shell = Shell()
Exemplo n.º 10
0
 def __init__(self, caller, perms):
     super().__init__("WiFi_cache", "Gets cached wifi passwords",
                      colour("cyan"))
Exemplo n.º 11
0
 def __init__(self, caller, perms):
     super().__init__("MAC", "Spoof and view divice mac adresses",
                      colour("cyan"))