> For the complete documentation index, see [llms.txt](https://viperone.gitbook.io/pentest-everything/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://viperone.gitbook.io/pentest-everything/everything/everything-active-directory/defense-evasion/indicator-removal/timestomp.md).

# Timestomp

**ATT\&CK ID:** [T1070.007](https://attack.mitre.org/techniques/T1070/006/)

**Description**

Adversaries may modify file time attributes to hide new or changes to existing files. Timestomping is a technique that modifies the timestamps of a file (the modify, access, create, and change times), often to mimic files that are in the same folder. This is done, for example, on files that have been modified or created by the adversary so that they do not appear conspicuous to forensic investigators or file analysis tools.

Timestomping may be used along with file name Masquerading to hide malware and tools.

\[[Source](https://attack.mitre.org/techniques/T1070/006/)]

## Techniques

### Empire

```
usemodule powershell/management/timestomp

> set FilePath "C:\Secrets\SecretNotes.txt"
> set Modified 10/10/2020 12:00pm
> set Accessed 10/10/2020 13:00pm
> execute 
```

![](/files/XMIPtWyzwDmVi4PTebyH)

### Metasploit

```
# Meterpreter shell

Usage: timestomp <file(s)> OPTIONS

OPTIONS:

    -a   Set the "last accessed" time of the file
    -b   Set the MACE timestamps so that EnCase shows blanks
    -c   Set the "creation" time of the file
    -e   Set the "mft entry modified" time of the file
    -f   Set the MACE of attributes equal to the supplied file
    -h   Help banner
    -m   Set the "last written" time of the file
    -r   Set the MACE timestamps recursively on a directory
    -v   Display the UTC MACE values of the file
    -z   Set all four attributes (MACE) of the file
```

View current MACE information

```
timestomp "C:\Secrets\SecretNote.txt" -v
```

![](/files/x0zjt1bcqo6wXWwF0RDs)

Set all MACE attributes

```
timestomp "C:\Secrets\SecretNote.txt" -z "02/02/2020 23:13:23"
```

![](/files/XI3uRDWCCiRSuVx3UVak)

Recursively blank all MACE Attributes

```
timestomp C:\\Secrets\\ -r
```

![](/files/k49rlanes8tuSNzGrfQo)

## Mitigation

This type of attack technique cannot be easily mitigated with preventive controls since it is based on the abuse of system features.

## Further Reading

**Timestomp:** <https://www.offensive-security.com/metasploit-unleashed/timestomp/>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://viperone.gitbook.io/pentest-everything/everything/everything-active-directory/defense-evasion/indicator-removal/timestomp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
