# Stompy | Timestomp Tool To Flatten MAC Times With A Specific Timestamp

**URL:** <https://onehack.st/t/stompy-timestomp-tool-to-flatten-mac-times-with-a-specific-timestamp/274700>\
**Category:** Tools & Scripts\
**Tags:** tools, programming, hacking, freebies\
**Created:** [February 7, 2024, 8:25pm UTC](https://onehack.st/t/stompy-timestomp-tool-to-flatten-mac-times-with-a-specific-timestamp/274700 "2024-02-07T20:25:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoBody](https://onehack.st/user_avatar/onehack.st/nobody/32/163880_2.png) [@NoBody](https://onehack.st/u/NoBody)\
**Post date:** [February 7, 2024, 8:25pm UTC](https://onehack.st/t/stompy-timestomp-tool-to-flatten-mac-times-with-a-specific-timestamp/274700/1 "2024-02-07T20:25:43Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/f/0/f09cdbbc663553533165101761f3b98e8cc0c870.jpeg)

# Stompy

A PowerShell function to perform timestomping on specified files and directories. The function can modify timestamps recursively for all files in a directory.

- Change timestamps for individual files or directories.
- Recursively apply timestamps to all files in a directory.
- Option to use specific credentials for remote paths or privileged files.

I’ve ported Stompy to C#, Python and Go and the relevant versions are linked in this repo with their own readme.

- [C# version](https://github.com/ZephrFish/Stompy/tree/main/StompySharps).
- [Python](https://github.com/ZephrFish/Stompy/tree/main/StomPY)
- [Go](https://github.com/ZephrFish/Stompy/tree/main/GoStompy)

## Usage

- `-Path`: The path to the file or directory whose timestamps you wish to modify.
- `-NewTimestamp`: The new DateTime value you wish to set for the file or directory.
- `-Credentials`: (Optional) If you need to specify a different user’s credentials.
- `-Recurse`: (Switch) If specified, apply the timestamp recursively to all files in the given directory.

## Usage Examples

Specify the `-Recurse` switch to apply timestamps recursively:

1. Change the timestamp of an individual file:

```auto
Invoke-Stompy -Path "C:\path\to\file.txt" -NewTimestamp "01/01/2023 12:00:00 AM"

```

1. Recursively change timestamps for all files in a directory:

```auto
Invoke-Stompy -Path "C:\path\to\file.txt" -NewTimestamp "01/01/2023 12:00:00 AM" -Recurse 

```

1. Use specific credentials:

```auto
$creds = Get-Credential
Invoke-Stompy -Path "C:\path\to\file.txt" -NewTimestamp "01/01/2023 12:00:00 AM" -Recurse -Credential $creds

```

## Demo:

[![image](https://private-user-images.githubusercontent.com/5783068/275293700-0ba615ca-ba50-4435-be5c-2e9b0983bc2b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDczMzYzODUsIm5iZiI6MTcwNzMzNjA4NSwicGF0aCI6Ii81NzgzMDY4LzI3NTI5MzcwMC0wYmE2MTVjYS1iYTUwLTQ0MzUtYmU1Yy0yZTliMDk4M2JjMmIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAyMDdUMjAwMTI1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NGU0ZjU2M2RiMzM5OWIwNGEwMzkwZTlkOTViMzhmZThhYmU0Y2Q1ZmU2MWE5NDQ2YzQ5ODc5ZTI2ZjI4ZmYzMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.jPAwg7WHbZbXgDSVdORGazD-FULyhJbMK3ub2ZKjqDw)](https://private-user-images.githubusercontent.com/5783068/275293700-0ba615ca-ba50-4435-be5c-2e9b0983bc2b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250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2lkPTAifQ.I4xO5vRJs0LKOBjnuD2DgWP7PydoB0gxIQCqC5DJp2Q)

## GitHub:

> **[GitHub - ZephrFish/Stompy: Timestomp Tool to flatten MAC times with a...](https://github.com/ZephrFish/Stompy)**
>
> Timestomp Tool to flatten MAC times with a specific timestamp
