¿Imaging o triage? 🤔 ¿Es que nadie piensa en el ruido?

Hola, secuaces:

¿Alguna vez has querido escribir sobre algo, pero has sentido que ese algo se te 'atraganta'? ¿Alguna vez te has quedado bloqueado? Pues eso es lo que me ha ocurrido con este artículo, donde quiero mostrar mi punto de vista sobre el triage y la creación de imágenes forenses. Estoy 'espeso', (más de lo habitual). Sé lo que quería contar, pero no sabía muy bien cómo plantearlo.

Hace algún tiempo leí un fantástico artículo de Brett Shavers, (te recomiendo encarecidamente que lo leas), que lleva por título "Forensic imaging raises its head", y que publicó a raíz de un tweet de ForensicFocus. En dicho artículo, Brett, expone su opinión al respecto. ¿Triage o imaging?

Comparto plenamente la misma opinión que Brett en su artículo.

Personalmente, si dispongo del tiempo necesario, tengo los recursos necesarios, tengo autoridad y estoy capacitado... haré una imagen forense. Como siempre, todo dependiendo del caso de que se trate, (si es que puedes saber lo que te vas a encontrar antes de comenzar un análisis en una investigación forense).

Antes de continuar, permíteme hacer una observación...

La adquisición del volcado de memoria es una tarea prioritaria en cualquier caso en el que haya que intervenir en un sistema, tal y como expuse en un artículo anterior, debido a la gran importancia y gran volatilidad de los datos que contiene. Por ello hay que separarla de otros procesos de recolección, (como el triage), puesto que afectan negativamente a los datos almacenados en la memoria. Es decir, no se debe efectuar el volcado de memoria dentro de un proceso de triage.

Se ha escrito mucho, en muchos sitios, sobre el triage. No es un campo en el que yo haya profundizado. No es algo en lo que vaya a profundizar en este artículo.

Cuando se efectúa un triage, se recolecta, únicamente, información 'importante', (entrecomillado porque, ¿Qué es información importante?), por lo que se reduce el tiempo de adquisición y posterior análisis. Se buscan elementos específicos y necesarios para iniciar una posterior investigación, más profunda y exhaustiva. Al fin y al cabo, cuando se declara un incidente o se precisa intervenir en un sistema para realizar un examen previo de actividad, se necesitan datos rápidos.

Si el examen previo, (triage), se realiza de una manera satisfactoria, los investigadores podrán extraer información necesaria y de interés, para otro proceso posterior.

El triage es, sin duda alguna, una solución práctica para hacer frente a una investigación en la que el tiempo es un factor crítico, reduciendo el volumen de datos. Todo sea por tener un flujo de trabajo 'eficiente'. Pero lo que puedes creer como algo eficiente a veces no es lo mejor, lo más óptimo.

Por poner un ejemplo, podrías tener que intervenir en un sistema que está implicado, aparentemente, en un delito menor, (como una intrusión en otro sistema de una pequeña empresa), por lo que optas por realizar un triage. Pero cuando comiences con el análisis podrías ver que se trata de un delito mayor, (como un delito de terrorismo o de pornografía infantil). Con esto quiero decir que tú no sabrás realmente el alcance de una investigación hasta que no inicias la misma.

Hay que buscar un equilibrio.
El precio a pagar por la extracción rápida de datos es la pérdida de datos.
En este punto me veo en la obligación de mencionar a nuestro amigo Locard, porque no he visto que se hable de él cuando se habla del triage. No he visto a nadie hablar sobre algo que, personalmente, creo importante. El ruido.

Existen multitud de herramientas para efectuar un triage. Herramientas que provocan ruido. Ruido que puede hacer mucho daño en los ojos del investigador, cuando tenga que analizar una imagen forense.


Entiéndase por ruido la alteración masiva e innecesaria de datos que se provoca en un sistema que, además, puede provocar la pérdida de otros datos de interés. Pérdida de datos de interés que me gusta traducir como 'contaminación'.

Ese ruido no lo verás cuando estés analizando los datos extraídos mediante la realización de un triage. Pero sí lo verás en la posterior creación de una imagen forense, llegados el caso.

