CSN08101 Digital Forensics Lecture 5: Data management and Autopsy Module Leader: Dr Gordon Russell Lecturers: Robert Ludwiniak.

Slides:



Advertisements
Similar presentations
Haas MFE SAS Workshop Lecture 3:
Advertisements

Chapter 7 Data Management. Agenda Database concept Import data Input and edit data Sort data Function Filter data Create range name Calculate subtotal.
CS 497C – Introduction to UNIX Lecture 25: - Simple Filters Chin-Chih Chang
MENUS AND THE MENU EDITOR Elements of a Menu Menu bar Menu title Separator bar Menu items.
A.How to create string controls and indicators B.Some string functions C.How to perform file input and output operations D.How to format text files for.
Guide To UNIX Using Linux Third Edition
Introduction to Unix – CS 21 Lecture 5. Lecture Overview Lab Review Useful commands that will illustrate today’s lecture Streams of input and output File.
Homework Reading –Finish K&R Chapter 1 (if not done yet) –Start K&R Chapter 2 for next time. Programming Assignments –DON’T USE and string library functions,
Unix Filters Text processing utilities. Filters Filter commands – Unix commands that serve dual purposes: –standalone –used with other commands and pipes.
UNIX Filters.
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 13 Strings and File I/O  Read Bishop, Chapter 9.  Lab #13 and Homework #13 due next week.
Programming For Nuclear Engineers Lecture 12 MATLAB (3) 1.
January 24, 2005 Lecture 3 - By P. Lin 1 CPET 190 Lecture 3 Problem Solving with MATLAB
Advanced File Processing
Homework Reading Programming Assignments
MATLAB File Management. MATLAB User File Management Matlab provides a group of commands to manage user files. For more information, type help iofun. pwd.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
ASP.NET Programming with C# and SQL Server First Edition
CSN08101 Digital Forensics Lecture 1B: Essential Linux and Caine Module Leader: Dr Gordon Russell Lecturers: Robert Ludwiniak.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
Introduction to Unix (CA263) File Processing. Guide to UNIX Using Linux, Third Edition 2 Objectives Explain UNIX and Linux file processing Use basic file.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Import Data From Text Files and Other Sources Importing is the process of inserting data.
CS 497C – Introduction to UNIX Lecture 7: General-Purpose Utilities Chin-Chih Chang
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Session 3 Process and organize data 1. Terminology 2 For a list of computer and internet terminology, please see the.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
1 Functions 1 Parameter, 1 Return-Value 1. The problem 2. Recall the layout 3. Create the definition 4. "Flow" of data 5. Testing 6. Projects 1 and 2.
CS151 Introduction to Digital Design
Advanced Word - Lesson 1: Sorting and Calculating.
D75P 34 – HNC Computer Architecture Interim Week Hexadecimal revisited! © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except.
Advanced File Processing. 2 Objectives Use the pipe operator to redirect the output of one command to another command Use the grep command to search for.
Introduction to Bash Programming Ellen Zhang. Previous three classes What have we learnt so far ?
Shell Programming Any command or a sequence of UNIX commands stored in a text file is called a shell program. It is common to call this file a command.
Chapter Five Advanced File Processing Guide To UNIX Using Linux Fourth Edition Chapter 5 Unix (34 slides)1 CTEC 110.
CSN08101 Digital Forensics Lecture 4: System Level Disk Control Module Leader: Dr Gordon Russell Lecturers: Robert Ludwiniak.
Introduction to Unix – CS 21 Lecture 12. Lecture Overview A few more bash programming tricks The here document Trapping signals in bash cut and tr sed.
Asking the USER for values to use in a software 1 Input.
Chapter Five Advanced File Processing. 2 Lesson A Selecting, Manipulating, and Formatting Information.
Introduction to Unix (CA263) File Editing By Tariq Ibn Aziz.
Chapter Three The UNIX Editors.
Chapter 3 The Power of HEX Finding Slivers of Data.
External Executable Tools The Master's Touch David L. Blankenship.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Files Tutor: You will need ….
Agenda Positional Parameters / Continued... Command Substitution Bourne Shell / Bash Shell / Korn Shell Mathematical Expressions Bourne Shell / Bash Shell.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
Key Applications Module Lesson 14 — Working with Tables Computer Literacy BASICS.
Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley What did we learn so far? 1.Computer hardware and software 2.Computer experience.
CSN08101 Digital Forensics Lecture 2: Essential Linux for Forensics Module Leader: Dr Gordon Russell Lecturers: Robert Ludwiniak.
ORAFACT Text Processing. ORAFACT Searching Inside Files grep - searches for patterns within files grep [options] [[-e] pattern] filename [...] -n shows.
1 Working with MS SQL Server Beginning ASP.NET in C# and VB Chapter 12.
In the last class, Filters and delimiters The sample database pr command head and tail commands cut and paste commands.
Comp 335 – File Structures Hexadecimal Dumps Interpreting File Contents.
L071 Introduction to C Topics Compilation Using the gcc Compiler The Anatomy of a C Program Reading Sections
Base 16 (hexadecimal) Uses the decimal digits and the first letters of the alphabet to encode 4 binary bits (16=2 4 ) abcdef or ABCDEF.
Filters and Utilities. Notes: This is a simple overview of the filtering capability Some of these commands are very powerful ▫Only showing some of the.
SIMPLE FILTERS. CONTENTS Filters – definition To format text – pr Pick lines from the beginning – head Pick lines from the end – tail Extract characters.
ECE Application Programming
Chapter 6 Filters.
Chapter 2: Getting Data into SAS
Introduction to C Topics Compilation Using the gcc Compiler
Intro to PHP & Variables
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Chapter Four UNIX File Processing.
Spreadsheets, Modelling & Databases
Understanding Hex “I hope you have the worst headache of your life, then you will begin to understand” ~unknown.
Using screens and adding two numbers - addda.cbl
Introduction to Computer Science
Presentation transcript:

