homepage
Menu
Open menu
  • Training
    Go one level top Back

    Training

    • Courses

      Build cyber prowess with training from renowned experts

    • Hands-On Simulations

      Hands-on learning exercises keep you at the top of your cyber game

    • Certifications

      Demonstrate cybersecurity expertise with GIAC certifications

    • Ways to Train

      Multiple training options to best fit your schedule and preferred learning style

    • Training Events & Summits

      Expert-led training at locations around the world

    • Free Training Events

      Upcoming workshops, webinars and local events

    • Security Awareness

      Harden enterprise security with end-user and role-based training

    Featured: Solutions for Emerging Risks

    Discover tailored resources that translate emerging threats into actionable strategies

    Risk-Based Solutions

    Can't find what you are looking for?

    Let us help.
    Contact us
  • Learning Paths
    Go one level top Back

    Learning Paths

    • By Focus Area

      Chart your path to job-specific training courses

    • By NICE Framework

      Navigate cybersecurity training through NICE framework roles

    • DoDD 8140 Work Roles

      US DoD 8140 Directive Frameworks

    • By European Skills Framework

      Align your enterprise cyber skills with ECSF profiles

    • By Skills Roadmap

      Find the right training path based on critical skills

    • New to Cyber

      Give your cybersecurity career the right foundation for success

    • Leadership

      Training designed to help security leaders reduce organizational risk

    • Degree and Certificate Programs

      Gain the skills, certifications, and confidence to launch or advance your cybersecurity career.

    Featured

    New to Cyber resources

    Start your career
  • Community Resources
    Go one level top Back

    Community Resources

    Watch & Listen

    • Webinars
    • Live Streams
    • Podcasts

    Read

    • Blog
    • Newsletters
    • White Papers
    • Internet Storm Center

    Download

    • Open Source Tools
    • Posters & Cheat Sheets
    • Policy Templates
    • Summit Presentations
    • SANS Community Benefits

      Connect, learn, and share with other cybersecurity professionals

    • CISO Network

      Engage, challenge, and network with fellow CISOs in this exclusive community of security leaders

  • For Organizations
    Go one level top Back

    For Organizations

    Team Development

    • Why Partner with SANS
    • Group Purchasing
    • Skills & Talent Assessments
    • Private & Custom Training

    Leadership Development

    • Leadership Courses & Accreditation
    • Executive Cybersecurity Exercises
    • CISO Network

    Security Awareness

    • End-User Training
    • Phishing Simulation
    • Specialized Role-Based Training
    • Risk Assessments
    • Public Sector Partnerships

      Explore industry-specific programming and customized training solutions

    • Sponsorship Opportunities

      Sponsor a SANS event or research paper

    Interested in developing a training plan to fit your organization’s needs?

    We're here to help.
    Contact us
  • Talk with an expert
  • Log In
  • Join - it's free
  • Account
    • Account Dashboard
    • Log Out
  1. Home >
  2. Blog >
  3. Mass Triage Part 4: Processing Returned Files – AppCache/Shimcache
Keven Murphy

Mass Triage Part 4: Processing Returned Files – AppCache/Shimcache

September 25, 2019

Our story so far...

Hermes starts reviewing malware review of wde.exe, ght.exe, and vc.exe procured through FRAC. Meanwhile Frank, starts on the Shimcache review now that the AT jobs review has been completed. Frank asks another team member Chris, to start on conducting forensics on some of the boxes that have a higher number of suspicious AT jobs and tools. Up to now they have about they have 15 boxes accessed by the actor.

AppCache/Shimcache Introduction

In a nutshell, the AppCache isused by Windows to help make sure older applications will work with newer versions of Windows. Mr. Tim Newton written a MS blog post explaining how the Shims work. The AppCache details are stored in the SYSTEM hive. In regards to the forensics value of the Shimcache, the details recorded in the registry can be used to help determine if malware has executed on the system, the last modified timestamp of the file executed from $Standard_Information, and file size. In essence, it goes to back viewing the registry as a log of what was ran on the system.

