Windows CertUtil Decode File (2024)

Try in Splunk Security Cloud

Description

CertUtil.exe may be used to encode and decode a file, including PE and script code. Encoding will convert a file to base64 with -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- tags. Malicious usage will include decoding a encoded file that was downloaded. Once decoded, it will be loaded by a parallel process. Note that there are two additional command switches that may be used - encodehex and decodehex. Similarly, the file will be encoded in HEX and later decoded for further execution. During triage, identify the source of the file being decoded. Review its contents or execution behavior for further analysis.

  • Type: TTP
  • Product: Splunk Behavioral Analytics

  • Last Updated: 2022-02-16
  • Author: Michael Haag, Splunk
  • ID: b06983f4-8f72-11ec-ab50-acde48001122

Annotations

ATT&CK
Kill Chain Phase
  • Exploitation
NIST
  • DE.CM
CIS20
  • CIS 10
CVE

Search

1234567891011121314151617
 $main = from source | eval timestamp = time | eval metadata_uid = metadata.uid | eval process_pid = process.pid | eval process_file = process.file | eval process_file_path = process_file.path | eval process_file_name = lower(process_file.name) | eval process_cmd_line = process.cmd_line | eval actor_user = actor.user | eval actor_user_name = actor_user.name | eval actor_process = actor.process | eval actor_process_pid = actor_process.pid | eval actor_process_file = actor_process.file | eval actor_process_file_path = actor_process_file.path | eval actor_process_file_name = actor_process_file.name | eval device_hostname = device.hostname | where process_cmd_line LIKE "%decode%" AND process_file_name="certutil.exe" --finding_report--

Macros

The SPL above uses the following Macros:

Windows CertUtil Decode File (1)windows_certutil_decode_file_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Required fields

List of fields required to use this analytic.

  • process.pid
  • process.file.path
  • process.file.name
  • process.cmd_line
  • actor.user.name
  • actor.process.pid
  • actor.process.file.path
  • actor.process.file.name
  • device.hostname

How To Implement

To successfully implement this search you need to be ingesting information on process that include the name of the process responsible for the changes from your endpoints into the Endpoint datamodel in the Processes node. In addition, confirm the latest CIM App 4.20 or higher is installed and the latest TA for the endpoint product.

Known False Positives

Typically seen used to encode files, but it is possible to see legitimate use of decode. Filter based on parent-child relationship, file paths, endpoint or user.

Associated Analytic Story

RBA

Risk Score Impact Confidence Message
40.0 50 80 An instance of $parent_process_name$ spawning $process_name$ was identified on endpoint $dest_device_id$ by user $dest_user_id$ attempting to decode a file on disk.

Windows CertUtil Decode File (2)The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

Reference

Test Dataset

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI.Alternatively you can replay a dataset into a Splunk Attack Range

source | version: 4

Windows CertUtil Decode File (2024)

FAQs

What does certutil decode do? ›

CertUtil.exe may be used to encode and decode a file, including PE and script code. Encoding will convert a file to base64 with -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- tags. Malicious usage will include decoding a encoded file that was downloaded. Once decoded, it will be loaded by a parallel process.

How to use certutil to verify a certificate? ›

To Verify Using a Command
  1. Run the following command: certutil -URL <certificate.crt>
  2. In the pop-up, select CRLs (from CDP).
  3. Click Retrieve. The tool checks the CDP URL from the certificate itself and provide a status of Verified or Failed.
  4. Run this command twice against each certificate.
Nov 20, 2023

What does Certutil dump command do? ›

If certutil is run on a non-certificate authority, the command is run by default. If you only ran the "certutil" and "certutil -dump" commands。 It only display the current CA configuration, It doesn't have to do anything, it doesn't affect your system.

How to export a certificate using certutil? ›

Tips
  1. Log into the Root Certification Authority server with Administrator Account.
  2. Go to Start > Run. Enter the text Cmd and then select Enter.
  3. To export the Root Certification Authority server to a new file name ca_name.cer, type: Console Copy. certutil -ca.cert ca_name.cer.
Feb 25, 2024

What are certutil commands? ›

Certutil.exe is a command-line program installed as part of Certificate Services. You can use certutil.exe to display certification authority (CA) configuration information, configure Certificate Services, and back up and restore CA components. The program also verifies certificates, key pairs, and certificate chains.

Is decode the same as decrypt? ›

