# The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend Maxim Sukhanov · CICADA8 Slides · https://2025.moscow-forensics-day.workers.dev/en/slides/14-suhanov-obratnaya-razrabotka An English version of the Russian deck shown in the recording: the text set by the authors is translated and redrawn in place, everything captured from a screen is left as it was. --- ## Page 1 — 06:35:59 MOSCOW FORENSICS DAY '25 IVIL MAXIM SUKHANOV “THE ROLE OF REVERSE ENGINEERING IN UNDERSTANDING ARTIFACTS: WHEN DOCUMENTATION IS THE ENEMY AND THE DECOMPILER IS A FRIEND” MFD MFD ## Page 2 — 06:36:15 CIOADA& The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend Maxim Sukhanov Head of Cyber Threat Detection and Incident Response at CICADA8 ## Page 3 — 06:36:34 ABOUT ME Previously worked at BI.ZONE, Group-IB 15 years in Digital Forensics, Incident Response, Malware Analysis, Threat Intelligence Reverse engineered the NTFS, FAT12/16/32, exFAT formats, the Windows registry, shadow copies I build utilities and libraries: yarp (Windows registry file parser), dfir_ntfs (parser for NTFS, FAT12/16/32 exFAT volumes and shadow copies), winmem_decompress (unpacker for compressed pages from memory dumps), and much more… I look for and find vulnerabilities in file system parsers, bootloaders and elsewhere MAXIM SUKHANOV Head of Cyber Threat Detection and Incident Response at CICADA8 m.suhanov@cicada8.ru CIOADA® ## Page 4 — 06:37:40 Problem There are observable artifacts, traces, anomalies… How, in principle, to justify their interpretation? Two approaches: Refer to someone: an article, a book, documentation, other people's results. Find the answer and justify it yourself: run an expert experiment, etc. CIOADA& ## Page 5 — 06:38:21 The problem in one quote “I trust the documentation” CIDADA: ## Page 6 — 06:38:51 02 “Deception” by vendors CIOADA® ## Page 7 — 06:39:26 No timestamps in NTFS! That's what the official documentation says [1][2]: STANDARD_INFORMATION structure 01/06/2021 [This structure is valid only for version 3 of NTFS volumes; it may be altered in future versions.] Contains the standard information attribute. This attribute is present in every base file record and must be resident. Syntax 4a Copy typedef struct _STANDARD_INFORMATION ( UCHAR Reserved[0x30]: ULONG OwnerId; ULONG SecurityId; } STANDARD_INFORMATION, *PSTANDARD_INFORMATION; Members Reserved Reserved. Ownerld The identifier of the file owner, from the security index. CIOADA8 Securityld The security identifier for the file. ## Page 8 — 06:40:01 FILE_NAME structure 01/07/2021 [This structure is valid only for version 3 of NTFS volumes; it may be altered in future versions.] Represents a file name attribute. A file has one file name attribute for every directory it is entered into. Syntax Copy typedef struct _FILE_NAME ( FILE_REFERENCE ParentDirectory; UCHAR Reserved[8x38]; UCHAR FileNameLength; UCHAR Flags; WCHAR FileName 1]; } FILE_NAME, *PFILE_NAME; Members ParentDirectory A file reference to the directory that indexes to this name. See MFT_SEGMENT_REFERENCE. Reserved Reserved. FileNameLength The length of the file name, in Unicode characters. Flags The file name flags. FILE NAME_NTFS (0x01) FILE_NAME_DOS (0x02) CIOADAB FileName The first character of the file name. ## Page 9 — 06:40:29 Answer Apparently the vendor protects NTFS internals from “clumsy hands”. So the “unneeded” fields are “reserved”. CIOADA8 ## Page 10 — 06:41:09 03 Forgot that things have changed CIOADAS ## Page 11 — 06:42:20 User data has vanished from the shadow copy! But that can't happen [3]! Can I exclude files from a shadow copy to save space? VSS is designed to create shadow copies of entire volumes. Temporary files, such as paging files, are automatically History active omitted from shadow copies to save space. 0000 1F80: 00 00 00 00 00 00 00 00 00 09 00 09 00 00 00 00 0000 1F90: 00 00 IFAO: 0000 To exclude specific files from shadow copies, use the following registry key: FilesNot ToSnapshot. ДрЕ Притка 0000 1FB0: 0000 1FCO: 0000 1FDO: • Note 0000 1FEO: 0000 1FFO: 0000 2000: 00 00 08 00 The FilesNotToSnapshot registry key is intended to be used only by applications. Users who attempt to use it History vss dfir ntfs encounter limitations such as: 00 00 00 00 00 00 00 00 06 0000 1F80: 00 08 00 00 00 00 0000 1F90: 00 00 0000 IFAO: • It can't delete files from a shadow copy that was created on a Windows Server by using the Previous Versions 0000 1FB0: 0000 1FCO: feature. 0000 1FDO: • It can't delete files from shadow copies for shared folders. 0000 1FEO: 0000 1FFO- • It can delete files from a shadow copy that was created by using the Diskshadow utility, but it can't delete files 0000 2000: 00 00 from a shadow copy that was created by using the VssAdmin utility. • Files are deleted from a shadow copy on a best-effort basis. This means that they aren't guaranteed to be deleted. CIOADA: For more information, see Excluding Files from Shadow Copies. ## Page 12 — 06:43:58 Answer From Windows 8 on, user files are excluded from the shadow copy by default. But in some cases they still get in! This behavior was never officially documented. At least two vendor replies to customers describing this behavior are known… One of them in the context of a ransomware attack! [4] We have also received a response from Microsoft indicating that it is highly likely this function is the cause of the file corruption. Although the reasons for this specification change have not been made public, we speculate that it is related to performance issues from saving all data into a snapshot, utilization efficiency issues in the snapshot area, excessive expansion of user data, and the fact that "file history" is now recommended for backing up user data. CIDADA ## Page 13 — 06:45:50 Details First the shadow copy is created, then clusters with user data are excluded from it. The exclusion process is handled by “SrTasks.exe”. User files are found by built-in rules (by extension, in particular) by iterating over the records in $MFT. CIDADAB ## Page 14 — 06:47:42 They documented a different file system implementation… Not from Windows NT, but from Windows 95 [5]! Yes, the (in) famous fatgen103.pdf document, retired from Microsoft's own site, but still available at https://web.archive.org/web/20210723100623/http://download.microsoft.com/ It sternly says at page 14: "It is really quite simple how this works. The FAT type one of FAT12, FAT16, or FAT32-is determined by the count of clusters on the volume and nothing else." But see below...: \> But as Alain pointed Microsoft FAT implementation (fastfat.sys) for > FAT32 detection does not use number of clusters, but rather explicit > marking of FAT32. Same behavior has Linux kernel implementation \> (msdos.ko and vfat.ko) and same in dosfstools project. Hence this > non-standard FAT32 can be still created by mkfs. fat. Actually, what I meant in my previous mail was that *everything else* that is referred to in the FAT32 extended boot block (root directory location, etc.) would depend on this explicit marking (fatLen/bigFatLen), but not the number of FAT bits themselves. However, your remark got me thinking, and so I tried it out on a Windows 10 VM. ...and lo and behold: the mere presence of a FAT32 extended boot block (as signaled by fat_len being 0) was enough to make it use 32 fat bits, even if the number of clusters was too low for FAT32. CIOADA& Sorry for having been to easily misled by an assertive, but nonfactual, Microsoft statement. ender presence of 132 extended boat blunt as weet for that ingle consider appropriate number of FAT bits. Regards, Alain ## Page 15 — 06:48:43 04 Case: Prefetch CIOADA& ## Page 16 — 06:49:04 What is stored in these files? Op-EXPLORER.EXE-[...H-[...].pf CIDADA• ## Page 17 — 06:49:46 Hypotheses and versions 1. A trojan, perhaps? 2. […] when the program itself requests tracking of itself 3. boot prefetch 4. […] a process […] living purely in RAM The right answer is in the ASP.NET blog [6], but the artifact (the file “Op-*.pf”) is mentioned in passing… CIOADA& ## Page 18 — 06:50:49 The right answer from the blog The features simple uses the operation recorder API. See OperationStart and OperationEnd APls on msdn. This APls require an integer used as an Id of the operation. We use a hash code of the app domain app id, which is a string. string domainId = HttpRuntime.AppDomainAppId; int operationId = domainId.GetHashCode(); The OperationStart call is made the first time the app domain is created. The OperationEnd API is called at the end of the request in which we called OperationStart. A .pf file should be created on the prefetch directory: C:>dir SwindirsPrefetch Volume in drive C has no label. Volume Serial Number is CC5B-113C Directory of C:WindowsPrefetch 02/16/2012 04:17 PM