Ejemplo n.º 1
0
	def options(self, args):
		try:
			moduleop.printoptions(self.modadd)
		except:
			print("["+colors.bold+colors.red+"err"+colors.end+"] Unexpected error in module:\n")
			traceback.print_exc(file=sys.stdout)
			print(colors.end)
			if api.enabled == True:
				raise
Ejemplo n.º 2
0
	def options(self, args):
		try:
			moduleop.printoptions(self.modadd)
		except:
			print("\033[1;31m[-]\033[0m Unexpected error in module:\n")
			traceback.print_exc(file=sys.stdout)
			print(colors.end)
			if api.enabled == True:
				raise
Ejemplo n.º 3
0
    def show(self, args):
        try:
            if args[0] == "modules":
                t = PrettyTable([colors.bold + 'Modules:', '' + colors.end])
                t.align = 'l'
                t.valing = 'm'
                t.border = False
                xml = moddbparser.parsemoddb()
                root = xml[0]
                for category in root:
                    if category.tag == "category":
                        t.add_row(["", ""])
                        t.add_row([
                            colors.red + colors.uline +
                            category.attrib["name"] + colors.end, colors.red +
                            colors.uline + "Description" + colors.end
                        ])

                    for item in category:
                        if item.tag == "module":
                            for child in item:
                                if child.tag == "shortdesc":
                                    t.add_row(
                                        [item.attrib["name"], child.text])
                                    break
                print("")
                print(t)
                print("")

            elif args[0] == "options" and self.mm.moduleLoaded == 1:
                try:
                    moduleop.printoptions(self.modadd)
                except:
                    print("[" + colors.bold + colors.red + "err" + colors.end +
                          "] Unexpected error in module:\n")
                    traceback.print_exc(file=sys.stdout)
                    print(colors.end)
                    if api.enabled == True:
                        raise
            else:
                raise UnknownCommand(
                    "[" + colors.bold + colors.red + "err" + colors.end +
                    "] Module not loaded or Unrecognized command!")
        except IndexError:
            raise UnknownCommand("[" + colors.bold + colors.red + "err" +
                                 colors.end + "] Unrecognized command!")
Ejemplo n.º 4
0
def show(args):
	try:
		if args[0] == "modules" and mm.moduleLoaded == 0:
			t = PrettyTable([colors.green+'Modules:', ''+colors.end])
			t.add_row(['',''])
			t.align = 'l'
			t.valing = 'm'
			t.border = False

			for key, val in module_database.database.items():
					t.add_row([key, val])

			print (t)
		elif args[0] == "options" and mm.moduleLoaded == 1:
			moduleop.printoptions(modadd)
		else:
			raise UnknownCommand("module not loaded or unknown command")
	except IndexError:
		raise UnknownCommand("unknown command")
Ejemplo n.º 5
0
	def show(self, args):
		try:
			if args[0] == "modules":
				t = PrettyTable([colors.bold+'Modules:', ''+colors.end])
				t.align = 'l'
				t.valing = 'm'
				t.border = False
				xml = moddbparser.parsemoddb()
				root = xml[0]
				for category in root:
					if category.tag == "category":
						t.add_row(["", ""])
						t.add_row([colors.red+colors.uline+category.attrib["name"]+colors.end, colors.red+colors.uline+"Description"+colors.end])

					for item in category:
						if item.tag == "module":
							for child in item:
								if child.tag == "shortdesc":
									t.add_row([item.attrib["name"], child.text])
									break

				print(t)				

			elif args[0] == "options" and self.mm.moduleLoaded == 1:
				try:
					moduleop.printoptions(self.modadd)
				except:
					print(colors.red+"unexpected error in module:\n")
					traceback.print_exc(file=sys.stdout)
					print(colors.end)
					if api.enabled == True:
						raise
			else:
				raise UnknownCommand("module not loaded or unknown command")
		except IndexError:
			raise UnknownCommand("unknown command")