Skip to main content

Windows

These functions can be used to pull data related to Windows artifacts.

You can access these functions by using git to clone the API TypeScript bindings.
Then you may import them into your TypeScript code.

For example:

import { assembleScriptblocks } from "./artemis-api/mod";

function main() {
const powershell_scriptblocks = assembleScriptblocks();
if(powershell_scriptblocks instanceof WindowsError) {
return;
}

console.log(JSON.stringify(powershell_scriptblocks));
}

main();

getAmcache(path) -> Amcache[] | WindowsError

Parse Amcache Registry file on the systemdrive. You may provide an optional alternative path to the Amcache.hve file

ParamTypeDescription
pathstringOptional path to an Amcache file

getBits(carve, path) -> Bits | WindowsError

Parse Windows BITS data. Supports carving deleted entries. You may also provide an optional alternative path to the BITS database file.

ParamTypeDescription
carvebooleanAttempt to carve deleted BITS entries
pathstringOptional path to a BITS file

getEventlogs(path, offset, limit, include_templates, template_file) -> EventLogRecord[] |EventLogMessage[] | WindowsError

Parse Windows EventLog file at provided path. If you want to include template strings and you are on a non-Windows platform, a template_file file is required.

ParamTypeDescription
pathstringPath to Windows EventLog file
offsetnumberHow many records to skip
limitnumberMax number of records to return
include_templatesbooleanWhether to include template strings in output. Default is false
template_filestringPath to a JSON template file

getJumplists(path) -> Jumplists[] | WindowsError

Get all JumpLists for all users at default systemdrive. You may also provide an optional alternative path to a Jumplist file.

ParamTypeDescription
pathstringOptional path to Jumplist file

readRawFile(path) -> Uint8Array | WindowsError

Read a file at provided path by parsing the NTFS. You can read locked files with this function.

ParamTypeDescription
pathstringPath to file read

readAdsData(path, ads_name) -> Uint8Array | WindowsError

Read an Alternative Data Stream at provided file path.

ParamTypeDescription
pathstringPath to file read
ads_namestringADS data to read

getPe(path) -> PeInfo | WindowsError

Parse PE file at provided path.

ParamTypeDescription
pathstringPath to PE file

getPrefetch() -> Prefetch[] | WindowsError

Parse all Prefetch files at default systemdrive. You may also provide an optional alternative path to a directory containing Prefetch files.

ParamTypeDescription.
pathstringOptional path to Prefetch directory

getRecycleBin() -> RecycleBin[] | WindowsError

Parse all RecycleBin files default systemdrive.

ParamTypeDescription
pathstringOptional path to RecycleBin file

getRegistry(path) -> Registry[] | WindowsError

Parse Registry file at provided path.

ParamTypeDescription
pathstringPath to Registry file.

getSearch(path, page_limit) -> SearchEntry[] | WindowsError

Parse Windows Search database at provided path.

You can provide an optional page_limit (default is 50). Will influence memory usage, a higher number means higher memory usage but faster parsing.

ParamTypeDescription
pathstringPath to Windows Search database.
page_limitnumberSet the number of pages to use when parsing. Default is 50

getServices() -> Services[] | WindowsError

Parse Windows Services at default systemdrive. You may also provide an optional alternative path to the SYSTEM Registry file.

ParamTypeDescription
pathstringOptional path to Windows SYSTEM Registry file

getShellbags(resolve_guids, path) -> Shellbags[] | WindowsError

Parse Windows Shellbags at default systemdrive. You may enable GUID resolution (this feature only works on Windows). You may also provide an optional alternative path to the Shellbags Registry file.

ParamTypeDescription
resolve_guidsbooleanEnable GUID resolution. Only available on Windows
pathstringOptional path to either NTUSER.DAT or UsrClass.dat file

getShimcache(path) -> Shimcache[] | WindowsError

Parse Windows Shimcache at default systemdrive. You may also provide an optional alternative path to the SYSTEM Registry file.

ParamTypeDescription
pathstringOptional path to the SYSTEM Registry file

getShimdb(path) -> Shimdb[] | WindowsError