Como decía antes, existen multitud de herramientas para efectuar un triage. Tienes a tu disposición pequeñas utilidades, como las propias de NirSoft, (como LastActivityView o USBDeview). También tienes las propias de SysInternals, (como Autoruns o TCPView). Tienes a tu disposición distribuciones linux, enfocadas al análisis forense digital, que poseen otro conjunto de pequeñas utilidades, como pueden ser Tsurugi Linux, (con Bento), o Caine, (con WinUFO en versiones anteriores). Tienes a tu disposición un montón de herramientas, que ejecutan un conjunto de pequeñas utilidades, de terceras partes.

También tienes que tener en cuenta que, algunas de esas herramientas que ejecutan otro conjunto de utilidades de terceros, pueden ser detectadas como maliciosas y pueden hacer saltar las alarmas.

Y, ante esa situación, ¿Qué haces? ¿Desconectas el antivirus? Sea como fuere, ese simple hecho se traduce en una alteración, quizás innecesaria, del sistema.

Todo depende del caso, porque debes tener un plan.
Debes elegir el procedimiento y la herramienta adecuados para cada caso.
Y es aquí donde quiero llegar a parar. Es aquí donde voy a exponer mi opinión, con datos objetivos. Para ello, (y tras algunos quebraderos de cabeza y otros asuntos), he optado por realizar una serie de pruebas de triage en un sistema Windows 10, versión 18343.1, virtualizado bajo VirtualBox, con las siguientes herramientas, (gratuitas todas ellas):
Después de instalar el sistema virtualizado, conecté un dispositivo USB en el sistema y llevé a cabo una única acción. Tras efectuar esa acción, guardé el estado de la máquina virtual y creé un clon para cada una de las herramientas citadas. También creé un clon para proceder con un apagado normal del sistema. Una vez creados los clones de la máquina virtual, adelanté la fecha del sistema y procedí con la ejecución de la correspondiente herramienta de triage, desconectando la máquina virtual en el mismo instante en que cada una de las herramientas finaliza su ejecución. Al finalizar, desconecté la máquina original, como si le hubiera cortado el suministro eléctrico.

El proceso de adquisición de cada una de las herramientas mencionadas ha sido monitorizado con la utilidad Process Monitor v3.50, excluyendo las rutas de ejecución y de salida de los datos, e incluyendo únicamente la actividad relativa a los procesos implicados en la operación.

En adición a ese proceso de monitarización que he llevado a cabo, también he realizado una superlínea de tiempo con Plaso, que posteriormente he visualizado con Timeline Explorer.

A continuación te muestro mis resultados, sin entrar a valorar qué información extrae cada una de las herramientas.

AChoir



Con el uso de AChoir se han producido un total de 235.904 eventos.

Realizo dos filtrados más para ver cómo afecta al sistema su ejecución.

Esta herramienta ha provocado un total de 3.176 eventos de escritura en ficheros.


Y un total de 2.936 eventos de creación de ficheros.


Tras efectuar la línea de tiempo y mostrando únicamente las líneas que se encuentran entre la ejecución de la herramienta y su finalización, se muestran un total de 12.724 líneas de actividad.


Live Response Collection BambiRaptor



Con el uso de BambiRaptor se han producido un total de 7.482.923 eventos.

Realizo dos filtrados más para ver cómo afecta al sistema su ejecución.

Esta herramienta ha provocado un total de 15.237 eventos de escritura en ficheros.


un total de 268.187 eventos de creación de ficheros.


Tras efectuar la línea de tiempo y mostrando únicamente las líneas que se encuentran entre la ejecución de la herramienta y su finalización, se muestran un total de 46.384 líneas de actividad.


CyLR



Con el uso de CyLR se han producido un total de 16.601 eventos.

Realizo dos filtrados más para ver cómo afecta al sistema su ejecución.

Esta herramienta ha provocado un total de 958 eventos de escritura en ficheros.


un total de 113 eventos de creación de ficheros.


Tras efectuar la línea de tiempo y mostrando únicamente las líneas que se encuentran entre la ejecución de la herramienta y su finalización, se muestran un total de 507 líneas de actividad.


FastIR



Con el uso de FastIR se han producido un total de 26.386 eventos.

Realizo dos filtrados más para ver cómo afecta al sistema su ejecución.