The table below shows some example output from Carvey’s RegRipper converted to table format for easier viewing.

Program Ran Modified Timestamp of File Executed
C:\Windows\mf.bat ModTime: Mon Aug 8 19:09:39 2016 Z Executed
C:\Windows\system32\ga86.exe ModTime: Wed Aug 3 00:20:56 2016 Z
C:\Windows\system32\rar.exe ModTime: Fri Jul 29 02:03:48 2016 Z Executed

For further details regarding conducting forensics on the Shimcache please see:

  • https://www.fireeye.com/blog/threat-research/2015/0 /caching_out_the_val.html
  • https://countuponsecurity.com/2016/05/18/digital-forensics-shimcache-artifacts/
  • Harlan Carvey’s Windows Registry Forensics books

ShimCache Analysis

The first part of conducting ShimCache Analysis is pulling all of the SYSTEM hives from all of machines on the network. Make sure there is plenty of space to house the hives as these files can fairly big. Next is to process all of the SYSTEM hives with RegRipper. To do this I use a modified version of the appcompatcache plugin. The modifications I did to the plugin was print out a tag, followed by the Shimcache line, and then the machine name. All of the lines printed out are sorted by filename and path. To run regripper on a set of files, I use the following command:

Windows:

find {directory with SYSTEM hives} -print -exec rip.exe -r {} -p appcompatcache_tln ; >> appcache{datetime}.txt

*NIX:

find {directory with SYSTEM hives} -print -exec rip.pl -r {} -p appcompatcache_tln \; >> appcache{datetime}.txt

An example line is below from the modified appcompatcache_tln plugin. The modification of the plugin adding the hostname to the output and some other minor things.

1395137092|REG|||M...|AppCompatCache|SYSVOL\Windows\Temp\9C23D78B-21D2-47E5-8697-783FE408CAF6\DismHost.exe|MACHINE1

The goal was to be able to quickly grep out the tag, AppCompatCache, from the output for processing. Note that the “|” was used to differentiate between fields.

The third step is to extract the AppCompatCache lines from the output. Then cut out the tag, sort the lines, and then unique with counts so that frequency analysis can be conducted.

Here is a summary of the steps so far:

1) Gather up SYSTEM hives

2) Run RegRipper on all system hives. Make sure to use the modified version.

Windows: find {directory with SYSTEM hives} -print -exec rip.exe -r {} -p appcompatcache_tln ; >> appcache{datetime}.txt

*NIX: find {directory with SYSTEM hives} -print -exec rip.pl -r {} -p appcompatcache_tln \; >> appcache{datetime}.txt

3) grep AppCompatCache appcache{datetime}.txt | cut -d\| -f7 | sort | uniq -c | sed 's/^[ \t]*//g' | sort -t" " -k2 > appcache{datetime}_freq.txt

At this point the {filename}.txt file can be reviewed. Like with the AT jobs, the number on the left is the number of times the file path and filename have been seen. The higher the counts, the more likely it is a benign file. As to what a high count is, depends on the environment. For example, if there is 8,000 counts for “C:\Windows\hh.exe” in a 10,000 desktop network, then most likely hh.exe is benign.

One of the problems with reviewing the output (step 3) at this point is the file can be quite huge. It all depends on the environment and how strict the security policy is. The looser the security policy, which means users can run anything they download, equals more lines to review. One of the ways to combat this is remove known good files.

ir_distill

ir_distill is a python script that takes the output from step 3 and compares the filename and full path to known good filenames and full paths. Shimcache doesn't contain MD5 hashes or any other hash type, so the comparison has to be done on filenames and full paths. An SQLite database is included with the script which contains the complete list of files and full paths for various MS operating systems. The database was generated using clean installs of the OS in a virtual machine. Then Sleuthkit's fls was used to pull back the filesystem information.

The command line arguments are the following:

-f SQLITE, --filecheck SQLITE SQLite database to check against

