利用Metasploit Framework之timestomp修改文件时间属性

简介

在后渗透中我们拿到meterpreter之后,常需要上传很多工具到目标机器,进一步的扩大战果。上传工具到靶机,就避免不了与目标机器的文件系统进行交互,这个过程难免会留下各种痕迹,这些痕迹信息如果处理不好,将会被作为安全服务人员取证溯源的重要依据。因此,在渗透测试过程中,我们要尽量减少与文件系统的交互,meterpreter就是依照这一思想设计的,它将各种模块加载到靶机的内存中,而不将文件写在磁盘上,这样做极大的减少了在系统上留下操作痕迹的几率。当我们必须要上传某些工具到目标靶机时,如何去躲避或者干扰管理员对文件系统信息的取证溯源呢?meterpreter又给了我们提供了priv模块下的timestop命令。
在这里插入图片描述

MACE时间

meterpreter > timestomp -v 1.txt
[*] Showing MACE attributes for 1.txt
Modified      : 1990-10-01 12:00:00 -0400
Accessed      : 2023-05-14 03:36:04 -0400
Created       : 1990-10-01 12:00:00 -0400
Entry Modified: 2023-05-14 03:36:11 -0400

Modified: 内容修改时间
Accessed: 文件访问时间
Created: 文件创建时间
Entry Modified: 在ntfs文件系统的主文件分区表MTF(master table file)存放,entry信息包含文件大小、名称、目录、磁盘位置、创建位置等信息,如果文件位置发生改变这个时间也会发生变化,或者修改文件名也会改变

timestomp的使用

很多不用记忆,随时查看帮助文档即可。

meterpreter > timestomp help

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

帮助文档已经很清楚了。

-v

查看MACE

meterpreter > timestomp -v 1.txt
[*] Showing MACE attributes for 1.txt
Modified      : 1990-10-01 12:00:00 -0400
Accessed      : 2023-05-14 03:36:04 -0400
Created       : 1990-10-01 12:00:00 -0400
Entry Modified: 2023-05-14 03:36:11 -0400

修改MACE

-m/-a/-c/-e
比如修改M:

meterpreter > timestomp -v 1.txt
[*] Showing MACE attributes for 1.txt
Modified      : 1990-10-01 12:00:00 -0400
Accessed      : 2023-05-14 03:36:04 -0400
Created       : 1990-10-01 12:00:00 -0400
Entry Modified: 2023-05-14 03:36:11 -0400
meterpreter > timestomp -m "10/01/2010 12:00:00" 1.txt
[*] Setting specific MACE attributes on 1.txt
meterpreter > timestomp -v 1.txt
[*] Showing MACE attributes for 1.txt
Modified      : 2010-10-01 12:00:00 -0400
Accessed      : 2023-05-14 03:36:04 -0400
Created       : 1990-10-01 12:00:00 -0400
Entry Modified: 2023-05-14 03:36:11 -0400

-a/-c/-e同理
这就是timestomp的基本使用。

猜你喜欢

转载自blog.csdn.net/miraclehw/article/details/130669650