Esta herramienta ha provocado un total de 1.712 eventos de escritura en ficheros.


un total de 5.947 eventos de creación de ficheros.


Tras efectuar la línea de tiempo y mostrando únicamente las líneas que se encuentran entre la ejecución de la herramienta y su finalización, se muestran un total de 6.420 líneas de actividad.


KAPE



Con el uso de KAPE se han producido un total de 177.507 eventos.

Realizo dos filtrados más para ver cómo afecta al sistema su ejecución.

Esta herramienta ha provocado un total de 1.840 eventos de escritura en ficheros.



un total de 6.455 eventos de creación de ficheros.



Tras efectuar la línea de tiempo y mostrando únicamente las líneas que se encuentran entre la ejecución de la herramienta y su finalización, se muestran un total de 6.918 líneas de actividad.


Conclusiones


Estas pruebas de triage han sido llevadas a cabo en el mismo instante en el que se ha llevado a cabo una acción determinada. Imagina por un momento qué puedes encontrar, (o que no vas a encontrar), en un sistema donde el tiempo transcurrido entre una acción y la intervención es de horas, días, o incluso semanas.

Visto el 'ruido' que son capaces de generar algunas herramientas, yo soy partidario de, siempre que sea posible, adquirir una imagen forense. Ya habrá tiempo de extraer los artefactos que hagan falta.

Un triage puede ser efectivo en algunos casos, si se usa la herramienta adecuada, o el procedimiento correcto. Ten en cuenta que, lo que tú crees que puede ser una opción adecuada se puede traducir en un procedimiento ineficaz de clasificación de artefactos y, por ende, de la priorización del caso que se trate.

Ser rápido en la extracción de datos no te garantiza que extraigas los datos necesarios para tu investigación. Busca un equilibrio. Planea bien tus pasos, porque sólo tendrás una oportunidad de efectuar un triage, (a menos que quieras generar más ruido y perder más datos).

Lo eficiente no suele ser lo más rápido. Cuando intervienes en un sistema, no sabes realmente qué puedes encontrar en él.

Si usas alguna herramienta, usa la adecuada para cada caso. Por ejemplo, la herramienta Live Response Collection BambiRaptor no extrae los logs transaccionales del Registro. Sin embargo, CyLR o KAPE sí los extraen. Por ejemplo, CyLR no genera reportes con la extracción de datos, mientras que KAPE sí lo hace.

Debes saber que, al igual que hay situaciones en las que no es posible apagar el sistema para realizar una imagen forense, (por lo que hay que adquirirla con el sistema vivo), también existen situaciones en las que puedes desconectar el sistema para efectuar un triage, (por lo que se evitará el ruido innecesario). Desconectar. No apagar. Porque la diferencia entre un paso y otro se traduce, de igual manera, en pérdida de información.


Por ejemplo, en esta prueba, el sistema ha generado 178 líneas al iniciar el proceso de apagado, mientras que al desconectar el sistema no se genera actividad alguna.


Piensa en el ruido. Ruido que molesta, que hace daño a los ojos y que conlleva una pérdida de datos.


Actualización: 20 de mayo de 2019


El único objetivo de este artículo ha sido el de mostrar que las herramientas que ejecutamos generan ruido durante su ejecución. Es cierto que mucho de ese ruido generado corresponde a eventos de sólo lectura. Pero no por ello dejan de ser eventos. Incluso dentro de los eventos de escritura de ficheros y de creación de ficheros, se repiten los mismos eventos de escritura y creación, sobre los mismos eventos. Pero esos eventos, están ahí.

En lo referente a los eventos de escritura de ficheros y de creación de ficheros, debo decir que mi principal preocupación radica en que cuando se escribe sobre un fichero, ese fichero aumenta de tamaño y que, cuando se crea un fichero, se asigna una entrada en la MFT. Si nos encontramos con un caso donde se ha eliminado un cierto tipo de contenido, (llámalo 'X'), el aumento de tamaño de un fichero conlleva la asignación de un clúster que podría ser el clúster asignado anteriormente a esa información borrada. El caso de la creación de un fichero también me preocupa porque cuando un archivo es eliminado, el sistema borra su correspondiente registro en la MFT, que puede ser sobreescrito por ese nuevo fichero creado, a raíz del evento de creación de un archivo.

