https://github.com/yutianqaq/sharpfiletimesetter
用于自定义文件的时间属性
https://github.com/yutianqaq/sharpfiletimesetter
csharp pentest pentest-tool redteam
Last synced: about 1 year ago
JSON representation
用于自定义文件的时间属性
- Host: GitHub
- URL: https://github.com/yutianqaq/sharpfiletimesetter
- Owner: yutianqaq
- License: mit
- Created: 2025-01-25T07:18:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-25T07:57:38.000Z (over 1 year ago)
- Last Synced: 2025-07-01T03:05:50.483Z (about 1 year ago)
- Topics: csharp, pentest, pentest-tool, redteam
- Language: C#
- Homepage:
- Size: 49.8 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 简介
用于自定义文件时间属性,实现文件属性获取与自定义创建、修改、访问时间
还可以与同步指定文件的时间属性
# 帮助
```powershell
SharpFileTimeSetter.exe --help
Usage: SharpSharpFileTimeSetter --file [--get] [--creation ] [--modification ] [--access ]
SharpFileTimeSetter --sync
Example:
SharpFileTimeSetter --file test.txt --creation "2025-01-01 12:00:00" --modification "2025-01-02 14:00:00"
SharpFileTimeSetter --file test.txt --get
SharpFileTimeSetter --sync source.txt target.txt
Arguments:
--file Path to the target file (required).
--get Get the current creation, modification, and access time of the file.
--creation Creation time to set (optional, format: yyyy-MM-dd HH:mm:ss).
--modification Modification time to set (optional, format: yyyy-MM-dd HH:mm:ss).
--access Access time to set (optional, format: yyyy-MM-dd HH:mm:ss).
--sync Synchronize time properties from source file to target file.
Source file whose time will be copied.
Target file whose time will be updated.
```
## 例子
创建测试文件
```powershell
echo test > test
```
获取文件时间属性
```powershell
SharpFileTimeSetter.exe --file test --get
File: test
Creation Time: 2025/1/25 13:17:58
Modification Time: 2025/1/25 13:17:58
Access Time: 2025/1/25 13:17:58
```
修改文件属性
```powershell
SharpFileTimeSetter.exe --file test --creation "1999-09-09 12:00:00" --modification "1999-09-09 12:00:00" --access "1999-09-09 12:00:00"
Creation time set to 1999/9/9 12:00:00.
Modification time set to 1999/9/9 12:00:00.
Access time set to 1999/9/9 12:00:00.
File time properties updated successfully.
```
检查修改后的属性

同步指定文件的时间属性
```powershell
# 创建测试文件
PS D:\bin\Debug> echo test2 > test2
PS D:\bin\Debug> .\SharpFileTimeSetter.exe --file test2 --get
File: test2
Creation Time: 2025/1/25 13:22:20
Modification Time: 2025/1/25 13:22:20
Access Time: 2025/1/25 13:22:20
# 将文件 test 的时间属性同步给 test2
PS D:\bin\Debug> .\SharpFileTimeSetter.exe --sync test test2
Synced times from source 'test' to target 'test2'.
PS D:\bin\Debug> .\SharpFileTimeSetter.exe --file test2 --get
File: test2
Creation Time: 1999/9/9 12:00:00
Modification Time: 1999/9/9 12:00:00
Access Time: 2025/1/25 13:19:54
```