Quantcast
Channel: 'X-Ways Forensics' Video Clips
Viewing all 72 articles
Browse latest View live

Video 59 - Introduction to X-Tensions for Beginners

$
0
0


In this video 59, I attempt to give a brief overview of the basics of writing your first X-Tension. This is a very high level walkthrough, designed to help those who might have tried and failed to get to grips with how an X-Tension works, and how they can be built.

X-Tensions allow digital forensics people who have programming abilities to add their own bespoke functionality to their XWF casework, with the added beauty of not having to build routines that open E01 images, navigate to partition offsets etc. You can leave X-Ways Forensics to do all that hard work still, but then for specific items in a case, or for all items if necessary, you can have code executed that does particular 'things' that X-Ways Forensics itself might not do. This functionality might be something that you can only currently get by another standalone tool, or a tool you have built from the ground up. For example, you might want to examine every item in an image, open it, and then search for a very specific byte sequence or some kind of data structure, and then if found in any given file(s), output those filenames, along with their file sizes, and, say MFT Record ID, to a log. Obviously you can do parts of that within X-Ways Forensics itself, but you see my point how you can add very specific requirements? Different companies and different government bodies will have different requirements. And X-Tensions allows those groups to have that bespoke functionality to be built into your organisation, and also even shared as open-source code if you are so inclined and if you are authorised to do so.  

In this video I explain the use of the open-source, free, object orientated FreePascal language to build an X-Tension using the Lazarus IDE. It's a programming system I've been using for about ten years for everything from bit level shifting to large self-contained GUI tools. A very powerful, very fast, and very underrated language (this is NOT the same as Turbo Pascal, which nearly everyone I meet tells me they used to learn programming!). It can also be used for writing X-Tensions, as I show here. Disclaimer : I am highly likely to have got my words jumbled here and there....please read the documentation to ensure YOU understand what you are doing :-)

The overall aim of the video is to show the user :


  1. Where to get Lazarus and Freepascal
  2. Where to get the X-Ways Forensics X-Tension API
  3. How to start your first X-Tension
  4. Walk you through the core concepts and the difference between XT_* and XWF_* functions and introduce you to the key areas of the API documentation
  5. Show a demo of creating an X-Tension that simply computes the file size of each item in an evidence object, and outputs the computed data with the filename to the message window, with an end date and computed time. 


Obviously the power of X-Tensions is largely unlimited, but as this video is an hour long as it is, I might struggle showing more advanced subjects, though I may build them up into a form of class system, to show how one function can build onto another etc. It's also very difficult trying to explain complex issues that were new to me only one year ago as well! So I hope it helps a little at least, even if its not perfect.



Ted

Video 60 - New Export Options and new XWF_OpenItem flags

$
0
0
Firrstly all the usual "new normal" well wishes to you all and I hope you and your families are doing OK amidst our national pandemic! 

In my previous post and Video 59 which was as recent as, cough cough, Nov 2019 (!!!), I introduced the basics of developing X-Tensions for X-Ways Forensics. I promised, then, I'd follow up "soonafter" with more. And I promise, I did intend to. But then just two months later the world got flipped upside down with Coronavirus and the entire daily existence between working, home life, kids not being school, and not being able to go anywhere had 'a bit of an impact'. This narrative is been recorded with family life going on in the background and a noisy fan trying to keep cool in my box room, but I hope it has some value at least.   

This narrative and the accompanying video surrounds two factors of X-Ways Forensics that centre around your options for exporting files using X-Ways itself, and your options for handling files as a developer of X-Tensions.  

First I would like to discuss some new(ish) export options that have arrived in the main tool of X-Ways Forensics in the last 8 months or so before I go on to talk about X-Tensions; of particular mention is the ability to export file objects as PDF files and as Text files! 

This is a massive addition to XWF and something my friends and I have wanted (the pdf export in particular) for a long time. When you need to, or when you have to, send some files to someone from a forensic tool, the ability to do so as PDF is a game changer. So I am delighted the ever responsive developers at X-Ways Software added this back in v19.9, in Sept 2019. What does this mean exactly? It means, simply, you can right click a file(s), choose "Recover\Copy", and then tick the box for "Convert to PDF format" and then whatever the file object is, it will be exported as PDF if possible. This could be a single e-mail or word document, or it could be a picture file, or it could even be an entire PST e-mail cabinet as one enormous PDF. 