También me preocupan esos eventos que se producen, en relación con el tiempo transcurrido desde el incidente. Es decir, no es raro encontrar incidentes que han ocurrido desde hace días, o incluso semanas. Y esos eventos que se produce pueden tener repercusiones sobre ciertos logs del sistema. Por exponer un ejemplo, los eventos '.evtx' tienen, por defecto, un valor máximo de 20480 KB.

¿He efectuado estas pruebas para ver qué información se puede perder, durante la ejecución de una herramienta de triage? No. No he efectuado esas pruebas, pero es posible que lo haga en un futuro. El objetivo de este artículo es el de mostrar que las herramientas que ejecutamos, generan ruido. Nada más.

También es cierto que, dentro de todos esos eventos, se encontrarán eventos que pueden no influir directamente sobre los artefactos que podamos encontrar en un sistema. Pero eso es algo que no se sabrá hasta que no se analice el mismo.

En ningún momento pretendo realizar una comparativa sobre si una herramienta es mejor que otra. Existen docenas de herramientas para efectuar un triage. No he comparado todas ellas. Tan sólo he realizado unas pruebas, (creo que objetivas), sobre algunas de las herramientas que más uso yo.

Existen herramientas que permiten elegir si recolectar artefactos o sólo informes, existen herramientas que te permiten elegir qué artefactos recolectar y existen herramientas que no te permiten elegir nada, más allá de la propia ejecución de esa herramienta. Por ello, durante estas pruebas, he optado por ejecutar cada herramienta con sus máximas opciones. Porque no sería justo ejecutar una herramienta que permite unas opciones mínimas con otra herramienta que no permite opción alguna.

No me gusta recomendar herramientas porque cada herramienta tiene su sitio, según el caso de que se trate. No me gusta verter opiniones sobre herramientas. Sólo me gusta hablar sobre cosas que he visto con mis propios ojos, (con mis propias pruebas). Lo aquí expuesto son únicamente mis pruebas.

Es el usuario final el que debe valorar, y conocer, qué herramientas tiene a su disposición, saber elegir la adecuada para cada caso y entender su funcionamiento, y los riesgos que pueda entrañar su uso, o no. Al final, todo depende de muchos factores, pero es el usuario final quien tiene la última palabra, con su elección.

Y todo esto, son sólo mis cosas. Las cosas de un mero curioso en la materia.





Esto es todo.

Marcos
spacer

Imaging or triage? 🤔 Doesn't anyone think about noise?

Hi, minions:

Have you ever wanted to write about something, but felt that something 'chokes' you? Have you ever been stuck yourself? Well that's what happened to me with this article, where I want to show my point of view on triage and forensic imaging. I'm 'thick' (more than usual). I know what I wanted to say, but I didn't know very well how to approach it.

Some time ago I read a fantastic article by Brett Shavers (I strongly recommend you read it), titled "Forensic imaging raises its head", which he published following a ForensicFocus tweet. In that article, Brett sets out his opinion on the subject. Triage or imaging?

I fully share the same view as Brett in his article.

Personally, if I have the time, I have the resources, I have authority and I am qualified... I will make a forensic image. As always, all depending on the case, (if you can know what you are going to find before starting an analysis in a forensic investigation).

Before we continue, allow me to make an observation...

The acquisition of the memory dump is a priority task in any case in which it is necessary to intervene in a system, as I explained in a previous article, due to the great importance and great volatility of the data it contains. Therefore, it must be separated from other collection processes (such as triage), since they negatively affect the data stored in the memory. That is to say, the memory dump should not be carried out within a triage process.

Much has been written, in many places, about triage. It is not a field that I have delved into. It's not something I'm going to delve into in this article.

When a triage is carried out, only 'important' information is collected (enclosed in quotation marks because what is important information?), thus reducing the time of acquisition and subsequent analysis. Specific and necessary elements are sought in order to initiate a later, deeper and more exhaustive investigation. After all, when an incident is declared or a system needs to be intervened to carry out a previous examination of activity, quick data is needed.

If triage is successful, investigators will be able to extract relevant and necessary information for further processing.