No, decoding and decrypting are not the same. Decoding is generally a reversible, algorithmic process where you transform data back to its original form. On the other hand, decryption is a security measure to restore encrypted data using a specific key.

How do I validate a certificate file? ›

The recommended order of these checks is:
  1. Check to see if the Private Key and Main/Server Certificate are in PEM format.
  2. Verify that the Private Key and Main/Server Certificate match.
  3. Verify that the Public Key contained in the Private Key file and the Main/Server Certificate are the same.
Jul 26, 2023

How do I validate my certificate? ›

You can use Digital Certificate Manager (DCM) to validate individual certificates or the applications that use them. The list of things that DCM checks differs slightly depending on whether you are validating a certificate or an application.

How to use certutil to check SHA256? ›

How to
  1. In a command line, run the command: For Windows: certutil -hashfile [file location] SHA256 . For example: certutil -hashfile C:\Users\user1\Downloads\software.zip SHA256. ...
  2. Compare the value returned by the command line with the value from the pop over of the file in the Download Center interface.

How to get hash using certutil? ›

Solution:
  1. Open the Windows command line. Press Windows + R, type cmd and press Enter. ...
  2. Go to the folder that contains the file whose MD5 checksum you want to check and verify. Command: Type cd followed by the path to the folder. ...
  3. Type the command below certutil -hashfile <file> MD5. ...
  4. Press Enter.
Mar 30, 2023

Where do I run Certutil command? ›

The Directory Server has a command-line tool, certutil , which locally creates self-signed CA and client certificates, certificate databases, and keys. The default location for the Directory Server certutil tool is /usr/lib/dirsec/ .

How do I view the details of a PFX file? ›

The contents of a pfx file can be viewed in the GUI by right-clicking the PFX file and selecting Open (instead of the default action, Install). This will open mmc and show the pfx file as a folder. Open the pfx folder and the Certificates subfolder, and you will see the certificate(s) contained in the pfx.

How do I import a certificate into Certutil? ›

To import a certificate with Certutil:
  1. Open the command prompt as administrator (elevated) and use the certutil.exe: ...
  2. After you run this command, you are prompted for the password of the p12 file.
  3. Enter the certificate file password.
Mar 20, 2024

How to extract root certificate from .cer file? ›

Content
  1. Double-click the Certificate to open the file.
  2. Go to the Certification Path tab, highlight the first certificate (Root), then click the View Certificate.
  3. Go to the Details Tab and hit Copy to file.
  4. This would open the Certificate Export Wizard and Hit Next.
  5. Select Base-64, then hit Next.
  6. Save the file as Root.
Jul 31, 2023

What is the difference between CER and CRT files? ›

crt the same? Almost. The primary difference between CER and CRT file extensions is convention and naming. Technically, there is no inherent distinction in the content or format of the digital certificate files.

How to use certutil to check MD5? ›

Solution:
  1. Open the Windows command line. Press Windows + R, type cmd and press Enter. ...
  2. Go to the folder that contains the file whose MD5 checksum you want to check and verify. Command: Type cd followed by the path to the folder. ...
  3. Type the command below certutil -hashfile <file> MD5. ...
  4. Press Enter.
Mar 30, 2023

What do you know about decode in computer? ›

In computers, encoding is the process of putting a sequence of characters (letters, numbers, punctuation, and certain symbols) into a specialized format for efficient transmission or storage. Decoding is the opposite process -- the conversion of an encoded format back into the original sequence of characters.

What is the command to check SSL certificate in Windows? ›

To check if SSL certificate is installed, you can use the Certificate Manager tool and check its validity period. Another alternative option is to use the sigcheck Windows Sysinternals utility to verify TLS version. Download the utility and run it with the switch command sigcheck -tv.

Where to run certutil command? ›

The default location for the Directory Server certutil tool is /usr/lib/dirsec/ .

Top Articles
Latest Posts
Article information

Author: Nathanial Hackett

Last Updated:

Views: 5728

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Nathanial Hackett

Birthday: 1997-10-09

Address: Apt. 935 264 Abshire Canyon, South Nerissachester, NM 01800

Phone: +9752624861224

Job: Forward Technology Assistant

Hobby: Listening to music, Shopping, Vacation, Baton twirling, Flower arranging, Blacksmithing, Do it yourself

Introduction: My name is Nathanial Hackett, I am a lovely, curious, smiling, lively, thoughtful, courageous, lively person who loves writing and wants to share my knowledge and understanding with you.