Parse Windows ShimDB files at default systemdrive. You may also provide an optional path to a ShimDB file.

ParamTypeDescription
pathstringOptional path to a Windows ShimDB file

getLnkFile(path) -> Shortcut | WindowsError

Parse Windows Shortcut file at provided path.

ParamTypeDescription
pathstringPath to Windows Shortcut file

getSrumApplicationInfo(path) -> ApplicationInfo[] | WindowsError

Parse Application info from Windows SRUM.

ParamTypeDescription
pathstringPath to Windows SRUM file

getSrumApplicationTimeline(path) -> ApplicationTimeline[] | WindowsError

Parse Application Timeline info from Windows SRUM.

ParamTypeDescription
pathstringPath to Windows SRUM file

getSrumApplicationVfu(path) -> AppVfu[] | WindowsError

Parse Application VFU info from Windows SRUM.

ParamTypeDescription
pathstringPath to Windows SRUM file

getSrumEnergyInfo(path) -> EnergyInfo[] | WindowsError

Parse Energy info from Windows SRUM.

ParamTypeDescription
pathstringPath to Windows SRUM file

getSrumEnergyUsage(path) -> EnergyUsage[] | WindowsError

Parse Energy usage from Windows SRUM.

ParamTypeDescription
pathstringPath to Windows SRUM file

getSrumNetworkInfo(path) -> NetworkInfo[] | WindowsError

Parse Network info from Windows SRUM.

ParamTypeDescription
pathstringPath to Windows SRUM file

getSrumNetworkConnectivity(path) -> NetworkConnectivityInfo[] | WindowsError

Parse Network connectivity info from Windows SRUM.

ParamTypeDescription
pathstringPath to Windows SRUM file

getSrumNotifications(path) -> NotificationInfo[] | WindowsError

Parse notification info from Windows SRUM.

ParamTypeDescription
pathstringPath to Windows SRUM file

getTasks(path) -> TaskData | WindowsError

Parse Windows Schedule Tasks at default systemdrive. You may also provide an optional path to a Schedule Task file.

ParamTypeDescription
pathstringOptional path to Windows Schedule Task file. Can be either XML or Job

getUserassist(resolve, path) -> UserAssist[] | WindowsError

Parse Windows Userassist entries at default systemdrive for all users. You may enable GUID resolution lookups. You may also provide an optional path to the NTUSER.dat file.

ParamTypeDescription
resolvebooleanEnable GUID resolution. Only available on Windows
pathstringFull path to NTUSER.DAT file

getUsersWin(path) -> UserInfo[] | WindowsError

Get local Windows User accounts from SAM Registry file. Uses default systemdrive letter. You may also provide an optional path to the SAM Registry file.

ParamTypeDescription
pathstringOptional path to SAM Registry file

getUsnjrnl(path, drive, mft) -> UsnJrnl[] | WindowsError

Parses Windows UsnJrnl data. Uses default systemdrive letter. You may also provide optional alternative paths for:

  • UsnJrnl file
  • Drive letter
  • MFT for path resolutions
ParamTypeDescription
drivestringOptional drive letter to get Windows UsnJrnl
pathstringOptional path to UsnJrnl file
mftstringOptional path to MFT file for path resolutions

logons(path) -> Logons[] | WindowsError

Parse the Windows Security.evtx and try to correlate Logon and Logoff events.

ParamTypeDescription
pathstringPath to Windows Security.evtx file

lookupSecurityKey(path, offset) -> SecurityKey | WindowsError

Parse Security Key data from Registry at provided Security Key offset. The offset must be a postive number greater than 0. You can use getRegistry(path) to pull a list of keys which contain Security Key offset data.

It is not recommended to bulk lookup Security Key info due the amount of data. Security Keys contain information about Registry key permissions and ACLs. Its not super useful.

ParamTypeDescription
pathstringPath to Windows Registry file
offsetnumberOffset to Security Key

ESE Database Class

A basic class to help interact and extract data from ESE databases

catalogInfo() -> Catalog[] | WindowsError

Dump the Catalog metadata associated with an ESE database. Returns an array of Catalog entries or WindowsError

tableInfo(catalog, table_name) -> TableInfo

