WEBVTT

00:00.590 --> 00:03.980
Hey everyone welcome to file analysis tools.

00:03.980 --> 00:08.680
In the previous video we covered the extraction and analysis of Internet artifacts.

00:08.720 --> 00:13.510
We're going to take a look at how to analyze files establishing if they're malicious or not.

00:13.580 --> 00:19.160
The type of data they contain the type of data they contain and extracting their bedded metadata in

00:19.160 --> 00:25.910
particular we're going to analyze executive all image and document files using different tools pre-installed

00:25.970 --> 00:32.780
on Kelly Linux static file analysis is an important topic of digital forensics and fundamental in malware

00:32.780 --> 00:33.980
forensics.

00:33.980 --> 00:36.850
We're not going to deal with malware forensics in this video.

00:36.950 --> 00:42.260
But first we want to know when analyzing a suspicious file is if it's malicious or not.

00:42.260 --> 00:48.840
Therefore we could scan it with clam A.V. the Avies scanner installed by default on Kalli Linux.

00:49.000 --> 00:58.860
First we run the fresh clean utility to be sure the Abey signature database is updated.

00:58.990 --> 01:02.890
We execute claim scan on the suspicious file on Kelly Linux.

01:03.010 --> 01:05.380
A graphical front end is also available.

01:05.380 --> 01:06.430
Clam T.K.

01:15.270 --> 01:21.900
in this case claims it has detected a Windows trojan program has detected a Windows trojan program

01:26.740 --> 01:29.210
even if claims can does not detect any threat.

01:29.260 --> 01:32.490
We cannot be definitive if it's not malicious.

01:32.730 --> 01:38.210
So we better submit it so we better submit it to a free online scanning service like Byres total dot

01:38.210 --> 01:38.760
com.

01:38.820 --> 01:41.760
It scans files using many Avies scanners.

01:41.760 --> 01:48.750
It has a file size limit of 128 megabytes but it's enough for most cases file analysis has two phases

01:49.160 --> 01:55.500
content identification and metadata extraction the content identification implies detecting what type

01:55.500 --> 01:57.400
of data the file contains.

01:57.420 --> 02:03.420
On Windows the type of file is usually associated with its extension which is a suffix of the file name

02:03.480 --> 02:11.650
of three letters like Doddie X-C doc X-C doc etc. on Unix derived systems instead.

02:11.670 --> 02:18.060
The file may not have well usually don't have any extensions so we cannot simply rely on the extension

02:18.060 --> 02:19.820
to determine the file type.

02:19.830 --> 02:24.350
Also because anybody could change the extension without affecting its structure and contents.

02:24.480 --> 02:31.290
A much more reliable way to identify a file is by means of the so-called magic number which is a hexadecimal

02:31.290 --> 02:33.680
value embedded in the file header.

02:33.720 --> 02:38.180
Each type of file has a different magic number on Unix derived systems.

02:38.190 --> 02:42.710
Magic numbers are listed in a compiled binary file on Kaua'i Linux.

02:42.760 --> 02:51.090
It's slash user lib file magic MGC to see a list of magic numbers of common file types we can refer

02:51.090 --> 02:53.180
to this page on Wikipedia.

02:53.250 --> 02:57.750
The magic file is used by the Selye utility file to identify the type.

02:57.750 --> 03:04.500
For example we execute file on this malicious file we execute file on the malicious file we scanned

03:04.500 --> 03:09.000
previously despite its extension appearing to be a PDAF document.

03:09.000 --> 03:14.580
In reality the file tool shows it's a Windows portable executive execrable or PGE file

03:18.480 --> 03:24.930
another method to identify a file as another method to identify a file is inspecting it with a hex viewer

03:25.020 --> 03:29.570
or editor or editor like x x D or a g y editor.

03:29.610 --> 03:34.610
We open the same file with x x d.

03:34.810 --> 03:38.170
The first column in the output represents the offsets.

03:38.170 --> 03:42.190
The next eight columns are the hexadecimal representation of the data.

03:42.310 --> 03:44.080
Each column be in two bytes.

03:44.080 --> 03:48.890
The right side shows the A.S.C. I text text representation.

03:49.270 --> 03:56.860
We could see the magic number for this type of e-file is two bytes which is for d 5 A which corresponds

03:56.860 --> 03:59.450
to the string M.Z. in the right.

03:59.470 --> 04:05.110
An unknown file could also be identified on the basis of the National software reference library reference

04:05.110 --> 04:11.910
data set or n s r l Dasch RDX which is a large database of hashes of files.