As if that were not enough, but the ability also exists to export the file as text only. Now, I must say that in addition for the appeal to enable exporting as PDF, this more unusual feature was something I, for one, asked for. Perhaps there were others as well as I am sure the guys at X-Ways Software don't just take my requests in isolation. The ability to easily select a bunch of files and simply have them all exported as text files in our age of data linking, "big data" and the myriad of tools we often need to use these days is really useful. 

New export options as of v19.9


The reason it is particular useful to me is for programmatic reasons though. Soon after adding this feature, they added a series of flags to their API function "XWF_OpenItem" and this is where the meat of this discussion leads and why I want to talk about it. 

As an X-Tension developer, if you could not interact with files, you would be rather stuck. The function XWF_OpenItem is the function you need to call to obtain a handle to a file object (typically you call it at least once, or repeatedly for multiple items, via the core function XT_ProcessItem) and then you can interact with it. Once you have that handle, you can do pretty much whatever you like with the file. Read the entire thing into a memory buffer, read a 4 or 8 byte header, read a sector, read multiple sectors one after the other, read the entire thing as a memory stream, or anything else. And, once you can do that, you can then use any programmtic function calls you like and get output you require, including using existing functions that you may have written years ago. And remember, X-Tensions are compiled language DLL's, so your previous native C or C++ or Delphi code can work with it. And when you are done, you release the handle (using XWF_Close).

So, prior to v20.0 of X-Ways Forensics, if you wanted to read the text of a given file in an X-Tension you were developing, you could do so IF the file itself was rather basic in structure. For example, a handle to an e-mail file, or an RTF file would allow you to simply read the content of the file (using XWF_Read) and then you could run your textification routines over the buffer to another buffer or memory stream and then save it as a file. Indeed, I did just that using my own routines. But, I wasn't really happy with my implementation. Anyway, my point is that you'd 'simply' get the default handle that X-Ways gives you for the file, and although you can read every byte from start to end, put it in a buffer and do whatever you need to do, there is often more to do with more complex files. For example  if the file was not a basic file and was instead something like a Microsoft Word 2013 docx file, or an OpenOffice ODT file, then the handle you get is not a handle to what the user sees when they click "Preview" in the viewing component, but you get a handle to the entire file. Those of you who understand how these files are structured know where this is leading : such files are compressed files like zip files. In fact they have a PK header (0x50 4B 03 04). And they actually contain a filesystem of their own in many ways that includes a number of XML files. In the case of MS Word files, the file that contains the text that you see in the viewing component is stored in "\word\document.xml" and for OpenOffice it is stored in "Content.xml". And then a whole series of other XML files dictate how this data is shown to the user such as fonts, size, etc. And of course there is also Excel files and so on to think about. 

So, as a developer, prior to XWF v20.0, if all you want is the text body of a Word document and you have no care for any other aspect of it, you need the parsed XML content of document.xml. Which means your code has to  get the handle to the docx file first, then open the content into a buffer or save it straight out to a temp area, decompress the docx file (so another handle needed), filewalk the output to word\document.xml, get a handle to that (so another handle), open it, parse the XML tags and then you have the content you need. I did all this originally more or less, and then I asked the developers at X-Ways if they would be so kind as to add a flag to XWF_OpenItem instead so that I could simply get a handle to the text view of a file. That would give me a handle to the viewing component view of the file, instead of the raw file as stored on disk. And I am happy to report that this came with XWF v20.0, currently in Beta but due for release soon I suspect. 

So, as of v20.0, all you have to do is switch the flag to your requirements and this will dictate what kind of handle you get to the file object. And by using XWF_GetSize() you can match any buffers to the size of the file object, allowing you to create, store and release the right amount of memory for the item currently being dealt with by XT_ProcessItem, allowing easy and smooth memory management. Because lets face it, nobody likes memory leaks, or their associated costs or loss of production time :-( 

 

But there is more. Not only can you get a handle to the text based version of the file, but you can also choose between UTF8, or UTF16. And did I mention you can also now get a handle to a PDF version of the file (where supported)!! So, as a developer, you can now code a solution that says "With these selected files, convert them to PDF and\or to Text, read them, parse them, search them, do a little dance with them and then save them to location X". This is mind blowingly useful because it means you can automate tasks for your users via X-Tensions. The list of flags available now (and this is pretty much tripled in recent months!) is below, and is from the API website authored by X-Ways Software AG :



In the video below, I have prepared a basic example and I show you how you can utilise some of these new flag options and from there. Excuse the not so great sound....a fan was blowing! I will leave you to explore and enjoy this new world of creative freedom with the video below : 

https://youtu.be/n4nDtx-BYpg


Video 61 - Rebuilding RAID0...with LVM!

$
0
0
You have imaged a handful if disks from some device. Those disks were part of a RAID0 (so a striped RAID). And to make matters worse, an LVM has been put across it. What do you do?

So recent versions of X-Ways Forensics added some great new support for RAID1 (note I said RAID1, not RAID0) disk setups that also had Linux LVM (Logical Volume Management) containers spread across them. But, I wasn't sure how RAID0 and LVM might be affected by these recent updates.  

So as part of some wider research that I was doing, I wanted to see how it might go with RAID0 and LVM. 

So I created a basic Linux system and attached 3 x 1Gb hard disks. Using mdadm, I then enrolled all three of these disks into a RAID0, accepting all the defaults. Here is how I created the RAID and LVM : 

1) Used lsblk to list the block devices attached to the system. /dev/sda obviously is the host drive, with sdb, sdc, and sdd being my 1Gb disks. 