Triage is undoubtedly a practical solution for dealing with time-critical research, reducing the volume of data. It's all about having an 'efficient' workflow. But what you may believe to be efficient is sometimes not the best, the most optimal.

For example, you might have to intervene in a system that is apparently involved in a misdemeanor (such as an intrusion into another small business system), so you choose to perform a triage. But when you start with the analysis you might see that this is a felony, (such as a terrorism or child pornography crime). By this I mean that you don't really know the scope of an investigation until you start it.

You have to find a balance.
The price to pay for rapid data extraction is data loss.
At this point I am obliged to mention our friend Locard, because I have not seen him mentioned when talking about triage. I haven't seen anyone talking about something that, personally, I think is important. The noise.

There are plenty of tools for triage. Tools that make noise. Noise that can do a lot of damage to the investigator's eyes when he has to analyze a forensic image.


Noise is the massive and unnecessary alteration of data caused in a system that, in addition, can cause the loss of other data of interest. Loss of data of interest that I like to translate as 'pollution'.

You won't see that noise when you're analyzing the extracted data by performing a triage. But you will see it in the later creation of a forensic image.

As I said before, there are many tools to perform a triage. You have at your disposal small utilities, like NirSoft's own, (like LastActivityView or USBDeview). You also have your own SysInternals utilities (like Autoruns or TCPView). You have at your disposal linux distributions, focused on digital forensic analysis, which have another set of small utilities, such as Tsurugi Linux, (with Bento), or Caine, (with WinUFO in previous versions). You have at your disposal a lot of tools, that execute a set of small utilities, from third parties.

You also have to keep in mind that some of those tools that run another set of third party utilities can be detected as malicious and can trigger alarms.

And, in this situation, what do you do? Do you disconnect the antivirus? Be that as it may, that simple fact translates into an alteration, perhaps unnecessary, of the system.

It all depends on the case, because you must have a plan.
You must choose the right procedure and tool for each case.
And this is where I want to end up. This is where I am going to present my opinion, with objective data. For this, (and after some headaches and other issues), I have chosen to perform a series of triage tests on a Windows 10 system, version 18343.1, virtualized under VirtualBox, with the following tools, (all of them free):
After installing the virtualized system, I plugged a USB device into the system and performed a single action. After that action, I saved the status of the virtual machine and created a clone for each of the above tools. I also created a clone to proceed with a normal system shutdown. Once the virtual machine clones were created, I advanced the system date and proceeded with the execution of the corresponding triage tool, disconnecting the virtual machine at the same time that each of the tools ends its execution. When I finished, I disconnected the original machine, as if I had cut off its power supply.

The acquisition process of each one of the mentioned tools has been monitored with the utility Process Monitor v3.50, excluding the execution and exit routes of the data, and including only the activity related to the processes involved in the operation.

In addition to this monitoring process that I have carried out, I have also made a super time line with Plaso, which I have later visualized with Timeline Explorer.

Next I show you my results, without going into assess what information extracts each of the tools.

AChoir



With the use of AChoir there have been a total of 235,904 events.

I make two more filters to see how the execution affects the system.

This tool has caused a total of 3.176 write events in files.


And a total of 2,936 file creation events.


After performing the timeline and showing only the lines between tool execution and completion, a total of 12,724 lines of activity are shown.


Live Response Collection BambiRaptor



With the use of BambiRaptor a total of 7,482,923 events have occurred.

I make two more filters to see how the execution affects the system.

This tool has caused a total of 15,237 write events in files.


And a total of 268,187 file creation events.


After performing the timeline and showing only the lines between tool execution and completion, a total of 46,384 activity lines are shown.


CyLR



With the use of CyLR there have been a total of 16,601 events.

I perform two more filters to see how the system is affected by the execution.

This tool has caused a total of 958 write events in files.


And a total of 113 file creation events.


After performing the timeline and showing only the lines between tool execution and completion, a total of 507 activity lines are shown.


FastIR



With the use of FastIR there have been a total of 26,386 events.

I perform two more filters to see how the system is affected by the execution.

This tool has caused a total of 1,712 write events in files.


And a total of 5,947 file creation events.


After performing the timeline and showing only the lines between tool execution and completion, a total of 6,420 lines of activity are shown.


KAPE