04:12.040 --> 04:17.470
The database can be freely downloaded at this link but this does not provide a tool to queries.

04:17.560 --> 04:23.650
There's a Seelye client program called s r l look up to query the database.

04:23.710 --> 04:24.970
It's available here.

04:24.970 --> 04:31.780
There's also an n s r l hash search engine and S.R. l hash search engine that supports searches via

04:31.780 --> 04:37.260
M.D 5 as a one or filename submitting one file at a time.

04:37.270 --> 04:39.670
This search engine is available at this link.

04:39.670 --> 04:42.150
Another very useful tool for file analysis.

04:42.190 --> 04:46.720
Are strings which are also installed on on every Unix Linux system.

04:46.750 --> 04:51.370
This tool displays a strength of printable characters that it binds in a given file.

04:51.370 --> 04:53.830
We execute strings on the same malicious file

04:59.000 --> 05:01.070
redirecting the output to a text file

05:04.850 --> 05:06.140
reading this ALPA file.

05:06.200 --> 05:15.650
We could retrieve useful information such as the Win32 API functions called by the programs and eventually

05:15.650 --> 05:18.560
you are else an IP addresses.

05:18.560 --> 05:24.050
We could also perform keyword or regular expression search on the output file using for example the

05:24.050 --> 05:25.230
grep utility.

05:25.370 --> 05:30.620
When analyzing a Windows system given the fact that malware or other files may not have an executive

05:30.620 --> 05:35.900
file extension we might want to find every executive will on the system without manually inspecting

05:35.990 --> 05:37.450
every single file.

05:37.640 --> 05:44.750
To do that a valuable tool comes to our rescue which is mis identify this list executive roles in a

05:44.750 --> 05:45.600
given directory.

05:45.610 --> 05:50.420
By default the program reports only the file names of the executive bills of which the extensions do

05:50.420 --> 05:51.620
not match.

05:51.740 --> 05:57.210
One of the known executive extensions like X-C DL CIS etc..

05:58.740 --> 06:03.230
In this example we assume we mounted under and then malicious suspect directly.

06:03.300 --> 06:08.180
In this example we assume we mounted under and then the malicious suspect directory.

06:08.250 --> 06:12.810
The windows image we've used in the second video of the section the windows image we've used in the

06:12.810 --> 06:19.830
second video of the section about registry analysis we run misidentify on the Windows system 32 folder

06:20.130 --> 06:24.330
specified the r option to also scan its subdirectories recursively

06:28.170 --> 06:33.390
as we could see the files listed do not have a nonexecutive will extension with the option.

06:33.390 --> 06:37.320
All the executive rules are listed regardless of their extensions.

06:37.320 --> 06:41.000
Now we're going to cover the analysis of image and video files.

06:41.010 --> 06:51.420
There are many images and video file formats most popular formats are jpeg PLG BNP G-I death and Tiff.

06:51.420 --> 06:59.510
While the most common video formats are W.M. the MP for move a vi NFL v.

06:59.610 --> 07:04.770
We're going to see how to extract metadata from these types of files metadata as we've already seen

07:04.770 --> 07:05.970
with file systems.

07:06.050 --> 07:12.150
Our data about data in this case metadata is embedded within the file itself.

07:12.150 --> 07:19.560
The most common metadata for image files is e x I-F is exchangeable image file format or S.F. developed

07:19.560 --> 07:25.940
to record metadata about the capturing camera such as the make model and serial number camera settings

07:26.220 --> 07:29.490
date and time and the GPS data for geolocation

07:39.530 --> 07:43.440
XXIV 2 is a tool to extract data from image files.

07:43.460 --> 07:49.490
The use is quite straightforward as we supply the image file with the option to display more verbose

07:49.490 --> 07:50.470
information.

07:50.480 --> 07:56.780
We run X of two on a sample JPEG image file as we could see the output shows quite detailed meta data

07:56.780 --> 08:01.940
information about the image itself the camera and its settings and the GPS coordinates.

08:01.940 --> 08:08.120
Another tool is to be able to extract meta data not only from image but also from video and other common

08:08.120 --> 08:14.150
file formats like exit tool exit tool is not installed by default on Kelly Linux.

08:14.150 --> 08:17.600
So we'll have to install the relative package with the command.

08:17.600 --> 08:32.210
Apt get install.

08:32.330 --> 08:35.300
In this case it says the package is already installed.

08:35.330 --> 08:39.920
We run X of tool on a sample videophile to examine its meta data

08:46.480 --> 08:52.140
the meditate extracted is similar to those of the previous example but specific to the video format

