dissect.target.plugins.os.windows.generic#

Module Contents#

Classes#

GenericPlugin

Generic Windows plugin.

Attributes#

dissect.target.plugins.os.windows.generic.UserRegistryRecordDescriptor#
dissect.target.plugins.os.windows.generic.AppInitRecord#
dissect.target.plugins.os.windows.generic.KnownDllRecord#
dissect.target.plugins.os.windows.generic.SessionManagerRecord#
dissect.target.plugins.os.windows.generic.NullSessionPipeRecord#
dissect.target.plugins.os.windows.generic.NdisRecord#
dissect.target.plugins.os.windows.generic.CommandProcAutoRunRecord#
dissect.target.plugins.os.windows.generic.AlternateShellRecord#
dissect.target.plugins.os.windows.generic.BootShellRecord#
dissect.target.plugins.os.windows.generic.FileRenameOperationRecord#
dissect.target.plugins.os.windows.generic.WinRarRecord#
dissect.target.plugins.os.windows.generic.WinSockNamespaceProviderRecord#
class dissect.target.plugins.os.windows.generic.GenericPlugin(target: dissect.target.Target)#

Bases: dissect.target.plugin.Plugin

Generic Windows plugin.

Provides some plugins that don’t fit in a separate plugin.

check_compatible() None#

Perform a compatibility check with the target.

This function should return None if the plugin is compatible with the current target (self.target). For example, check if a certain file exists. Otherwise it should raise an UnsupportedPluginError.

Raises:

UnsupportedPluginError – If the plugin could not be loaded.

ntversion()#

Return the Windows NT version.

pathenvironment()#

Return the content of the Windows PATH environment variable.

PATH is an environment variable on an operating system that specifies a set of directories where executable programs are located. Adversaries may add the directories in which they have stored their (malicious) binaries.

References

domain()#

Return the domain name.

Corporate Windows systems are usually connected to a domain (active directory).

References

activity() datetime.datetime | None#

Return last seen activity based on filesystem timestamps.

install_date() datetime.datetime | None#

Returns the install date of the system.

The value of the registry key is stored as a Unix epoch timestamp.

References

appinit()#

Return all available Application Initial (AppInit) DLLs registry key values.

AppInit_DLLs is a mechanism that allows an arbitrary list of DLLs to be loaded into each user mode process on the system. It can be used as a persistence mechanism and/or elevate privileges by executing malicious content triggered by AppInit DLLs loaded into processes. DLLs that are specified in the AppInit_DLLs value in the Registry keys HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionWindows or HKEY_LOCAL_MACHINESoftwareWow6432NodeMicrosoftWindows NTCurrentVersionWindows are loaded by user32.dll into every process that loads user32.dll.

References

knowndlls()#

Return all available KnownDLLs registry key values.

The KnownDLLs registry key values are used to cache frequently used system DLLs. Initially, it was added to accelerate application loading, but also it can be considered as a security mechanism, as it prevents malware from putting Trojan versions of system DLLs to the application folders (as all main DLLs belong to KnownDLLs, the version from the application folder will be ignored). However, these registry keys can still be leveraged to perform DLL injection.

References

sessionmanager()#

Return interesting Session Manager (Smss.exe) registry key entries.

Session Manager (Smss.exe) is the first user-mode process started by the kernel and performs several tasks, such as creating environment variables, starts the Windows Logon Manager (winlogon.exe), etc. The BootExecute registry key holds the Windows tasks that cannot be performed when Windows is running, the Execute registry key should never be populated when Windows is installed. Can be leveraged as persistence mechanisms.

References

nullsessionpipes()#

Return the NullSessionPipes registry key value.

The NullSessionPipes registry key value specifies server pipes and shared folders that are excluded from the policy that does not allow null session access. A null session implies that access to a network resource, most commonly the IPC$ “Windows Named Pipe” share, was granted without authentication. Also known as anonymous or guest access. These can thus be accessed without authentication and can be leveraged for latteral movement and/or privilege escalation.

References

ndis()#

Return network registry key entries.

commandprocautorun()#

Return all available Command Processor (cmd.exe) AutoRun registry key values.

The Command Processor AutoRun registry key values contain commands that are run each time the Command Processor (cmd.exe) is started. Since these commands are not shown to the user in the Command Processor, it can be exploited by an adversary to hide malicious commands or leverage as a persistence mechanism

References

alternateshell()#

Return the AlternateShell registry key value.

The AlternateShell registry key, HKEY_LOCAL_MACHINESystemCurrentControlSetControlSafeboot, specifies the shell that is used when a Windows system is started in “Safe Mode with Command Prompt”. Can be leveraged as a persistence mechanism.

References

bootshell()#

Return the BootShell registry key entry.

Usually contains a path to bootim.exe which is Windows’s recovery menu. This registry key can be used as a persistence mechanism.

filerenameop()#

Return all pending file rename operations.

The PendingFileRenameOperations registry key value contains information about files that will be renamed on reboot. Can be used to hunt for malicious binaries.

References

winrar()#

Return all available WinRAR history registry key values.

winsocknamespaceprovider()#

Return available protocols stored in the Winsock catalog database.

References

codepage() str | None#

Returns the current active codepage on the system.