A total of 177,507 events have occurred with the use of KAPE.

I perform two more filters to see how the system is affected by the execution.

This tool has caused a total of 1,840 write events in files.



And a total of 6,455 file creation events.



After performing the timeline and showing only the lines between tool execution and completion, a total of 6,918 lines of activity are shown.


Conclusions


These triage tests have been carried out at the same time as a given action has been carried out. Imagine for a moment what you can find (or what you won't find) in a system where the time between an action and the intervention is hours, days, or even weeks.

Given the 'noise' that some tools are capable of generating, I am in favour of, whenever possible, acquiring a forensic image. There will be time to extract the artifacts that are needed.

A triage can be effective in some cases if the right tool or procedure is used. Keep in mind that what you think may be an appropriate option may result in an ineffective artifact classification procedure and, therefore, the prioritization of the case at hand.

Being fast in data extraction does not guarantee that you will extract the data necessary for your research. Find a balance. Plan your steps well, because you only get one chance to triage (unless you want to generate more noise and lose more data).

Efficiency isn't usually the fastest. When you intervene in a system, you don't really know what you can find in it.

If you use a tool, use the right one for each case. For example, the BambiRaptor Live Response Collection tool does not extract transactional logs from the Registry. However, CyLR or KAPE do extract them. For example, CyLR does not generate reports with data extraction, while KAPE does.

You should know that just as there are situations in which it is not possible to turn off the system to make a forensic image (so you have to acquire it with the live system), there are also situations in which you can disconnect the system to perform a triage (so unnecessary noise will be avoided). Disconnect. Do not turn off. Because the difference between one step and another is translated, in the same way, in loss of information.


For example, in this test, the system generated 178 lines at the start of the shutdown process, while when the system is disconnected, no activity is generated.


Think of the noise. Noise that bothers, hurts the eyes and leads to data loss.


Updated: 20 May 2019


The sole purpose of this article has been to show that the tools we run generate noise during execution. It is true that much of that generated noise is read-only events. But that doesn't stop them from being events. Even within file writing and file creation events, the same writing and creation events are repeated about the same events. But those events are there.

As far as file writing and file creation events are concerned, I have to say that my main concern is that when you write to a file, that file increases in size and that when you create a file, you assign an entry in the MFT. If we find a case where a certain type of content has been deleted (call it 'X'), the increase in size of a file entails the assignment of a cluster that could be the cluster previously assigned to that deleted information. The case of the creation of a file also worries me because when a file is deleted, the system deletes its corresponding record in the MFT, which can be overwritten by that new file created, following the event of creating an archive.

I am also concerned about those events that occur in relation to the time that has elapsed since the incident. In other words, it is not uncommon to find incidents that have been going on for days or even weeks. And those events that occur can have repercussions on certain logs of the system. For example, '.evtx' events have, by default, a maximum value of 20480 KB.

Have I performed these tests to see what information may be lost, during the execution of a triage tool? No. I haven't done these tests, but it is possible that I will do so in the future. The purpose of this article is to show that the tools we run generate noise. Nothing more.

It is also true that, within all of these events, there will be events that may not directly influence the artifacts that we may find in a system. But that is something that will not be known until it is analyzed.

At no time do I intend to make a comparison of whether one tool is better than another. There are dozens of tools for triage. I haven't compared all of them. I've only done a few tests, (I think objective), on some of the tools I use the most.

There are tools that allow you to choose whether to collect artefacts or just reports, there are tools that allow you to choose which artefacts to collect and there are tools that do not allow you to choose anything beyond the execution of that tool itself. Therefore, during these tests, I have chosen to run each tool with its maximum options. Because it would not be fair to run a tool that allows minimum options with another tool that does not allow any option.

I don't like to recommend tools because each tool has its own site, depending on the case. I don't like pouring opinions on tools. I only like to talk about things that I have seen with my own eyes, (with my own tests). What is exposed here are only my tests.

It is the end user who must assess, and know, which tools are at his disposal, know how to choose the right one for each case and understand how it works, and the risks involved in its use, or not. In the end, everything depends on many factors, but it is the end user who has the last word, with his choice.

And all this, it's just my stuff. The things of a mere curious in matter.





That's all.

Marcos
spacer