-i FILE, --infile FILE Input file

-o OUT, --out OUT Output results to file; creates a

OUT_nomatch.txt file

--showallmatches Shows all OS matches in output

--ignorecase Ignore case when doing db lookups

I usually run the script like this:

./ir_file_distill_v0.3.py -f os.sqlite -i appcache{datetime}_freq.txt -o appcache{datetime}_distill --showallmatches --ignorecase

The “-i FILE” is used to designate the output from step 3. The script will go through this file line by line and lookup the full path and filename in the database. If there is no match, then it will write the output to the filename given in the -o option. Please note that the filename for items that do not match will have a “_nomatch.txt” added to the filename.

The “showallmatches” option is nice in that it will list all of the matches found during the comparison between the input file and the SQLite db. That way there no question later on what was and wasn't matched. This option will create file with the filename given with the -o option and will add a “_match.txt” to the filename.

Keep in mind that all matching is case sensitive. Typically, I run the command with the “ignorecase” option. This will turn off the case sensitivity within the database. It also makes the script run much longer. The script was designed for portability vs speed. A database like MySQL would probably be faster for the comparison vs SQLite.

Once the script is finished running, the analyst should review the “_nomatch.txt” file to look for badness. Below is a sample of the output.

1|\Windows\dchcfg64.exe 1|\Windows\dcmdev64.exe 1|\Windows\DfsrAdmin.exe 2|\Windows\system32\rar.exe 3|\Windows\mf.bat 3|\Windows\dwrcs\DWRCSh.DLL 5|\Windows\system32\za86.exe

The first column is the number of occurrences seen, followed by the “|” as the column delimiter. The last column is the full file path and filename. As you go through the list, remember Google is your friend. Lookup filenames and filenames with paths to try to determine what the executable is. Any filenames that appear random, that are short, or just look funny should be reviewed. The “rar.exe”, “mf.bat”, and “ga86.exe” were examples of APT malware. While the “rar.exe” file was not malware, it was sitting in the “C:\Windows\system32” directory. That is not normal.

Like the AT jobs, I put a “#km” after the line to mark it. Be sure to save the file often after marking something. Just in case the text viewer being used crashes or something else happens. Once I have reviewed the file I pull out all of the lines that have a “#km” in it using grep. Then it is a matter of using grep to pull the relevant lines from the output in step 2 (find command above) for the machine name. The machine name will be the last field in the line. FRAC or RIFT can then be used to pull the files for analysis to determine if the files are bad or not.

For example, to pull the interesting lines out and find the source machines:

  1. grep "#km" appcache{datetime}_distill_nomatch.txt | cut -f2- -d\| | cut -f1 -d\# | sed 's/[[:blank:]]*$//' | sed 's/\\/\\\\/g' | sed 's/\"//g' > appcache{datetime}_findings
  2. grep -i -f appcache{datetime}_freq_nomatch.lines appcache{datetime}.txt > appcache{datetime}_pullfiles.txt

In matters of time it takes to conduct the review all depends on how many lines that have to be reviewed and your experience with your environment. There have been times where I have reviewed 5000 Shimcaches in about an hour. Other environments have taken a day or two to conduct analysis. Remember that since there are no hashes associated with the analysis, thus potential badness could be missed. Working with the tool and adding your own whitelisting to the SQLite database is key to reducing the time it takes to review the Shimcaches and being able to spot badness.

All of the tools in this post can be downloaded at:

https://github.com/chaoticmachinery/mass_triage_tools

Next in Part 5

In Part 5, I will discuss reviewing amcache found in Windows 7 and above.

6.2.5