Extract table metadata from parsed Catalog entries based on provided table name

ParamTypeDescription
catalogCatalog[]Array of Catalog entries
table_namestringName of table to extract

getPages(first_page) -> number[] | WindowsError

Get an array of all pages associated with a table starting at the first page provided. First page can be found in the TableInfo object.

ParamTypeDescription
first_pagenumberFirst page of a table

getRows(pages, info) -> Record<string, EseTable[][]> | WindowsError

Get rows associated with provided TableInfo object and number of pages. A returns a Record<string, EseTable[][]> or WindowsError.

The table name is the Record string key.

EseTable is an array of rows and columns representing ESE data.

ParamTypeDescription
pagesnumber[]Array of pages
infoTableInfoTableInfo object

getFilteredRows(pages, info, column_name, column_data) -> Record<string, EseTable[][]> | WindowsError

Get rows and filter based on provided column_name and column_data. This function can be useful if you want to get data from a table thats shares data with another table. For example, if you call getRows() to get data associated with TableA and now you want to get data from TableB and both tables share a unique key.

Its a little similar to "select * from tableB where columnX = Y" where Y is a unique key

ParamTypeDescription
pagesnumber[]Array of pages
infoTableInfoTableInfo object
column_namestringColumn name that you want to filter on
column_dataRecord<string, boolean>HashMap of column values to filter on. Only the key is used to filter the data

dumpTableColumns(pages, info, column_names) -> Record<string, EseTable[][]> | WindowsError

Get rows based on specific columns names. This function is the same as getRows() except it will only return column names that included in column_names.

ParamTypeDescription
pagesnumber[]Array of pages
infoTableInfoTableInfo object
column_namestring[]Array of column names to get data from

getChocolateyInfo(alt_base) -> ChocolateyInfo[] | WindowsError

Return a list of installed Chocolatey packages. Will use the ChocolateyInstall ENV value by default (C:\ProgramData\chocolatey).

An optional alternative base path can also be provided

ParamTypeDescription
alt_basestringOptional base path for Chocolatey

Updates class

A simple class to help dump the contents of the Windows DataStore.edb database. This class extends the EseDatabase class.

updateHistory(pages) -> UpdateHistory[] | WindowsError

Return a list of Windows Updates by parsing the Windows DataStore.edb database.

ParamTypeDescription
pagesnumber[]Array of pages to get data from

powershellHistory(platform, alt_path) -> History[] | History | WindowsError

Return PowerShell history entries for all users. Uses the systemdrive by default.

This artifact also supports PowerShell history on macOS or Linux An optional alternative path to ConsoleHost_history.txt can also be provided instead.

ParamTypeDescription
platformPlatformTypePlatform type to parse history for. Default is Windows
alt_pathstringOptional full path to ConsoleHost_history.txt

parseMru(ntuser_path) -> Mru[] | WindowsError

Parse common Most Recently Used (MRU) locations in the Registry. Currently parses: OpenSave, LastVisited, and RecentDocs MRU keys

ParamTypeDescription
ntuser_pathstringFull path to NTUSER.DAT file

getShellItem(data) -> JsShellItem | WindowsError

Parse raw bytes that contain a ShellItem. Returns a JsShellItem that contains ShellItem and any remaining bytes. This function can be used to parse multiple shellitems.

ParamTypeDescription
dataUint8ArrayRaw bytes of shellitem

UserAccessLogging class

A simple class to help extract data from the Windows User Access Log database. This class extends the EseDatabase class

getRoleIds(pages) -> RoleIds[] | WindowsError

Return an array of RoleIds associated with UAL database. This function expects the UserAccessLogging class to be initialized with the SystemIdentity.mdb database otherwise it will return no results.

ParamTypeDescription
pagesnumber[]Array of pages to get data from

getUserAccessLog(pages, roles_ual, role_page_chunk) -> UserAccessLog[] | WindowsError

Parse the User Access Log (UAL) database on Windows Servers. This database contains logon information for users on the system.
It is not related to M365 UAL (Unified Audit Logging)!

This function expects the UserAccessLogging class to be initialized with the Current.mdb or {GUID}.mdb database otherwise it will return no results.

