homepage
Open menu Go one level top
  • Train and Certify
    • Get Started in Cyber
    • Courses & Certifications
    • Training Roadmap
    • Search For Training
    • Online Training
    • OnDemand
    • Live Training
    • Summits
    • Cyber Ranges
    • College Degrees & Certificates
    • NICE Framework
    • DoDD 8140
    • Specials
  • Manage Your Team
    • Overview
    • Security Awareness Training
    • Voucher Program
    • Private Training
    • Workforce Development
    • Skill Assessments
    • Hiring Opportunities
  • Resources
    • Overview
    • Reading Room
    • Webcasts
    • Newsletters
    • Blog
    • Tip of The Day
    • Posters
    • Top 25 Programming Errors
    • The Critical Security Controls
    • Security Policy Project
    • Critical Vulnerability Recaps
    • Affiliate Directory
  • Focus Areas
    • Blue Team Operations
    • Cloud Security
    • Digital Forensics & Incident Response
    • Industrial Control Systems
    • Leadership
    • Offensive Operations
  • Get Involved
    • Overview
    • SANS Community
    • CyberTalent
    • Work Study
    • Instructor Development
    • Sponsorship Opportunities
    • COINS
  • About
    • About SANS
    • Why SANS?
    • Instructors
    • Cybersecurity Innovation Awards
    • Contact
    • Frequently Asked Questions
    • Customer Reviews
    • Press Room
  • Log In
  • Join
  • Contact Us
  • SANS Sites
    • GIAC Security Certifications
    • Internet Storm Center
    • SANS Technology Institute
    • Security Awareness Training
  • Search
  1. Home >
  2. Blog >
  3. Timestamped Registry & NTFS Artifacts from Unallocated Space
John McCash

Timestamped Registry & NTFS Artifacts from Unallocated Space

May 4, 2010

Frequently, while following up a Windows investigation, I will add certain filenames or other string values to my case wordlist and subsequently find these strings embedded in binary data of one type or another in unallocated space. Close examination of the surrounding data structures has shown that these are often old MFT entries, INDX structures, or registry keys or values. The thing that makes these things very interesting from a forensic perspective is that all of them but registry values incorporate Windows timestamps. (All timestamps referenced in this article are 64bit Windows filetime values.) Even registry values often follow closely after their parent keys in the registry, which do have associated timestamps. Once I'd noticed these key facts, it occurred to me that it would be useful to use the timestamp values to work backward to other associated data, and hence the genesis of this article.

The creation of a tool to automatically search through a disk image for Windows timestamps associated with all of the above record types, regardless of whether they're associated with currently allocated filesystem space, and timeline them all (possibly cross-referencing them against other entries to determine their relative position within the filesystem or registry), would make a great Gold Paper... Anyone?