CSN08101 Digital Forensics Lecture 5: Data management and Autopsy Module Leader: Dr Gordon Russell Lecturers: Robert Ludwiniak

Data Management for Forensics You will learn in this lecture: Command Summary: –sort –xxd –echo This week is all about: –Reading and Writing bytes from binary files –sorting –Running autopsy

sort The “sort” command allows you to take files or data from a pipe and process the data a line at a time using a sorting algorithm. In the examples we will use a data file “me.txt”. $ cat me.txt alpha 20 delta 140 echo 9 beta 15

Simple sort $ cat me.txt alpha 20 delta 140 echo 9 beta 15 $ cat me.txt | sort alpha 20 beta 15 delta 140 echo 9

Column sort You can specify the column to sort using “-k” followed by the start and end column. We will use 1 column keys, so start and end column is always the same. This is an alphanumeric sort. $ cat me.txt alpha 20 delta 140 echo 9 beta 15 $ cat me.txt | sort –k 2,2 delta 140 beta 15 alpha 20 echo 9

Alphanumeric Alphanumeric sort is ASCII ordering. If you sort a number then the first character of the number is used, and other characters only considered when two rows have the same first character. $ cat me.txt | sort –k 2,2 delta 140 beta 15 alpha 20 echo 9

Numeric sort If you are sorting numbers and you want them sorted in numeric order then you must specify this. To do numeric sort put an “n” after the start and end column numbers, so “-k 2,2” becomes “-k 2n,2n” $ cat me.txt | sort –k 2n,2n echo 9 beta 15 alpha 20 delta 140

Delimiter It is assumed that each column is separated by whitespace. If your file is separated by a different character this must be specified using “-t”, followed with the delimiter in quotes with no spaces. $ cat me2.txt alpha,20 delta,140 echo,9 beta,15