2) Used mdadm to create a new md0 device (an mdadm software RAID) as type 0, using all 3 devices, and then I specify the devices I want to use from the output of lsblk. Note that the order YOU specify the devices in MIGHT not be the order that mdadm decides to use them in, although, as you can see in my example, I entered them in the order of sdb, then sdd, then sdc, instead of sdb, sdc and sdd...and it turned out mdadm did use them in that order, but I didn't notice my "typo" until much later! More on this later!


3) Check the RAID is setup OK by outputting /proc/mdstat. Note the order the sd devices are listed in. 


4) And a user friendly view of the 3Gb RAID, using gParted, currently without any LVM or any other kind of system on it : 


5) So next is to add the LVM to the RAID0 (/dev/md0) using pvcreate 


6) A quick check that that step has gone OK reveals data about the LVM


7) So then we create a Volume Group across the LVM called 'vol_grp1': 


8) Now display the 3Gb Volume Group confirming use of LVM2 called 'vol_grp1': 


9) Now create a Logical Volume called "logical_vol1" in the Volume Group. The use of '700' is 700 multiplied by the Physical Extent size (PE Size) of 4Mb. 700 x 4mb is 2,800Mb, i.e 2.8Gb. 


10) Quick look back using gParted again shows our 2.8Gb volume spanning the 3 disk RAID. 


11) After then formatting the LVM with EXT3 I had a volume accessible to me for use. 


12) So I randomly Googled for some photos and created one text document and saved it. 


So the next task was to add these three LVM RAID0 disks to X-Ways Forensics and see how easily I could access this data. 

Method 1, which MAY work

13) I created a case, added the images of the 3 disks, used the Specialist menu to Reconstruct RAID, selected RAID0, entered the 3 disks (at their physical level) to the RAID in the order I thought mdadm had used. i.e. Disk 1 = 0. Disk 2 = 1. Disk 3 = 2 (but of course I inputted them in the wrong order - see screenshots near the top!). And then I waited to see if the LVM was automatically discovered by XWF, as it would commonly do now for LVM on RAID1. 


It wasn't entirely detected. No surprises there though as this was just a quick "drag and drop" type of RAID reconstruction!! So I looked a bit further. I started to notice what looked like EXT Superblocks at offset 4096 etc. But XWF didn't show me explorable partitions in the way I was expecting (hoping). 



14) So in the end I resorted to cheating....cough, cough, I mean scanning for lost partitions with XWF via the disk menu. That did find a partition. It looked the right size and everything as well. I traversed the partition and it looked as though it was going to display a filesystem and all those photos I had copied to it. And it kind of did list some files, except none of the files I put there. Only the default filesystem entries. 


15) So then I did a file signature search to see what I could find, and a fair number of files were quickly retrieved, but on inspection of the results, the pictures had all the tell tell signs of an incorrect stripe size selection, or an incorrect ordering of the disks. I suspected I must have done something wrong, and started all over again using a variety of settings (too many to document here) and in the end after several evenings I gave up. But I was intrigued as to what I must have been doing wrong so I sent these details to forensic wizards at X-Ways Software AG to see if they could spot anything that might have explained the issue, and hoped they may guide me on the subject a little. 



16) Only a few hours later, I was delighted to read that a) I'd put the disks in the wrong order; the order can be identified from the yellow post it note that appears next to a RAID component in XWF. I'm sure at some stage I did try different ordering but nevertheless, the screenshots I created did indeed show them in the wrong order. But more importantly b) they have added new capability to X-Ways Forensics v20.0 beta 6b upwards, which now enables seemless handling of this. Though my disk ordering had been wrong, it turns out that even they were right, the work I did above would have been much the same outcome. See the release notes below :


 