My approach to this problem started with the use of an EnCase EnScript created by Lance Mueller back in January of 2008. This EnScript allows the user to specify a date/time range, and then searches the selected files or disk areas for 64bit values which would fit within that range if interpreted as a Windows timestamp. Having a fairly narrow timeframe of interest will obviously be useful to minimize false positives. Once the results have been identified, it's necessary to examine each one to determine whether it's one of the record types of interest.

  • The detailed structure of NTFS Master File Table entries goes a bit beyond the scope of this blog posting. Salient points are that individual MFT records are a fixed 1024 bytes in size, they begin with the four signature characters 'FILE', and they contain within each of any associated Standard Information Attributes, 8.3 Filename Attributes, and Long Filename Attributes, four Windows timestamps: File Created, File Modified, MFT Changed, & File Read, in that order. (8 or 12 timestamps total, depending on whether or not the full filename fits in the 8.3 format) Guidance used to make several EnScripts (written by Howie Williamson) available which would bookmark and completely parse out all of the various record attributes. I've put in an inquiry as to why these seem to no longer be online. [Update: Guidance's response was that these scripts were provided as part of training, and "may contain little or no help documentation", so they do not publish them. As this is definitely not the case for the specific EnScripts I'm referring to, I've urged them to reconsider this decision.] Let's hope that they put them back up. Also, they may provide them in response to direct requests by customers [Ask for the StepMOM EnScript. They call it that because it's the Mother of all MFT EnScripts].
  • The INDX structure is how NTFS stores content information for Folders/Directories. Full INDX records are typically 4096 bytes long, begin with the four signature characters 'INDX', and following their header, contain a listing of both 8.3 and long filenames, along with an associated set of File Creation, File Modified, MFT Modified, and File Read timestamps for each. (4 or 8 timestamps total per file.) Guidance had another EnScript, also by Howie Williamson, which parsed INDX records as well. I've queried whether it can be re-released too. [Update: this script, "Index buffer reader", was apparently included in the Example folder in the most recent version of EnCase] The structure of the individual INDX record entry is as follows. (Note: To use the provided MFT references to locate the actual MFT records, multiply the value by 1024, and use it as an offset from the start of the MFT.)
    • MFT Reference of Index Entry (8 bytes) [NOT actual MFT entry number]
    • Size of index Entry (1 byte) [This size seems to include padding at the end of the record. The next one starts immediately following it.]
    • Filename offset (1 byte) [not sure what this refers to]
    • Flags (1 byte)
    • Padding (4 bytes)
    • Parent MFT Reference (8 bytes) [NOT actual MFT entry number]
    • File Create Time (8 bytes)
    • File Last Modified Time (8 bytes)
    • MFT Last Modified Time (8 bytes)
    • File Last Accessed Time (8 bytes)
    • Allocated Size of File (8 bytes)
    • Real Size of File (8 bytes)
    • File Flags (1 byte)
    • File Name Length (1 byte)
    • Filename (variable)
  • Registry keys are often found in unallocated space as well. The overall structure of registry hive files is discussed in detail in Peter Norris' MSc Thesis, The Internal Structure of the Windows Registry. The most salient bit for the purposes of this article is the NK Cell Template on page 137, in the Appendices. This table details the structure of the NK record. Essentially we have:
    • Cell Size (4 bytes)
    • Record signature 'nk' (2 bytes)
    • Flags (2 bytes)
    • The last written time of the registry key (8 bytes)
    • 60 bytes we don't really care about for the moment, including the following fields.
      • Spare (4 bytes)
      • Parent (Cell Index) (4 bytes)
      • SubKey Counts (Stable) (4 bytes)
      • SubKey Counts (Volatile) (4 bytes)
      • SubKey Lists (Stable) (Cell Index) (4 bytes)
      • SubKey Lists (Volatile) (Cell Index) (4 bytes)
      • Value List Count (4 bytes)
      • Value List List (4 bytes)
      • Security (Cell Index) (4 bytes)
      • Class (Cell Index)
      • Max Name Length (2 bytes)
      • User Flags (1 byte)
      • Debug (1 byte)
      • Max Class Length (4 bytes)
      • Max Value Name Length (4 bytes)
      • Max Value Data Length (4 bytes)
      • Work variable (4 bytes)
    • 2 bytes containing the length of the key name
    • Class length (2 bytes) [we don't care about this value for the moment either]
    • The name of the registry key (variable)
    • Padding (optional)

So in essence, if we find a timestamp with Lance's script, we can then search back a few hundred characters, and see if we encounter 'FILE', 'INDX', or 'nk'. If we do, then we determine whether the data can be interpreted as a record of the specified type, and if so, parse out the data.

On a complete side note, I find it somewhat disappointing that many forensic professionals seem unaware of the plethora of redundant timestamps that are present in NTFS. I hope that the next time there's some question as to whether a file's timestamp has been altered, you will all think to go check the long and 8.3 filename timestamps, as well as the timestamps on the long and 8.3 names inside the INDX entries of it's parent folder, to say nothing of the various unallocated timestamps that were the purpose of this article. They may fail to match up for reasons other than deliberate alteration, but if they do match, I consider that a fairly good indication (though by no means a guarantee) that they were not modified after the fact. In any case, a non-matching timestamp can be a springboard for additional inquiry.

As always, please feel free to leave commentary if you liked this article or want to call me on the carpet for some inaccuracy.

Share:
TwitterLinkedInFacebook
Copy url Url was copied to clipboard
Subscribe to SANS Newsletters
Join the SANS Community to receive the latest curated cybersecurity news, vulnerabilities, and mitigations, training opportunities, plus our webcast schedule.
United States
Canada
United Kingdom
Spain
Belgium
Denmark
Norway
Netherlands
Australia
India
Japan
Singapore
Afghanistan
Aland Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
Argentina
Armenia
Aruba
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belize
Benin
Bermuda
Bhutan
Bolivia
Bonaire, Sint Eustatius, and Saba
Bosnia And Herzegovina
Botswana
Bouvet Island
Brazil
British Indian Ocean Territory
Brunei Darussalam
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Cook Islands
Costa Rica
Croatia (Local Name: Hrvatska)
Curacao
Cyprus
Czech Republic
Democratic Republic of the Congo
Djibouti
Dominica
Dominican Republic
East Timor
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Falkland Islands (Malvinas)
Faroe Islands
Fiji
Finland
France
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Germany
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard And McDonald Islands
Honduras
Hong Kong
Hungary
Iceland
Indonesia
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Jersey
Jordan
Kazakhstan
Kenya
Kingdom of Saudi Arabia
Kiribati
Korea, Republic Of
Kosovo
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Liechtenstein
Lithuania
Luxembourg
Macau
Macedonia
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States Of
Moldova, Republic Of
Monaco
Mongolia
Montenegro
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
Northern Mariana Islands
Oman
Pakistan
Palau
Palestine
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Reunion
Romania
Russian Federation
Rwanda
Saint Bartholemy
Saint Kitts And Nevis
Saint Lucia
Saint Martin
Saint Vincent And The Grenadines
Samoa
San Marino
Sao Tome And Principe
Senegal
Serbia
Seychelles
Sierra Leone
Sint Maarten
Slovakia (Slovak Republic)
Slovenia
Solomon Islands
South Africa
South Georgia and the South Sandwich Islands
South Sudan
Sri Lanka
St. Helena
St. Pierre And Miquelon
Suriname
Svalbard And Jan Mayen Islands
Swaziland
Sweden
Switzerland
Taiwan
Tajikistan
Tanzania
Thailand
Togo
Tokelau
Tonga
Trinidad And Tobago
Tunisia
Turkey
Turkmenistan
Turks And Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United States Minor Outlying Islands
Uruguay
Uzbekistan
Vanuatu
Vatican City
Venezuela
Vietnam
Virgin Islands (British)
Virgin Islands (U.S.)
Wallis And Futuna Islands
Western Sahara
Yemen
Yugoslavia
Zambia
Zimbabwe

Tags:
  • Digital Forensics and Incident Response

Related Content

Blog
SUMMIT_Free_SANS_2021_Summits_Teaser.jpg
Digital Forensics and Incident Response, Cyber Defense Essentials, Industrial Control Systems Security, Purple Team, Blue Team Operations, Penetration Testing and Ethical Hacking, Cloud Security, Security Management, Legal, and Audit
November 30, 2020
Good News: SANS Virtual Summits Will Be FREE for the Community in 2021
They’re virtual. They’re global. They’re free.
Emily Blades
read more
Blog
En.png
Digital Forensics and Incident Response
November 24, 2020
SANS DFIR Presenta Nuevos Webcasts en Español
SANS DFIR presenta sus nuevos episodios en Español! En este blog podrás ver todos los episodios con concluciones y con recursos para aprender DFIR
SANS DFIR
read more
Blog
shutterstock_1473864617.jpg
Digital Forensics and Incident Response
October 14, 2020
Defense Spotlight: Finding Hidden Windows Services
Attackers can make a Window services disappear from view. Fortunately these services can still be found, through unconventional discovery techniques.
370x370_Joshua-Wright.jpg
Joshua Wright
read more
  • Register to Learn
  • Courses
  • Certifications
  • Degree Programs
  • Cyber Ranges
  • Job Tools
  • Security Policy Project
  • Posters
  • The Critical Security Controls
  • Focus Areas
  • Blue Team Operations
  • Cloud Security
  • Cybersecurity Leadership
  • Digital Forensics
  • Industrial Control Systems
  • Offensive Operations
Subscribe to SANS Newsletters
Join the SANS Community to receive the latest curated cybersecurity news, vulnerabilities, and mitigations, training opportunities, plus our webcast schedule.
United States
Canada
United Kingdom
Spain
Belgium
Denmark
Norway
Netherlands
Australia
India
Japan
Singapore
Afghanistan
Aland Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
Argentina
Armenia
Aruba
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belize
Benin
Bermuda
Bhutan
Bolivia
Bonaire, Sint Eustatius, and Saba
Bosnia And Herzegovina
Botswana
Bouvet Island
Brazil
British Indian Ocean Territory
Brunei Darussalam
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Cook Islands
Costa Rica
Croatia (Local Name: Hrvatska)
Curacao
Cyprus
Czech Republic
Democratic Republic of the Congo
Djibouti
Dominica
Dominican Republic
East Timor
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Falkland Islands (Malvinas)
Faroe Islands
Fiji
Finland
France
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Germany
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard And McDonald Islands
Honduras
Hong Kong
Hungary
Iceland
Indonesia
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Jersey
Jordan
Kazakhstan
Kenya
Kingdom of Saudi Arabia
Kiribati
Korea, Republic Of
Kosovo
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Liechtenstein
Lithuania
Luxembourg
Macau
Macedonia
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States Of
Moldova, Republic Of
Monaco
Mongolia
Montenegro
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
Northern Mariana Islands
Oman
Pakistan
Palau
Palestine
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Reunion
Romania
Russian Federation
Rwanda
Saint Bartholemy
Saint Kitts And Nevis
Saint Lucia
Saint Martin
Saint Vincent And The Grenadines
Samoa
San Marino
Sao Tome And Principe
Senegal
Serbia
Seychelles
Sierra Leone
Sint Maarten
Slovakia (Slovak Republic)
Slovenia
Solomon Islands
South Africa
South Georgia and the South Sandwich Islands
South Sudan
Sri Lanka
St. Helena
St. Pierre And Miquelon
Suriname
Svalbard And Jan Mayen Islands
Swaziland
Sweden
Switzerland
Taiwan
Tajikistan
Tanzania
Thailand
Togo
Tokelau
Tonga
Trinidad And Tobago
Tunisia
Turkey
Turkmenistan
Turks And Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United States Minor Outlying Islands
Uruguay
Uzbekistan
Vanuatu
Vatican City
Venezuela
Vietnam
Virgin Islands (British)
Virgin Islands (U.S.)
Wallis And Futuna Islands
Western Sahara
Yemen
Yugoslavia
Zambia
Zimbabwe
  • © 2021 SANS™ Institute
  • Privacy Policy
  • Contact
  • Twitter
  • Facebook
  • Youtube
  • LinkedIn