示例#1
0
    def run(self, target, args, smb_con, loggers, config_obj):
        logger = loggers['console']
        proc_found = False
        x = WmiCon(args, loggers, smb_con.ip, smb_con.host)
        try:
            x.get_netprocess()
        except Exception as e:
            logger.debug("{} Error: {}".format(self.name, str(e)))

        logger.debug("{}: Identified {} processes running on {}".format(
            self.name, str(len(x.process_list.keys())), target))
        logger.debug("Searching for absence of: {}".format(
            self.args['PROCESS']['Value']))

        for pid, data in x.process_list.items():
            if self.args['PROCESS']['Value'].lower(
            ) == data['processname'].lower():
                logger.fail([
                    smb_con.host, smb_con.ip,
                    self.name.upper(),
                    "PID: {:<6} Name: {:<20} User: {:<17} Host: {:<25} Domain: {}"
                    .format(pid, data['processname'], data['user'],
                            data['computername'], data['domain'])
                ])
                return
        logger.success([
            smb_con.host, smb_con.ip,
            self.name.upper(),
            "{} NOT found on {}".format(self.args['PROCESS']['Value'],
                                        smb_con.host)
        ])
示例#2
0
def wmi_query(con, args, target, loggers):
    q = WmiCon(args, loggers, con.ip, con.host)
    loggers[args.mode].info("WMI Query\t{}\t{}\\{}\t{}".format(target, args.domain, args.user, args.wmi_query))
    q.wmi_query(args.wmi_namespace, args.wmi_query)
示例#3
0
def localgroup_members(smb_obj, args, target, loggers):
    q = WmiCon(args, loggers, smb_obj.ip, smb_obj.host)
    loggers[args.mode].info(
        "WMI Query\t{}\t{}\\{}\tEnumerate Local Groups".format(
            target, args.domain, args.user))
    q.get_localgroup_members(smb_obj.con.getServerName(), args.local_members)
示例#4
0
def tasklist(con, args, loggers):
    proc = WmiCon(args, loggers, con.ip, con.host)
    proc.get_netprocess(tasklist=True)
示例#5
0
def get_netlocalgroups(con, args, target, loggers):
    q = WmiCon(args, loggers, con.ip, con.host)
    loggers[args.mode].info(
        "WMI Query\t{}\t{}\\{}\tEnumerate Local Groups".format(
            target, args.domain, args.user))
    q.get_netlocalgroups()