METHOD 2 - The recommended way

Using v20.0 Beta 6b or above, create a new case (if you'd prefer to use a case, but not essential) 

Add your disks

Note the MD RAID Header and MD RAID Container portions. Hover the mouse over the yellow post-it and note the order of each of the components, bearing in mind the first disk in any RAID is 0, not 1. 

Then, select and double click the "Partition 1" (labelled MD RAID Container) of each of your disk RAID components, so that they are "open" within XWF in a new tab, typically titled ImageName, Volume 1', as opposed to in a tab that just reads 'ImageName'. This will now list a virtual file called 'MD RAID Container'. Repeat this for each of your disks for as many as you have. In my case, 3. 

Now, and as of v20 Beta 6b and above, XWF will then be able to recognise these "logical volumes" which must be used to reconstruct an LVM across RAID0. So you don't use the physical disks for this step. Reconstruct the RAID, selecting your disk images from the "Logical Volumes" section of the dialog window and not the physical section of it where physical devices are listed, until they are all added, in the order required : 


Hit OK, and everything might now look somewhat like you were expecting; an overarching 3Gb LVM2 container with a 2.7Gb  formatted EXT3 partition, in my case. Double click "Partition 2", and there are my files!



X-Ways Forensics displaying the files of my newly recontructed EXT3 LVM volume spanned over the RAID0 

Now, it's easy to say "Yeah but you knew the makeup of the RAID to start with", and you would be right. But the point I want to show is that even when you do not know the structure of the RAID in advance, you can use the yellow PostIt notes of X-Ways Forensics to more easily identify which disk was which in the RAID order from the physical images to use as a clue when you go on to re-create the LVM, and from what type of RAID, and XWF shouts at you loud and clear about the existence of MD RAID Headers and MD RAID Containers from which you can go on to try re-assembly as logical volumes. 1024Kb is a common strip size in this setup, but of course you can also try 512, 64, 32 etc. 




Video 62 - Support for the btrFS Linux Filesystem in X-Ways Forensics 20.1

$
0
0

 Users of X-Ways Forensics who follow the release announcements page might already be aware that in the Preview, and now beta, version of X-Ways Forensics v20.1, support has been added for the btrFS Linux filesystem. 

From the Linux docs

"Btrfs is a copy on write filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration. Jointly developed by several companies, licensed under the GPL and open for contribution from anyone"

The filesystem is designed, I gather, to be better able to scale to the increasing storage demands of "the future", despite being first introduced back in 2007! Though I must admit I have seldom come across it but that is not to say it is unusual - just a more specific use case. However I think it is increasingly a default filesystem for some Linux distributions now, including Fedora. The guys at X-Ways Software wrote the following in the v20.1 preview version release notes in October 2020 : 

"...Multiple disks via LVM2 or RAID setups, as used in Synology NAS systems, are supported, but not BtrFS multi-device setups..."



In this very short video, I simply want to show users that it is possible to review such filesystems as easily as any other filesystem with X-Ways Forensics, and even the superblock data and similar Linux filesystem related data blocks are conveniently presented now as virtual files. 

Of significant note is the superblock. The following is a Wikipedia extract and duly referenced : 

"All the file system's trees—including the chunk tree itself—are stored in chunks, creating a potential bootstrapping problem when mounting the file system. To bootstrap into a mount, a list of physical addresses of chunks belonging to the chunk and root trees must be stored in the superblock.

Superblock mirrors are kept at fixed locations:[90] 64 KiB into every block device, with additional copies at 64 MiB, 256 GiB and 1 PiB. When a superblock mirror is updated, its generation number is incremented. At mount time, the copy with the highest generation number is used. All superblock mirrors are updated in tandem, except in SSD mode which alternates updates among mirrors to provide some wear levelling."

And, true to form, X-Ways presents both the primary superblock and the mirror. Any readers wishing to create a btrFS partition can follow the instructions here that are super useful.  

Below is Video 62 for reference showing the new functionality that is coming in v20.1. 






Video 63 - 4 Years Later - I Am Back!

Video 64 - Channel [Re]Introduction

$
0
0

 After a 4 year absence from the channel caused by a melody of reasons, I thought I'd take to the screen myself for the first time in 12 years to welcome you all back, thank you for sticking around, to re-introduce the channel after its 4 year chill out, and to talk about some of my hopes for a more community driven channel about X-Ways Forensics.

I'd love to hear your comments on what you'd like to see covered going forward. And of course, do please subscribe if you're keen to see more.



Video 65 - Comparing Two Different Text Files with X-Ways Forensics

$
0
0

 This evening, in Video 65 - Comparing Two Different Text Files with X-Ways Forensics - I settle us back into a rhythm with a super simple demonstration of comparing two very similar text files and having X-Ways Forensics highlight for us, what the differences are, and where the differences are.

The next video (Video 66) will be similar but showing the technique with non-text files.



Video 66 - Comparing Two Non-Text Files with X-Ways Forensics

$
0
0

Following on from Video 65, this simple video illustrates how to easily compare two non-text files whose sizes match, and which should be a copy of each other, but the hashes don't match and you want to work out why at the byte level.

During the video I talk about how my sample files were made using a random data generator. Here is the link to the random data generator I talk about in the video if you would like to use it. : https://www.quickhash-gui.org/download/teds-tremendous-data-generator-v1-1-0/



Video 67 - Adding NSRL SQLite Hash Sets to X-Ways Forensics

$
0
0

For at least two decades, I have used the NSRL text based hash lists with forensic tools, including X-Ways Forensics. But in the last year or so, NIST have moved away from providing the sets as text files and instead provide them as SQLite databases. As of March 2024, the NIST website states :

"The NSRL has completed the transition away from the RDS 2.XX text file format, and will only be publishing the RDSv3 SQLite database format moving forward. If you still wish to use a text file format of the RDS, please reference the RDSv3_to_RDSv2_text_files.pdf document, which outlines the steps necessary in order to create RDS 2.XX like text files, from the minimal RDSv3 publications below." [Source https://www.nist.gov/itl/ssd/software-quality-group/national-software-reference-library-nsrl/nsrl-download/current-rds ] I can understand why they have made that move, given the wonderment of SQLite as a technology and especially since the inclusions of SHA256 over CRC32. But, it does shift the emphasis onto the user, somewhat, to convert those SQLite database hash sets into text files that can be used by your forensic tools. However, I must confess to have become terribly vexed myself trying to accomplish this, simply to demonstrate the process to my channel viewers! Having spent several evenings and two weekends wrestling with Linux virtual machines, and then running out of disk space, and then running out of temporary space for SQLite, and trying various SQLIte Browser extensions and tools instead (big shout out, by the way, to 'DB Browser for SQLite' from https://sqlitebrowser.org/ that I use a lot and which was partly helpful with this as well) as well as enduring various other syntactical challenges, I was delighted to learn that for users of X-Ways Forensics, at least, the problem is much less of an issue. Happily, for licensed users of X-Ways Forensics, they are doing this job for you and providing you with download instructions to pre-prepared hash sets that are ready for simple "import" to your SHA-1 or MD5 hash database. And the download is exponentially smaller! You just download the 7zip file, extract it to a folder, and import it. This video shows you how. It is also worth noting that there is a page in the X-Ways Forensics user manual on how to prepare it all yourself, if you wish, on page 239 (as of Mar 2024)



Video 68 - Conducting OCR (Optical Character Recognition) with X-Ways Forensics

$
0
0

The ability to find text within picture files is often very useful as part of any review of digital data. This video demonstrates how to do OCR with X-Ways Forensics, and makes passing comment to an X-Tension I made to do the same, though the implementation of OCR capability within X-Ways Forensics is far better than my X-Tension was.




Video 69 - Understanding and Using the Data Interpreter in X-Ways Forensics

$
0
0

 Video 69 hopes to help new users, or new practitioners to the field, with understanding HOW the Data Interpreter of X-Ways Forensics actually does "interpret data". It starts with a foundation session on bits and bytes, from which it then becomes easier to understand how the interpreter works.



Video 70 - Device Types & Generator Signatures in X-Ways Forensics

$
0
0

 

Video 70 - Device Types & Generator Signatures in X-Ways Forensics

In this short 9 minute video, I quickly highlight some of the capabilities of the Device Type and generator Signature capabilities of X-Ways Forensics. 

The Device Type enables the practitioner to quickly and easily see, sort, and filter evidence items by the type of device that crated them, such as "Smartphone" or "DSLR". 

The Generator Signature is a unique value more specifically designed to provide an indication to the practitioner of picture files created probably by the same device, at around the same time, and in the same or very similar setup, such as a studio during a photoshoot, even if small parts of the picture differ (making a hash comparison useless). 



Viewing all 72 articles
Browse latest View live