comando_stat_access_modify_change
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| comando_stat_access_modify_change [2022/08/07 00:43] – busindre | comando_stat_access_modify_change [2022/08/11 23:44] (current) – busindre | ||
|---|---|---|---|
| Line 57: | Line 57: | ||
| # NOTA: Se puede utilizar indistintamente -a, --time=atime, | # NOTA: Se puede utilizar indistintamente -a, --time=atime, | ||
| - | # Copiar las marcas de tiempo de otro fichero. | + | # Copiar las marcas de tiempo de otro fichero |
| - | # NOTA: Los timestamps de " | + | # NOTA: Los timestamps de " |
| - | touch fichero -r otro_fichero.txt # Se puede utilizar -a y -m si solo interesa copiar " | + | touch fichero -r fichero_referencia.txt # Se puede utilizar -a y -m si solo interesa copiar " |
| # Si el archivo llamado " | # Si el archivo llamado " | ||
| Line 74: | Line 74: | ||
| NOTA: El timestamp de " | NOTA: El timestamp de " | ||
| + | |||
| + | **Hack para falsear de manera aproximada la fecha de creación/ | ||
| + | |||
| + | No es factible cambiar los timestamps de " | ||
| + | |||
| + | En este ejemplo se clonarán los tres timestamps de un " | ||
| + | |||
| + | Sin campo Birth. | ||
| + | <code bash> | ||
| + | # Fechas del fichero_hack y fichero referente. | ||
| + | |||
| + | File: ' | ||
| + | Access: 2019-08-07 23: | ||
| + | Modify: 2019-08-07 23: | ||
| + | Change: 2019-08-07 23: | ||
| + | | ||
| + | |||
| + | File: ' | ||
| + | Access: 2019-08-07 17: | ||
| + | Modify: 2018-07-31 17: | ||
| + | Change: 2020-08-30 08: | ||
| + | | ||
| + | |||
| + | # Se clonan los timestamps de acceso y modificación en la fecha exacta de " | ||
| + | date --set=" | ||
| + | |||
| + | File: ' | ||
| + | Access: 2019-08-07 17: | ||
| + | Modify: 2018-07-31 17: | ||
| + | Change: 2020-08-30 08: | ||
| + | | ||
| + | |||
| + | File: ' | ||
| + | Access: 2019-08-07 17: | ||
| + | Modify: 2018-07-31 17: | ||
| + | Change: 2020-08-30 08: | ||
| + | | ||
| + | </ | ||
| + | |||
| + | |||
| + | Con el campo " | ||
| + | <code bash> | ||
| + | # Se crea el fichero filehack mediante una copia de un fichero en la fecha de creación del fichero_referente. | ||
| + | # Si el campo Birth del fichero referencia es 2012-03-30 08: | ||
| + | date --set=" | ||
| + | |||
| + | # Con eso actualmente file_hack ya tendrá dicha fecha de creación. Ahora simplemente se debe proceder como en el caso anterior para cambiar " | ||
| + | </ | ||
| + | |||
| + | Si se quiere volver rápidamente al tiempo del sistema " | ||
| + | <code bash> | ||
| + | |||
| + | Algunos logs generados por el cambio de hora del sistema. | ||
| + | < | ||
| + | systemd[1]: Starting Discard unused blocks on filesystems from / | ||
| + | systemd[1]: Starting Rotate log files... | ||
| + | systemd[1]: Starting Daily man-db regeneration... | ||
| + | systemd[1]: Started Verify integrity of password and group files. | ||
| + | systemd[1]: shadow.service: | ||
| + | systemd[1]: logrotate.service: | ||
| + | systemd[1]: Finished Rotate log files. | ||
| + | systemd[1]: man-db.service: | ||
| + | audit: BPF prog-id=0 op=UNLOAD | ||
| + | systemd[1]: Finished Daily man-db regeneration. | ||
| + | audit: BPF prog-id=0 op=UNLOAD | ||
| + | kernel: audit: type=1334 audit(1660253972.419: | ||
| + | kernel: audit: type=1334 audit(1660253972.419: | ||
| + | fstrim[39947]: | ||
| + | systemd[1]: fstrim.service: | ||
| + | systemd[1]: Finished Discard unused blocks on filesystems from / | ||
| + | |||
| + | |||
| + | NOTA: Recordar que depende de la capacidad de procesamiento pueden encontrarse diferencias en los nanosegundos. Si se opera varias veces el mismo comando y siempre se obtiene la misma diferencia de tiempo con el fichero referencia, se puede hacer una simple resta para ir unos nanosegundos más al pasado e intentar compensar. | ||
| + | |||
| + | Al utilizar el comando date para cambiar la fecha, por debajo se hace una llamada al sistema del tipo " | ||
comando_stat_access_modify_change.1659825816.txt.gz · Last modified: 2022/08/07 00:43 by busindre
