Module sysbot.modules.windows.sysinfo

Windows System Information Module

This module provides methods for retrieving system information on Windows systems, including hostname, domain, timezone, hardware details, and operating system information using PowerShell and WMI.

Classes

class Sysinfo

Windows system information retrieval class using PowerShell and WMI.

Ancestors

Methods

def datetime_utc(self, alias: str, **kwargs) ‑> str

Get current date and time in UTC.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

Current date and time formatted with timezone offset.

def domain(self, alias: str, **kwargs) ‑> str

Get the DNS domain name.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

DNS domain name.

def env(self, alias: str, name: str, **kwargs) ‑> str

Get the value of an environment variable.

Args

alias
Session alias for the connection.
name
Name of the environment variable.
**kwargs
Additional command execution options.

Returns

Value of the environment variable.

def fqdn(self, alias: str, **kwargs) ‑> str

Get the fully qualified domain name (FQDN).

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

Fully qualified domain name.

def hostname(self, alias: str, **kwargs) ‑> str

Get the system hostname (short name).

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

System hostname without domain.

def registry(self, alias: str, path: str, **kwargs) ‑> list

Get registry key properties.

Args

alias
Session alias for the connection.
path
Registry path to query.
**kwargs
Additional command execution options.

Returns

List of property names in the registry key.

def roles(self, alias: str, **kwargs) ‑> dict

Get Windows roles and features.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

Dictionary containing installed roles and features information.

def software(self, alias: str, **kwargs) ‑> list

Get list of installed software from the registry.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

List of installed software display names.

def timezone(self, alias: str, **kwargs) ‑> str

Get the system timezone offset.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

Timezone offset from UTC (e.g., +01:00, -05:00).

def win32_diskdrive(self, alias: str, **kwargs) ‑> dict

Get disk drive information using WMI Win32_DiskDrive class.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

Dictionary containing disk drive information including Name, Caption, Partitions, BytesPerSector, Size, and SerialNumber.

def win32_logicaldisk(self, alias: str, **kwargs) ‑> dict

Get logical disk information using WMI Win32_LogicalDisk class.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

Dictionary containing logical disk information including Caption, FileSystem, and Size.

def win32_operatingsystem(self, alias: str, **kwargs) ‑> dict

Get operating system information using WMI Win32_OperatingSystem class.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

Dictionary containing OS information including Caption, InstallDate, Version, BootDevice, BuildNumber, MUILanguages, SystemDirectory, SystemDrive, and WindowsDirectory.

def win32_physicalmemory(self, alias: str, **kwargs) ‑> dict

Get physical memory information using WMI Win32_PhysicalMemory class.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

Dictionary containing physical memory Capacity information.

def win32_process(self, alias: str, **kwargs) ‑> dict

Get process information using WMI Win32_Process class.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

Dictionary containing process information including ProcessName, PageFileUsage, PeakVirtualSize, and PrivatePageCount.

def win32_processor(self, alias: str, **kwargs) ‑> dict

Get processor information using WMI Win32_Processor class.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

Dictionary containing CPU information including Caption, DeviceID, MaxClockSpeed, NumberOfCores, and NumberOfLogicalProcessors.

def win32_service(self, alias: str, **kwargs) ‑> dict

Get service information using WMI Win32_Service class.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

Dictionary containing service information including Name, DisplayName, StartName, State, and StartMode.