You may provide an optional UserAccessLogging associated with SystemIdentity.mdb to perform RoleID lookups. Otherwise this table will parse the Current.mdb or {GUID}.mdb database. You may also customize the number of pages that should be used when doing RoleID lookups, by default 30 pages will used.

ParamTypeDescription
pagesnumber[]Array of pages to get data from
roles_ualUserAccessLoggingOptional UserAccessLogging object that was initialized with the file SystemIdentity.mdb. Can be used to perform RoleID lookups
role_page_chunknumberNumber of pages that should be submitted when doing RoleID lookups. By default 30 page chunks will be used to do lookup

userAccessLog(alt_dir) -> UserAccessLog[] | WindowsError

Parse the User Access Log (UAL) database on Windows Servers. This database contains logon information for users on the system.
It is not related to M365 UAL (Unified Audit Logging)!

By default it will parse the databases at %SYSTEMROOT%\System32\LogFiles\Sum. However, you may provided an optional alternative path if you want.

ParamTypeDescription
alt_dirstringAlternative directory containing the UAL log databases

getWmiPersist() -> WmiPersist[] | WindowsError

Parse the WMI Repository and extract persistence information.

getWmiPersistPath(path) -> WmiPersist[] | WindowsError

Parse the WMI Repository and extract persistence information at provided path. The directory must contain:

  • MAPPING*.MAP
  • OBJECTS.DATA
  • INDEX.BTR
ParamTypeDescription
pathstringPath to WMI Repository

listUsbDevices(alt_file) -> UsbDevices[] | WindowsError

Parse SYSTEM Registry to get list of USB devices that have been connected

ParamTypeDescription
alt_filestringAlternative path to the SYSTEM Registry file

serviceInstalls(path) -> ServiceInstalls[] | WindowsError

Parse Windows System.evtx file to extract Service Install events.

ParamTypeDescription
pathstringPath to the System.evtx file

Outlook Class

A basic class to help interact and extract data from OST files.

rootFolder() -> FolderInfo | WindowsError

Returns the root folder in an OST file. Can be used to start walking through the OST file

readFolder(folder) -> FolderInfo | WindowsError

Reads the provided folder ID. Returns the same object as rootFolder() function.

ParamTypeDescription
foldernumberFolder ID

readMessages(table, offset, limit) -> MessageDetails[] | WindowsError

Read messages in a folder. You can specify which message to start at with the offset and how many the limit. Returns an array of read messages or an error.

An offset of 0 means, start with the first message. By default artemis will return only 50 messages.

ParamTypeDescription
tableTableInfoTable structure associated with the folder. Obtained by readFolder()
offsetnumberFirst message to read. A value of 0 means read the first message
limitnumberOptional limit to provide to the function. By default 50 messages are read

readAttachment(block_id, descriptor_id) -> Attachment | WindowsError

Read and extract and attach from provided block and descriptor IDs. The IDs can be obtained from the readMessages function. If there are no IDs in the MessageDetails object then the message has no attachment

ParamTypeDescription
block_idnumberBlock ID associated with attachment
descriptor_idnumberDescriptor ID associated with attachment

parseWordWheel(path) -> WordWheelEntry[] | WindowsError

Reads the provided glob path and parses all NTUSER.DAT files looking for WordWheel entries.

ParamTypeDescription
pathstringGlob to NTUSER.DAT file(s)

assembleScriptblocks(path) -> Scriptblock[] | WindowsError

Parses the Windows Microsoft-Windows-PowerShell%4Operational.evtx file and reassembles PowerShell Scriptblocks.
You may provided an optional alternative path to Microsoft-Windows-PowerShell%4Operational.evtx.

ParamTypeDescription
pathstringOptional alternative path to Microsoft-Windows-PowerShell%4Operational.evtx

firwallRules(path) -> FirewallRules[] | WindowsError

Extract Windows Firewall rules from the SYSTEM Registry file. By default artemis will use the SYSTEM Registry on the SystemDrive. You may provide an optional alternative SYSTEM file.

ParamTypeDescription
pathstringOptional alternative path to System Registry file