Share:
TwitterLinkedInFacebook
Copy url Url was copied to clipboard
Subscribe to SANS Newsletters
Receive curated news, vulnerabilities, & security awareness tips
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
Cote D'ivoire
Croatia (Local Name: Hrvatska)
Curacao
Cyprus
Czech Republic
Democratic Republic of the Congo
Djibouti
Dominica
Dominican Republic
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Eswatini
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
Kiribati
Korea, Republic Of
Kosovo
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Liechtenstein
Lithuania
Luxembourg
Macau
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
North Macedonia
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
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Sint Maarten
Slovakia
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
Sweden
Switzerland
Taiwan
Tajikistan
Tanzania, United Republic Of
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 State
Venezuela
Vietnam
Virgin Islands (British)
Virgin Islands (U.S.)
Wallis And Futuna Islands
Western Sahara
Yemen
Zambia
Zimbabwe

By providing this information, you agree to the processing of your personal data by SANS as described in our Privacy Policy.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Recommended Training

  • FOR498: Digital Acquisition and Rapid Triage
  • ICS515: ICS Visibility, Detection, and Response™
  • FOR508: Advanced Incident Response, Threat Hunting, and Digital Forensics

Tags:
  • Digital Forensics, Incident Response & Threat Hunting

Related Content

Blog
DFIR_-_Blog_-_FOR498_-_Digital_Acquisition_&_Rapid_Triage_-_340x340_Thumb.jpg
Digital Forensics, Incident Response & Threat Hunting
April 12, 2023
SANS FOR498: Digital Acquisition & Rapid Triage
New Course Name, a Whole World of Data Extraction and Evidence Discovery Training
DFIR_ICON_(1).PNG
SANS DFIR
read more
Blog
Digital Forensics, Incident Response & Threat Hunting
July 13, 2020
iOS Full File System Extraction Using Checkra1n and iOS BFU Triage Script – Part 1
A single exploit that affects every iOS device made over an approximately 5-year period is massive.
370x370_Kevin-Ripa.jpg
Kevin Ripa
read more
Blog
Digital Forensics, Incident Response & Threat Hunting
September 25, 2019
Mass Triage Part 5: Processing Returned Files – Amcache
Our story so far... The list of IOCs is growing as the group conducts the triage. As they find new files related to the actor, the IR team goes back and searches the previous tools output to ensure everything has been picked up. With new files, mf.bat, ga86.exe, and rar.exe, from the ShimCache...
Keven Murphy
read more
  • Company
  • Mission
  • Instructors
  • About
  • FAQ
  • Press
  • Contact Us
  • Careers
  • Policies
  • Training Programs
  • Work Study
  • Academies & Scholarships
  • Public Sector Partnerships
  • Law Enforcement
  • SkillsFuture Singapore
  • Degree Programs
  • Get Involved
  • Join the Community
  • Become an Instructor
  • Become a Sponsor
  • Speak at a Summit
  • Join the CISO Network
  • Award Programs
  • Partner Portal
Subscribe to SANS Newsletters
Receive curated news, vulnerabilities, & security awareness tips
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
Cote D'ivoire
Croatia (Local Name: Hrvatska)
Curacao
Cyprus
Czech Republic
Democratic Republic of the Congo
Djibouti
Dominica
Dominican Republic
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Eswatini
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
Kiribati
Korea, Republic Of
Kosovo
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Liechtenstein
Lithuania
Luxembourg
Macau
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
North Macedonia
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
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Sint Maarten
Slovakia
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
Sweden
Switzerland
Taiwan
Tajikistan
Tanzania, United Republic Of
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 State
Venezuela
Vietnam
Virgin Islands (British)
Virgin Islands (U.S.)
Wallis And Futuna Islands
Western Sahara
Yemen
Zambia
Zimbabwe

By providing this information, you agree to the processing of your personal data by SANS as described in our Privacy Policy.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
  • Privacy Policy
  • Terms and Conditions
  • Do Not Sell/Share My Personal Information
  • Contact
  • Careers
© 2025 The Escal Institute of Advanced Technologies, Inc. d/b/a SANS Institute. Our Terms and Conditions detail our trademark and copyright rights. Any unauthorized use is expressly prohibited.
  • Twitter
  • Facebook
  • Youtube
  • LinkedIn