Delimiter So a comma between the columns is specified using: -t”,” $ cat me2.txt | sort –t”,” –k 2n,2n echo,9 beta,15 alpha,20 delta,140

Uniqueness Finally, if two rows are the same then the rows are kept by default. Sometimes you want to remove duplicates. Use “-u” for unique... $ cat me2.txt | sort –t”,” –k 2n,2n echo,9 beta,15 alpha,20 delta, 140 $ cat me2.txt | sort –u –t”,” –k 2n,2n echo,9 beta,15 alpha,20 delta,140

Binary file viewing Sometimes you want to view the contents of a binary file. The normal method for binary viewing is to view it in hexadecimal. The “xxd” command allows you to do this, and will display a whole file in hex. $ xxd /bin/ls | less

Binary file viewing If you just want to view some of a file use dd to select what you want. For instance, view block 63 of /images/usbimg1.dd $ dd if=/images/usbimg1.dd skip=63 bs=512 count=1 | xxd

Binary file writing If you want to change a byte in a binary file you could use a complicated binary editor. However, a simple command line can often get you the same result using dd. To generate binary data in a pipe we will use the echo command. –Use “-n” to display printing a newline character at the end –Use “-e” to allow us to write escape sequences –Use “\xCC” where CC is the hex of the binary data to produce. For instance, to produce the binary code 0x65 (which in ASCII is the lowercase “e” character) just do: $ echo –ne “\x65”

Binary file writing Echo produces the data $ echo –ne “\x65” Use dd in a pipe to write the byte in question. –Use a blocksize of 1 byte –Use a count of 1 –Seek to the byte you are changing –Remember conv=notrunc to avoid deleting data For instance, set byte at offset100 of test.dat to 0xf5 $ echo –ne “\xf5” | dd of=test.dat count=1 bs=1 seek=100 conv=notrunc

Example Set byte offset 100 (i.e. Hex 0x64) of test.dat to 0xf5 $ xxd test.dat | less $ echo –ne “\xf5” | dd of=test.dat count=1 bs=1 seek=100 conv=notrunc $ xxd test.dat | less

Autopsy Autopsy is a graphical interface to the Caine CLI tools. Autopsy does not have all the features of the Caine tools, or even all the tools. However, you may find it easier to use for some challenges. The practicals make you use both the CLI tools and Autopsy...

Run Autopsy 2.24

Browser Control Access via the browser within Caine itself...

Deleting Cases and Hosts You will need to create “cases” and “hosts”. –A case can have many different hosts in it If you make a mistake there is no delete key in Autopsy. But you can delete the cases and hosts from the normal command line... Cases are directories stored in –/usr/share/caine/report/autopsy A host in a case is a directory in the case directory. So for example a host HOST in case CASE is a directory: –/usr/share/caine/report/autopsy/CASE/HOST/ To delete a directory and all its contents do: $ rm –rf /usr/share/caine/report/autopsy/WHATEVER

Next Week I have done my last lecture. From now on Robert will run the lectures. I will still be available in the practical sessions. Class test is week 8 in the practicals. Do not miss the test!

Assessment: Short-Answer Examples The short answer class test has no past papers yet (as this is a new module for this year). This section contains example questions which are of the same style as you might expect in the actual past paper. Obviously it is likely that the actual questions shown here are not the ACTUAL questions which will appear in the exam! Remember this short answer exam is CLOSED BOOK. You are not permitted to use the internet or access your notes during the exam.

Q1 Show a command line command which would set byte 561 of file hello.txt to 0x99. Insert answer here:

Q2 Consider the contents of the following file, “data.dat” 1;55;smith 2;10;jones 3;9;greg 4;199;allan Give a command line command which would sort this data by the second number in numerical order. Insert answer here:

Q3 Demonstrate a command line command to give a hex data dump of a file called “raw.dat”, but only showing bytes offsets10 to 20 inclusive. Insert answer here: