This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: (@ZGittins, https://github.com/zaneGittins) | |
# Useful PowerShell cmdlet for penetration tests which involve maintaining persistence & lateral movement. | |
# This script uses a reference file - Why? It is easy to flag a file as an anomoly if all the nanoseconds are zero'd out. | |
function Set-StompedTime { | |
[CmdletBinding()] | |
param([Parameter(Mandatory=$true)][string]$TargetPath) | |
$TargetFile = Get-Item $TargetPath | |
$ParentDirectory = $Item.Parent | |
$SiblingFiles = Get-Childitem $ParentDirectory | |
$SiblingFiles = $SiblingFiles | Where-Object { $_ –ne $TargetFile } |
NewerOlder