08:52.380 --> 08:54.880
such as the frame rate and the audio properties.

08:58.040 --> 09:03.140
When looking for images on a Windows system it could be useful to analyze thumbnails and associated

09:03.140 --> 09:09.350
meta data window stores the thumbnails of images of a certain directory in the Thums dot db file.

09:09.440 --> 09:15.470
Even when images are deleted the thumbnails and the meta data persist and bums not D-B this kind of

09:15.470 --> 09:19.310
data can be extracted using Veneto for the sake of brevity.

09:19.400 --> 09:28.950
We're not going to run this tool but we will show the options.

09:29.000 --> 09:34.370
We could run it specified the Alper directory where to store the thumbnails with the o option and the

09:34.370 --> 09:38.660
h option to write it H.T. a Mail report to the same output directory.

09:38.750 --> 09:46.010
Kelly Linux also provides tools to analyze documents PTF in particular PDA is together with M-S office

09:46.010 --> 09:46.910
files.

09:46.910 --> 09:52.830
The most popular document file format pedia of metadata can be extracted using EXIF tool.

09:52.940 --> 09:55.350
We execute on a sample pedia file.

10:02.420 --> 10:08.470
This is the output where we run on a sample PTF file with the modification and access dates.

10:08.570 --> 10:13.410
The pedia version the page count and the program used to create it.

10:13.430 --> 10:17.930
There are also tools specifically designed to analyze PDX.

10:17.960 --> 10:27.110
The first tool we cover is PTF ID which scans the PDA for a given list of strings and counts the occurrences.

10:27.290 --> 10:30.650
We execute PTF ID on a suspicious PTF file

10:34.390 --> 10:40.300
it displays the occurrences of sections of javascript code within the document as we can see when executed

10:40.360 --> 10:49.540
on this malicious PTF now malicious PDM is very often contain javascript code which is usually associated

10:49.540 --> 10:55.870
with an automatic action that launches it when the document is viewed is displayed in the PDA ID output

10:55.990 --> 11:05.430
slash open action pedia Id also shows any embedded Flash code slash rich media rich media.

11:05.510 --> 11:12.330
If a PDA looks suspicious we might analyze it more deeply with p with P PTF.

11:12.380 --> 11:17.660
This tool allows us to inspect the objects and streams that form a PDA file.

11:17.660 --> 11:19.790
Thus also any javascript code

11:23.780 --> 11:34.870
any javascript code we execute we execute PTF on the same file with the option to launch an interactive

11:34.870 --> 11:42.850
shell the output gives us an air because we need to specify the full path because we need to specify

11:42.850 --> 11:44.510
the full path of the file.

11:44.740 --> 12:01.100
Otherwise the tool does not find it.

12:01.190 --> 12:08.480
We could see that it has 15 objects of which to which are 9 and 13 contain encoded streams.

12:12.560 --> 12:15.860
In particular white 13 contains javascript codes

12:18.990 --> 12:25.090
PPF also provides the feature of inspecting a particular object more deeply to do that.

12:25.090 --> 12:33.110
We can list the commands available in the interactive shell with the help command the command to inspect

12:33.170 --> 12:36.450
object is object.

12:36.630 --> 12:41.740
So we execute object and we give parameter number of the object 13

12:47.290 --> 12:51.600
the output displays the javascript code that very likely contains a shell code

12:56.600 --> 13:03.200
other very popular document formats are and this office ones call me Linux does not provide tools specifically

13:03.200 --> 13:05.490
created to analyze these files.

13:05.500 --> 13:08.200
XXIV tool also works with these types of files.

13:08.270 --> 13:12.900
We can execute it on a simple word format on a simple word doc file.

13:21.890 --> 13:27.470
The output displays information like the application used to create the document and the number of pages

13:27.770 --> 13:37.290
words characters paragraphs the title subject subject description and the number of revisions.

13:37.460 --> 13:44.690
We can also view the meta data of an office document with libor office with liberty office opening the

13:44.690 --> 13:47.290
document with the work program

13:50.980 --> 13:56.550
and selecting file and then properties and selecting file then properties.

14:01.020 --> 14:07.440
Great work in this video we looked at how to analyze files establishing establishing if there malicious

14:07.440 --> 14:13.470
or not the type of data they contain and extracting their bed admitted data in particular we've analyzed

14:13.470 --> 14:19.670
executive BHEL images and document files using differe tools pre-installed on Kelly Linux.

14:19.890 --> 14:25.290
In the next video we're going to see how to create a so-called super timeline of the activities performed

14:25.350 --> 14:28.440
on the system with log to timeline Plaxo.
