def _run_process(reports, host): wmi_obj = _get_wmi_obj(host) temp_dict = {} for item in wmi_obj.Win32_Group(): temp_item = utility.clean_win32_obj(str(item)) if temp_item['Name'] not in temp_dict: temp_dict[temp_item['Name']] = {} temp_dict[temp_item['Name']]['group_information'] = temp_item reports['content']['local_groups'] = temp_dict temp_dict = {} for item in wmi_obj.Win32_GroupUser(): temp_item = utility.clean_win32_obj(str(item)) group_name = temp_item['GroupComponent'].split(',')[1].split('=')[1].strip('"') if group_name not in temp_dict: temp_dict[group_name] = [] temp_dict[group_name].append(temp_item) for name in temp_dict: for component in temp_dict[name]: user_name = component['PartComponent'].split(',')[1].split('=')[1].strip('"') if name in reports['content']['local_groups']: if 'group_users' not in reports['content']['local_groups'][name]: reports['content']['local_groups'][name]['group_users'] = [] reports['content']['local_groups'][name]['group_users'].append(user_name)
def _run_process(reports, host): wmi_obj = _get_wmi_obj(host) temp_dict = {} for item in wmi_obj.Win32_NetworkAdapter(): temp_item = utility.clean_win32_obj(str(item)) if 'NetEnabled' in temp_item: temp_dict[temp_item['Index']] = temp_item reports['content']['network_adapters'] = temp_dict temp_dict = {} for item in wmi_obj.Win32_NetworkAdapterConfiguration(): temp_item = utility.clean_win32_obj(str(item)) if temp_item['IPEnabled']: temp_dict[temp_item['Index']] = temp_item reports['content']['network_configuration'] = temp_dict
def _run_process(reports, host): wmi_obj = _get_wmi_obj(host) processor_dict = {} for item in wmi_obj.Win32_Processor(): temp_item = utility.clean_win32_obj(str(item)) processor_dict[temp_item['DeviceID']] = temp_item reports['content']['processors'] = processor_dict
def _run_process(reports, host): wmi_obj = _get_wmi_obj(host) temp_dict = {} for item in wmi_obj.Win32_BIOS(): temp_item = utility.clean_win32_obj(str(item)) temp_dict[temp_item['Caption']] = temp_item reports['content']['bios_information'] = temp_dict
def _run_process(reports, host): wmi_obj = _get_wmi_obj(host) temp_dict = {} for item in wmi_obj.Win32_PhysicalMemory(): temp_item = utility.clean_win32_obj(str(item)) temp_dict[temp_item['DeviceLocator']] = temp_item reports['content']['physical_memory'] = temp_dict
def _run_process(reports, host): wmi_obj = _get_wmi_obj(host) temp_dict = {} for item in wmi_obj.Win32_UserAccount(): temp_item = utility.clean_win32_obj(str(item)) temp_dict[temp_item['Caption']] = temp_item reports['content']['local_accounts'] = temp_dict
def _run_process(reports, host): wmi_obj = _get_wmi_obj(host) partition_dict = {} for item in wmi_obj.Win32_DiskPartition(): temp_item = utility.clean_win32_obj(str(item)) partition_dict[temp_item['DiskIndex']] = temp_item reports['content']['disk_partitions'] = partition_dict disk_dict = {} for item in wmi_obj.Win32_DiskDrive(): temp_item = utility.clean_win32_obj(str(item)) disk_dict[temp_item['Index']] = temp_item reports['content']['physical_drives'] = disk_dict logical_dict = {} for item in wmi_obj.Win32_LogicalDisk(): temp_item = utility.clean_win32_obj(str(item)) logical_dict[temp_item['DeviceID']] = temp_item reports['content']['logical_drives'] = logical_dict
def _run_process(reports, host): wmi_obj = _get_wmi_obj(host) temp_dict = {} for item in wmi_obj.Win32_Process(): temp_item = utility.clean_win32_obj(str(item)) temp_dict[temp_item['Caption']] = temp_item for item in temp_dict: for service in wmi_obj.Win32_Process(Name=item): result = service.GetOwner() temp_dict[item]['Owner'] = result[-1] reports['content']['processes'] = temp_dict