Textbook The Law Enforcement and Forensic Examiner S Introduction To Linux A Comprehensive Beginner S Guide To Linux As A Digital Forensic Platform Barry J Grundy Ebook All Chapter PDF
Textbook The Law Enforcement and Forensic Examiner S Introduction To Linux A Comprehensive Beginner S Guide To Linux As A Digital Forensic Platform Barry J Grundy Ebook All Chapter PDF
Textbook The Law Enforcement and Forensic Examiner S Introduction To Linux A Comprehensive Beginner S Guide To Linux As A Digital Forensic Platform Barry J Grundy Ebook All Chapter PDF
https://textbookfull.com/product/linux-administration-a-beginner-
s-guide-wale-soyinka/
https://textbookfull.com/product/practical-forensic-imaging-
securing-digital-evidence-with-linux-tools-1st-edition-bruce-
nikkel/
https://textbookfull.com/product/forensic-anthropology-a-
comprehensive-introduction-second-edition-natalie-r-langley/
https://textbookfull.com/product/wordpress-fundamentals-a-
comprehensive-beginner-s-guide-to-wordpress-3rd-edition-kathleen-
peterson/
Scala Programming A comprehensive beginner s guide to
Scala 2nd Edition Claudia Alves
https://textbookfull.com/product/scala-programming-a-
comprehensive-beginner-s-guide-to-scala-2nd-edition-claudia-
alves/
https://textbookfull.com/product/digital-forensic-art-techniques-
a-professionals-guide-to-corel-painter-first-edition-natalie-
murry/
https://textbookfull.com/product/forex-trading-a-comprehensive-
beginner-s-guide-to-learn-the-realms-of-forex-trading-from-a-z-
oliver-morrison/
https://textbookfull.com/product/alcohol-drugs-and-impaired-
driving-forensic-science-and-law-enforcement-issues-1st-edition-
a-wayne-jones-editor/
https://textbookfull.com/product/mastering-linux-shell-scripting-
a-practical-guide-to-linux-command-line-bash-scripting-and-shell-
programming-ebrahim/
The Law Enforc m nt and For nsic Examin r’s
Introduction to Linux
V rsion 4.33
Jun 2018
Barry J. Grundy
[email protected]
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
LEGALITIES................................................................................................................................ 5
ACKNOWLEDGMENTS..................................................................................................................... 5
FOREWORD............................................................................................................................... 6
A WORD ABOUT THE “GNU” IN GNU/LINUX.......................................................................................7
WHY LEARN LINUX?.................................................................................................................... 7
WHERE’S ALL THE GUI TOOLS?....................................................................................................... 9
THE EXERCISES – NEW AND OLD..................................................................................................... 9
LINUXLEO YOUTUBE CHANNEL..................................................................................................... 10
CONVENTIONS USED IN THIS DOCUMENT............................................................................................ 10
I. INSTALLATION..............................................................................................................12
DISTRIBUTIONS......................................................................................................................... 12
SLACKWARE AND USING THIS GUIDE...........................................................................................14
INSTALLATION METHODS............................................................................................................... 15
SLACKWARE INSTALLATION NOTES.................................................................................................... 15
SYSTEM USERS......................................................................................................................... 17
ADDING A NORMAL USER........................................................................................................ 17
THE SUPER USER................................................................................................................. 18
DESKTOP ENVIRONMENT............................................................................................................... 19
THE LINUX KERNEL.................................................................................................................... 20
KERNEL AND HARDWARE INTERACTION...............................................................................................20
HARDWARE CONFIGURATION..................................................................................................... 21
KERNEL MODULES................................................................................................................ 22
HOTPLUG DEVICES AND UDEV................................................................................................... 24
HOT PLUGGING DEVICES AND DESKTOPS......................................................................................25
II. LINUX DISKS, PARTITIONS AND THE FILE SYSTEM........................................27
DISKS................................................................................................................................... 27
DEVICE NODE ASSIGNMENT – LOOKING CLOSER....................................................................................30
THE FILE SYSTEM...................................................................................................................... 32
MOUNTING EXTERNAL FILE SYSTEMS................................................................................................ 33
THE MOUNT COMMAND.......................................................................................................... 34
THE FILE SYSTEM TABLE (/ETC/FSTAB)........................................................................................37
DESKTOP MOUNTING............................................................................................................. 38
III. THE LINUX BOOT SEQUENCE (SIMPLIFIED).....................................................41
BOOTING THE KERNEL.................................................................................................................. 41
SYSTEM INITIALIZATION................................................................................................................ 42
RUNLEVEL............................................................................................................................... 42
GLOBAL STARTUP SCRIPTS............................................................................................................ 43
SERVICE STARTUP SCRIPTS........................................................................................................... 44
BASH.................................................................................................................................... 44
IV. BASIC LINUX COMMANDS......................................................................................46
LINUX AT THE TERMINAL............................................................................................................... 46
ADDITIONAL USEFUL COMMANDS...................................................................................................... 48
COMMAND LINE MATH................................................................................................................ 50
BC – THE BASIC CALCULATOR..................................................................................................... 50
BASH SHELL ARITHMETIC EXPANSION........................................................................................... 52
FILE PERMISSIONS...................................................................................................................... 53
PIPES AND REDIRECTION.............................................................................................................. 54
2
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
FILE ATTRIBUTES....................................................................................................................... 57
METACHARACTERS..................................................................................................................... 59
COMMAND HINTS...................................................................................................................... 59
V. EDITING WITH VI........................................................................................................60
THE JOY OF VI......................................................................................................................... 60
VI COMMAND SUMMARY................................................................................................................ 61
VI. CONFIGURING A FORENSIC WORKSTATION...................................................62
SECURING THE WORKSTATION........................................................................................................ 62
CONFIGURING “RC” (STARTUP) SERVICES......................................................................................63
HOST BASED ACCESS CONTROL................................................................................................ 66
HOST BASED FIREWALL WITH IPTABLES......................................................................................... 71
UPDATING THE OPERATING SYSTEM.................................................................................................. 75
USING SLACKPKG.................................................................................................................. 76
INSTALLING AND UPDATING “EXTERNAL” SOFTWARE...............................................................................78
COMPILING FROM SOURCE....................................................................................................... 78
USING DISTRIBUTION PACKAGES................................................................................................80
BUILDING PACKAGES – SLACKBUILDS..........................................................................................81
USING THE AUTOMATED PACKAGE TOOL SBOTOOLS...........................................................................85
VII. LINUX AND FORENSICS.........................................................................................91
EVIDENCE ACQUISITION................................................................................................................ 91
ANALYSIS ORGANIZATION........................................................................................................ 91
WRITE BLOCKING................................................................................................................. 93
EXAMINING THE PHYSICAL MEDIA INFORMATION...............................................................................94
HASHING MEDIA.................................................................................................................. 99
COLLECTING A FORENSIC IMAGE WITH DD....................................................................................100
DD AND SPLITTING IMAGES..................................................................................................... 102
ALTERNATIVE IMAGING TOOLS................................................................................................. 105
DC3DD........................................................................................................................... 106
LIBEWF AND EWFACQUIRE....................................................................................................... 113
MEDIA ERRORS - DDRESCUE................................................................................................... 123
IMAGING OVER THE WIRE...................................................................................................... 132
OVER THE WIRE - DD.......................................................................................................... 135
OVER THE WIRE - DC3DD..................................................................................................... 136
OVER THE WIRE - EWFACQUIRESTREAM.......................................................................................138
OVER THE WIRE – OTHER OPTIONS.........................................................................................140
PREPARING A DISK FOR THE SUSPECT IMAGE................................................................................145
FINAL WORDS ON IMAGING.................................................................................................... 147
MOUNTING EVIDENCE................................................................................................................ 148
STRUCTURE OF THE IMAGE..................................................................................................... 148
IDENTIFYING FILE SYSTEMS.................................................................................................... 150
THE LOOP DEVICE.............................................................................................................. 151
LOOP OPTION TO THE MOUNT COMMAND......................................................................................151
LOSETUP.......................................................................................................................... 152
MOUNTING FULL DISK IMAGES WITH LOSETUP...............................................................................154
MOUNTING MULTI PARTITION IMAGES WITH KPARTX.........................................................................157
MOUNTING SPLIT IMAGE FILES WITH AFFUSE.................................................................................160
MOUNTING EWF FILES WITH EWFMOUNT....................................................................................164
ANTI-VIRUS – SCANNING THE EVIDENCE FILE SYSTEM WITH CLAMAV........................................................166
BASIC DATA REVIEW ON THE COMMAND LINE....................................................................................170
3
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
XI. CONCLUSION............................................................................................................306
4
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
Legalities
Acknowledgments
The list of coll agu s that hav contribut d ov r th many y ars has grown. I r main grat ful
to all that hav giv n th ir tim in r vi wing and providing valuabl f dback, and in som
cas s, simpl ncourag m nt to all v rsions of this guid ov r th y ars. My continu d thanks
to Cory Alth id , Brian Carri r, Christoph r Coop r, Nick Furn aux, John Garris, Rob rt-Jan
Mora, and J ss Kornblum for h lping m lay th foundation for this guid . And for mor
r c nt assistanc , I’d lik to thank Jacqu s Bouch r, Tobin Craig, Simson Garfienk l, Andr as
Guldstrand, Bill Norton, Paul St ph ns, Danny W rb, and as always, Robby Workman.
Finally, I cannot go without thanking my wif Jo and my sons Patrick and Tommy for th
s mingly ndl ss pati nc as th work was und rway.
5
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
Foreword
It’s b n n arly t n y ars sinc this guid has b n officcially updat d, and ov r fieftw n
y ars sinc its initial public r l as . In that tim , w ’v s n signifiecant chang s to th for nsic
industry, and a massiv growth in th d v lopm nt of softwwar and t chniqu s us d to uncov r
vid nc from an v r xpanding univ rs of d vic s. The purpos of this docum nt, how v r,
r mains unchang d. I am looking to provid an asy to follow and acc ssibl guid for for nsic
xamin rs across th full sp ctrum of this for nsic disciplin ; law nforc m nt officc rs,
incid nt r spond rs, and all comput r sp cialists r sponsibl for th inv stigation of digital
vid nc . Theis guid continu s to provid an introductory ov rvi w of th GNU/Linux (Linux)
op rating syst m as a for nsic platform for digital inv stigators and for nsic xamin rs.
Abov all, this r mains a b ginn r’s guid . An introduction. It is not m ant to b a full
cours on conducting for nsic xaminations. Theis docum nt is about th tools and th
conc pts us d to mploy th m. Introducing th m, providing simpl guidanc on using th m,
and som id as on how th y can b int grat d into a mod rn digital for nsics laboratory or
inv stigativ proc ss. Theis is also a hands on guid . It’s th b st way to l arn and w ’ll cov r
both basic GNU/Linux utiliti s and sp cializ d softwwar through short x rcis s.
GNU/Linux is a constantly volving op rating syst m. Distributions com and go, and
th r ar now a numb r of “stand out” Linux flaavors that ar commonly us d. In addition to
balancing th b ginn r natur of th cont nt of this guid with th advancing standards in
for nsic ducation, I also fiend mys lf trying to balanc th l v l of d tail r quir d to actually
t ach us ful tasks with th distribution sp cifiec natur of many of th commands and
confiegurations us d.
6
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
As w will discuss in furth r d tail lat r in this guid , many of th d tails ar sp cifiec to
on flaavor of Linux. In most cas s, th commands ar quit portabl and will work on most
any syst m. In oth r cas s (packag manag m nt and confieguration diting, tc.) you may fiend
that you n d to do som r s arch to d t rmin what n ds to b don on your platform of
choic . The d t rmination to provid sp cifiec d tails on actually confieguring a sp cifiec syst m
cam about through ov rwh lming r qu st for guidanc . The d cision to us my Linux
distribution of choic for for nsics as an xampl is p rsonal.
Ov r th y ars I hav r p at dly h ard from coll agu s that hav tri d Linux by
installing it, and th n proc d d to sit back and wond r “what n xt?” I hav also nt rtain d a
numb r of r qu sts and sugg stions for a mor xpansiv xploration of tools and utiliti s
availabl to Linux for for nsic analysis at th application l v l as w ll as num rous r qu sts for
prop r confieguration guid lin s for a bas lin Linux workstation. You hav a copy of this
introduction. Now download th x rcis s and driv on. Theis is only th start of your r ading.
Utiliz d corr ctly, this guid should prompt many mor qu stions and kick start your l arning.
In th y ars sinc this docum nt was fierst r l as d a numb r of xc ll nt books with far mor
d tail hav cropp d up cov ring op n sourc tools and Linux for nsics. I still lik to think this
guid will b us ful for som .
http://www.LinuxLEO.com
On of th qu stions h ard most oftw n is: “why should I us Linux wh n I alr ady hav
[insert Windows GUI forensic tool here]?” The r ar many r asons why Linux is quickly gaining
ground as a for nsic platform. I’m hoping this docum nt will illustrat som of thos
atteribut s.
7
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
Control – not just ov r your for nsic softwwar , but th whol OS and
atteach d hardwar .
Fl xibility – boot from a CD (to a compl t OS), fiel syst m support,
platform support, tc.
Pow r – A Linux distribution is (or can b ) a for nsic tool.
Anoth r point to b mad is that simply knowing how Linux works is b coming mor and
mor important. Whil many of th Windows bas d for nsic packag s in us today ar fully
capabl of xamining Linux syst ms, th sam cannot b said for th xamin rs.
As Linux b com s mor and mor popular, both in th comm rcial world and with d sktop
us rs, th chanc that an xamin r will ncount r a Linux syst m in a cas b com s mor
lik ly ( sp cially in n twork inv stigations). Ev n if you l ct to utiliz a Windows for nsic
tool to conduct your analysis, you must at l ast b familiar with th OS you ar xamining. If
you do not know what is normal, th n how do you know what do s not b long? Theis is tru
on so many l v ls, from th actual cont nts of various dir ctori s to strang ntri s in
confieguration fiel s, all th way down to how fiel s ar stor d. Whil this docum nt is mor
about Linux as a for nsic tool rath r than analysis of Linux, you can still l arn a lot about how
th OS works by actually using it.
The r is also th issu of cross-v rifiecation. A working knowl dg of Linux and its for nsic
utility can provid an xamin r with alternative tools on an alternative platform to us as a
m thod to v rify th fiendings of oth r tools on oth r op rating syst ms. Many xamin rs hav
sp nt countl ss hours l arning and using common industry standard Microsoftw Windows
for nsic tools. It would b unr alistic to think that r ading this guid will giv an xamin r th
sam l v l of confied nc , som tim s built through y ars of xp ri nc , as th y hav with th ir
traditional tools of choic . What I can hop is that this guid will provid nough information
to giv th xamin r “anoth r tool for th toolbox”, wh th r it's imaging, r cov ring, or
xamining. Linux as an alt rnativ for nsic platform provid s a p rf ct way to cross ch ck
your work and v rify your r sults, v n if it is not your primary choic .
8
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
The fierst is that Linux (and UNIX) fiend th ir foundation at th command lin . Mod rn
Linux and UNIX impl m ntations ar still, at th ir h arts, driv n by syst m that is most
acc ssibl from a command lin int rfac . For this r ason, knowing how to int ract with th
command lin provid s xamin rs th wid st rang of capabiliti s r gardl ss of th distribution
or confieguration of Linux ncount r d. Y s, this is about for nsic tools and utiliti s, but it’s
also about b coming comfortabl with Linux. It is for this r ason that w continu to l arn a
command lin ditor lik vi and simpl bit l v l copying tools lik dd. The r ’s a v ry high
probability that any Linux/UNIX syst m you com across will hav th s tools.
S cond is that knowing and und rstanding th command lin is, in and of its lf, a v ry
pow rful tool. Onc you r aliz th pow r of command pip s and flaow control (using loops
dir ctly on th command lin ), you will fiend yours lf abl to pow r through probl ms far fast r
than you pr viously thought. L arning th prop r us and pow r of utiliti s lik awk, sed, and
grep will op n som pow rful t chniqu s for parsing structur d logs and oth r data sourc s.
Theis guid should provid som basic und rstanding of how thos can b us d. Onc you
und rstand and start to l v rag this pow r, you will fiend yours lf pining for a command lin
and its utiliti s wh n on is not availabl .
The r ar updat s across th board in this v rsion of th guid . Wh r old (and still
us ful) x rcis s r main from pr vious v rsions, th output and tool usag has b n r fr sh d
to r fla ct th curr nt v rsions of th tools us d. Whil som what aging, th s x rcis s and
th fiel s us d to pr s nt th m r main us ful and hav not b n r mov d.
N w x rcis s hav also b n add d to allow for additional cont nt cov ring application
lay r analysis tools and oth r r c nt additions to th Linux for nsics ars nal. K p in mind
that whil this docum nt do s cov r som for nsic strat gi s and basic fundam ntals, it is
r ally about th tools w us and th conc pts b hind mploying th m. As such som of th
9
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
old r x rcis fiel s may s m a bit dat d but th y still s rv th purpos of providing a probl m
s t on which w can l arn commands r gardl ss of th targ t.
Theis v rsion of th guid is NOT a s qu l. It’s an updat – but with som n w mat rial.
You can fiend d monstrations and simpl vid o xampl s of som of th following
chapt rs on th LinuxLEO YouTub chann l at 1:
The r is littel cont nt th r now, but mor will b add d as tim go s on. Subscrib and
you will b notifie d as vid os ar upload d.
Wh n illustrating a command and it's output, you will s som thing lik th following:
root@forensic1:~# command
output
root@forensic1:~#
1
I knowNnot a pr ttey URL, but I n d subscrib rs for that!
10
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
barry@forensic1:~$
root@forensic1:~# command
... <--- removed output for brevity
output
... <--- removed output for brevity
11
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
I. Installation
Much has chang d in th past f w y ars with r sp ct to th robustn ss and f atur s t of
th curr nt Linux k rn ls. Hardwar d t ction and confieguration us d to pr s nt som uniqu
chall ng s for Linux novic s. Whil issu s can still occasionally aris , th fact is that s tteing
up a Linux machin as a simpl workstation is no long r th nail biting x rcis in frustration
that it onc was. K rn l d t ction of hardwar has b com th norm, and most distributions of
Linux can b install d with a minimum of fuss on all but th most cutteing dg hardwar (and
usually v n th n).
For th vast majority of comput rs out th r , th d fault k rn l driv rs and s tteings will
work “out of th box” for both old and n w syst ms. The rang of onlin h lp availabl for any
giv n distribution is far wid r now than it was v n t n y ars ago, and most probl ms can b
solv d with a targ t d Int rn t s arch. For the most part, solutions that ar ffo ctiv on on
distribution will b ffo ctiv across th board. Theis may not always b th cas , but if you ar
familiar with your syst m, you can oftw n int rpr t solutions and apply th m to your particular
platform.
If your Linux machin is to b a dual boot syst m with Windows, you can us th
Windows D vic Manag r to r cord all your install d hardwar and th s tteings us d by
Windows. Hardwar compatibility and d t ction hav b n greatly improv d ov r th past
coupl of y ars. Most of th r c nt v rsions of Linux distributions hav xtraordinary
hardwar d t ction. But it still h lps to hav a good id a of th hardwar you ar using so if
probl ms do aris your support qu ri s can b targ t d.
Distributions
12
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
manag m nt archit ctur and confieguration, tc.) and th packag format (th softwwar install
and upgrad path) most commonly diffo r ntiat th various Linux distros.
Pr vious v rsions of this guid provid d a short list of distros and a summary
d scription of ach. Theat has b n r mov d h r for a mor d scriptiv xplanation of why w
hav so many distributions, and how you can choos from among th m. Ev ryon has an
opinion on th s , and th y all hav th ir str ngths and appar nt w akn ss s.
▪ BlackArch Linux – A n w r proj ct, bas d on Arch Linux, that provid s anoth r
alt rnativ “out of th box” s curity focus d distribution.
The r ar many oth rs, along with s l ctions for s curity focus d bootabl distros,
“lightw ight” distros, and many oth rs. Don’t l t th options confus you, though. Find a
mainstr am distribution, install it and l arn it.
Our pr viously m ntion d “g n ral workstation” Linux distros ar all p rf ctly suitabl
for us as a for nsic platform. A majority of p opl n w to Linux ar gravitating toward
Ubuntu as th ir platform of choic . The support community is hug , and a majority of wid ly
13
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
availabl softwwar for Linux for nsics is sp cifiecally built for and support d on Ubuntu (though
not xclusiv ly in most cas s). On a p rsonal not , I fiend Ubuntu l ss than id al for l arning
Linux. Theis is NOT to say that Ubuntu or its variations don’t mak xc ll nt for nsic
platforms. But this guid is focus d on learning, and part of that journ y includ s starting with
a cl an slat and und rstanding how th op rating syst m works and is mad to suit your
nvironm nt. For that w focus on a mor Unix lik distribution.
If you ar unsur wh r to start, will b using this guid as your primary r f r nc , and
ar int r st d mainly in for nsic applications of Linux, th n I would sugg st Slackwar . The
original comm rcial distribution, Slackwar has b n around for y ars and provid s a good
standard Linux that r mains tru to th Unix philosophy. Not ov r- ncumb r d by GUI
confieguration tools, Slackwar aims to produc th most “UNIX-lik ” Linux distribution
availabl . On of my p rsonal favorit s, and in my humbl opinion, curr ntly on of th b st
choic s for a for nsic platform. (http://www.slackware.com/). Theis guid is tailor d for us
with a Slackwar Linux installation.
B caus of diffo r nc s in archit ctur , th Linux distribution of your choic can caus
diffo r nt r sults in commands' output and diffo r nt b havior ov rall. Additionally, som
s ctions of this docum nt d scribing confieguration fiel s, startup scripts or softwwar installation,
for xampl , might app ar vastly diffo r nt d p nding on th distro you s l ct.
14
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
Slackwar Linux is stabl , consist nt, and simpl . As always, Linux is Linux. Any
distribution can b chang d to function lik any oth r (in th ory). How v r, my philosophy has
always b n to start with an optimal syst m, rath r than atte mpt to “roll back” a syst m
h avily modifie d and optimiz d for th d sktop rath r than a for nsic workstation.
Installation Methods
During a standard installation, much of th work is don for you, and r lativ ly saf
d faults ar provid d. As m ntion d arli r, hardwar d t ction has gon through som gr at
improv m nts in r c nt y ars. I strongly b li v that many (if not most) Linux distros ar far
asi r and fast r to install than oth r “mainstr am” op rating syst ms. Typical Linux
installation is w ll docum nt d onlin (ch ck your sp cifiec distribution’s w bsit for mor
information). The r ar num rous books availabl on th subj ct, and most of th s ar
suppli d with a Linux distribution r ady for install.
Familiariz yours lf with Linux disk and partition naming conv ntions (cov r d in Chapt r
II of this docum nt) and you should b r ady to start.
If you do d cid to giv Slackwar a shot, h r ar som simpl guid lin s. The
docum ntation provid d on Slackwar 's sit is compl t and asy to follow. R ad th r
fierstNpl as .
D cid on standalon Linux or dual boot. Install Windows fierst in a dual boot syst m.
D t rmin how you want th Linux syst m to b partition d. A singl root partition and a
singl swap partition ar fien . You might fiend it asi r wh n fierst starting out to install Linux
in a virtual machin (VM), ith r through VirtualBox or VMwar for xampl . Theis will allow
you to snapshot along th way and r cov r from any rrors. It also provid s you with acc ss
to community support via th host whil installing your Linux syst m in a VM. Using Linux in
a virtual machin is a p rf ctly acc ptabl way to follow this guid , and probably th asi st if
you ar an absolut b ginn r.
15
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
READ through th installation docum ntation before you start th proc ss. Don't b in
a hurry. If you want to l arn Linux, you hav to b willing to r ad. For Slackwar , hav a look
through th installation chapt rs of th updat d “Slack Book” locat d at
http://www.slackbook.org/beta. The r ar detailed instructions th r if you n d st p by
st p h lp, including partitioning, tc. For a basic und rstanding of how Slackwar works and
how to us it, th Slack Book should b your fierst stop. Som of it may b a bit outdat d, but
th majority of it still appli s.
16
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
• Wh n ask d to format th root partition, I would sugg st s l cting th xt4 fiel syst m.
• Wh n ask d which packag s to s l ct for installation, it is usually saf for a b ginn r to
s l ct “ v rything” or “full”. Theis allows you to try all th packag s, along with
multipl X Window d sktop nvironm nts. Theis can tak as much as 8GB to 12GB on
som of th n w r distributions (7GB on Slackwar , d p nding on options), how v r it
includ s all th softwwar you ar lik ly to n d for a long tim (including many “officc ”
typ applications, Int rn t, -mail, tc.). For a l arning box it will giv you th most
xposur to availabl softwwar for xp rim ntation and additionally nsur s that you
don’t omit librari s that may b n d d for softwwar compilation lat r.
4) Installation Confieguration
• Boot M thod (th Boot load rNs l cts th OS to boot)
• B mindful of EFI vs. l gacy BIOS options. Wh r possibl , s t th BIOS to l gacy
mod .
• LILO or GRUB.
• LILO is th d fault for Slackwar . Som fiend GRUB mor fla xibl and s cur . GRUB
can b install d lat r, if you lik . P rsonally, I pr f r LILO.
• Usually s l ct th option to install LILO to th mast r boot r cord (MBR). The
pr s nc of oth r boot load rs (as provid d by oth r op rating syst ms)
d t rmin s wh r to install LILO or GRUB.
• If you must us EFI, skip this and install lilo or GRUB manually. You should
read README_UEFI.TXT on th install m dia’s root dir ctory b for
b ginning th installation proc ss.
• The boot load r contains th cod that points to th k rn l to b boot d.
• Cr at a us r nam for yours lf – avoid using root xclusiv ly.
• For mor information, ch ck th fiel CHANGES_AND_HINTS.TXT on th install m dia. Theis
fiel is load d with us ful hints and chang s of int r st from on r l as to anoth r.
System Users
For nsic analysis, most notably acquisitions, and basic syst m administration will
normally r quir root p rmissions. But simply logging in as root and conducting your analysis,
particularly from an X Window s ssion, is not advisabl . W n d to add a normal us r
account. From th r you can us su to log in as root t mporarily (cov r d in th n xt s ction).
17
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
• Login Nam
• UID (us r ID)
• Initial Group and Group m mb rship
• Hom Dir ctory
• Sh ll
• Account Expiration Dat
• Account G n ral Info (nam , addr ss, tc.)
• Password
For th most part, th d faults ar acc ptabl ( v n th d fault groups – b car ful not
to skip this part). You invok th script with th command adduser (run as root, obviously)
and th program will prompt you for th r quir d information. Wh n it asks you for
additional groups, b sur to us th up arrow on your k yboard to display availabl groups.
Acc pting th d fault is fien for our purpos s.
Onc compl t , you can log out compl t ly using th xit command and log back in as a
normal us r.
So, w 'v stablish d that w n d to run our syst m as a normal us r. If Linux giv s
you an rror m ssag "Permission denied", th n in all lik lihood you n d to b root to x cut
th command or dit th fiel , tc. You don't hav to log out and th n log back in as root to do
this. Just us th su command to giv yours lf root p rmissions (assuming you know root’s
password). Ent r th password wh n prompt d. You now hav root privil g s (th syst m
prompt will r fla ct this). Wh n you ar fienish d using your su login, r turn to your original
login by typing exit. H r is a sampl su s ssion:
barry@forensic1:~$ su -
Password:
root@forensic1:~# whoami
root
18
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
root@forensic1:~# exit
logout
barry@forensics1:~$
Not that th "-" aftw r su allows Linux to apply root's nvironm nt (including root’s
path) to your su login. So you don't hav to nt r th full path of a command. Actually, su is a
“switch us r” command, and can allow you to b com any us r (if you know th password),
not just root. Notic that aftw r w typ exit as root, our prompt indicat s that w ar back to
our normal us r.
Desktop Environment
Wh n talking about for nsic suitability, your choic of d sktop syst m can mak a
diffo r nc . First of all, th t rm “d sktop nvironm nt” and “window manag r” ar NOT
int rchang abl . L t's bri flay clarify th compon nts of a common Linux GUI.
19
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
manag m nt ov r th d sir for “ y -candy”, tc. You can also l ct to run a Window Manag r
without a d sktop nvironm nt. For xampl , th Enlight nm nt Window Manag r is known
for it's y -candy and can b run standalon , with or without KDE or GNOME, tc.
Slackwar no long r com s with GNOME as an option, though it can b install d lik
any oth r application. During th bas Slackwar installation, you will b giv n a choic of
KDE, XFCE, and som oth rs. I would lik to sugg st XFCE. It provid s a cl an r int rfac for
a b ginn r to l arn on. It is l an r and th r for l ss r sourc int nsiv . You still hav acc ss
to many KDE utiliti s, if you l ct d to install KDE during packag s l ction. You can install
mor than on d sktop and switch b tw n th m, if you lik . The asi st way to switch is with
th xwmconfig command.
As with all for nsic tools, w n d to hav a cl ar vi w of how any k rn l v rsion will
int ract with our for nsic platforms and subj ct hardwar . Almost all curr nt distributions of
Linux alr ady com with a v rsion 4 k rn l install d by d fault, including Slackwar (4.4).
root@forensic1:~# uname -a
Linux forensic1 4.4.14 #2 SMP Fri Jun 24 13:38:27 CDT 2016 x86_64 Intel(R)
Core(TM) i5-3550 CPU @ 3.30GHz GenuineIntel GNU/Linux
The k y to th saf for nsic us (from an vid ntiary standpoint) of ANY op rating
syst m is knowl dg of your nvironm nt and prop r t sting. Pl as k p that in mind. You
MUST und rstand how your hardwar and softwwar int ract with any giv n op rating syst m
b for using it in a “production” for nsic analysis. If for som r ason you f l th n d to
upgrad your k rn l to a n w r v rsion ( ith r through automat d updat s or manually), mak
sur you r ad th docum ntation and th chang log so you hav an und rstanding of any
signifiecant archit ctural chang s that may impact th for nsic nvironm nt.
In this s ction, w will focus on th minimum confieguration knowl dg for bas lin
und rstanding of a sound for nsic nvironm nt und r curr nt Linux distributions. W will
20
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
bri flay discuss hardwar confieguration and inv ntory, d vic nod manag m nt (Udev) and th
d sktop nvironm nt.
Hardware Configguration
It’s always us ful to know xactly what hardwar is on your syst m. The r will b
tim s wh n you might n d to chang or s l ct diffo r nt k rn l driv rs or modules to mak a
pi c of hardwar run corr ctly. B caus th r ar so many diffo r nt hardwar confiegurations
out th r , sp cifiecally confieguring driv rs for your syst m will r main outsid th scop of this
guid . K rn l d t ction and confieguration of d vic s (n twork int rfac s, graphics controll rs,
sound, tc.) is automatic in most cas s. If you hav any issu s, mak not of your hardwar
(s b low) and do som s arching. Googl is your fri nd, and th r is a list of h lpful starting
plac s for assistanc at th nd of this guid .
root@forensic1:~# lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core
processor DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core
processor PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd
Gen Core processor Graphics Controller (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family
USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series
Chipset Family MEI Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation 82579V Gigabit Network
Connection (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family
USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family
High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family
PCI Express Root Port 1 (rev c4)
21
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
R ading through this output you can s things lik th fact that th n twork int rfac
in this syst m is an Int l 825579V chips t. Theis is us ful information if you ar having issu s
with g tteing th int rfac to work and you want to s arch for support. You ar far mor lik ly
to g t us ful h lp if you s arch for “Linux Int l 825579v not working” rath r than “Linux
n twork card not working”.
Kernel Modules
On on laptop, for xampl , th output (abbr viat d) for th n twork int rfac s, using
lspci, might look lik this:
22
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
Theis shows both a wir d Eth rn t port and a wir l ss adapt r. If I want d to s xactly
which modul is b ing us d to driv th s d vic s, I can us th -k option to lspci:
Theis tim th output provid s som additional information, including which modul s
ar load d wh n th d vic is d t ct d. Theis can b an important pi c of information if I’m
trying to troubl shoot a misb having d vic . Onlin h lp might sugg st using a diffo r nt
driv r altog th r. If that is th cas , th n you may n d to “blacklist” th curr ntly load d
modul in ord r to pr v nt it from loading and hind ring th corr ct driv (that you may n d
to sp cify). Blacklisting is normally don in /etc/modules.d/ by ith r cr ating a
blacklist-[modulename].conf fiel or making an ntry in blacklist.conf, d p nding on
your distribution. In Slackwar , you can r ad th README fiel in /etc/modules.d and th man
pag for modules.d for mor information. Sinc th st ps for this vary wildly d p nding on
th driv r, it’s d p nd nci s, and th xist nc of comp ting modul s, w won’t cov r this in
any mor d pth. Sp cifiec h lp for individual driv r issu s can b found onlin . Theis simply
introduc s you to pot ntial sourc s of information.
Not that if you ar using a laptop or d sktop with a USB wir l ss adapt r, it lik ly won’t show
up in lspci. For that you’ll hav to us lsusb (list USB – th r ’s a patte rn h r , s ?). In th
following output, lsusb r v als info about a wir l ss n twork adapt r. Us th -v option for
mor v rbos output (bold for mphasis):
root@forensic1:~# lsusb
...
Bus 001 Device 054: ID 2109:2812 VIA Labs, Inc. VL812 Hub
23
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
Bus 001 Device 004: ID 174c:2074 ASMedia Technology Inc. ASM1074 High-Speed
hub
Bus 001 Device 079: ID 1b1c:1a06 Corsair
Bus 001 Device 003: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 001 Device 007: ID 11b0:6598 ATECH FLASH TECHNOLOGY
Bus 001 Device 120: ID 148f:5372 Ralink Technology, Corp. RT5372 Wireless
Adapter
Bus 001 Device 005: ID 174c:2074 ASMedia Technology Inc. ASM1074 High-Speed
hub
Bus 001 Device 050: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
...
24
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
at all tim s, wh th r in us or not. For xampl , on a syst m with static d vic nod s w may
hav a primary SATA hard driv that is d t ct d by th k rn l as /dev/sda. Sinc w hav no
IDE driv s, no driv is d t ct d as /dev/hda. But wh n w look in th /dev dir ctory w s
static nod s for all th possibl disk and partition nam s for /dev/hda. The d vic nod s xist
wh th r or not th d vic is d t ct d.
In mod rn Linux syst ms, Ud v cr at s d vic nod s “on th flay”. The nod s ar cr at d
as th k rn l d t cts th d vic and th /dev dir ctory is populat d in r al tim . In addition to
b ing mor fficci nt, Ud v also runs in us r spac . On of th b n fiets of Ud v is that it
provid s for “p rsist nt naming”. In oth r words, you can writ a s t of rul s that will allow
Ud v to r cogniz a d vic bas d on individual charact ristics (s rial numb r, manufactur r,
mod l, tc.). The rul can b writte n to cr at a us r-d fien d link in th /dev dir ctory, so that
for xampl , my thumb driv can always b acc ss d through an arbitrary d vic nod nam of
my choic , lik /dev/my-thumb, if I so choos . Theis m ans that I don't hav to s arch through
USB d vic nod s to fiend th corr ct d vic nam if I hav mor than on xt rnal storag
d vic conn ct d. I can conn ct 4 USB d vic s and inst ad of s arching through /dev/sdc,
sdd, sde, and sdf – I can just go to /dev/my-thumb. For a nic , if som what outdat d,
xplanation of Ud v rul s, s : httep://r activat d.n t/writing_Ud v_rul s.html.
XFCE is a light r w ight (r ad: light r on r sourc s) d sktop. And although XFCE is
also capabl of automatically handling hot plugg d d vic s, it allows for asi r control of
r movabl m dia on th d sktop. As an xampl , consid r th following snapshot of an XFCE
s tteings dialog for r movabl m dia. By d fault, on Slackwar 14.2, d vic s ar NOT auto
mount d in th XFCE nvironm nt. Not all distributions might b confiegur d this way,
how v r. B sur to ch ck and t st for yours lf. As a for nsic xamin r, you do NOT want
your syst m automatically mounting d vic s simply b caus you plugg d th m into th
syst m.
25
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
26
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
Disks
Linux tr ats its d vic s as fiel s. Theis is an important conc pt for for nsic xamin rs. It
m ans, as w will s lat r on, that many of th commands w can us on r gular fiel s, w can
also us on disks “fiel s”. W can list th m, hash th m and s arch th m in much th sam way
w do fiel s in any standard us r dir ctory. The sp cial dir ctory wh r th s d vic "fiel s" ar
maintain d is /dev. Old r IDE disks would b d t ct d and assign d hd* nam s. W rar ly
s thos anymor .
The patte rn d scrib d abov is fairly asy to follow. If you ar using a standard SATA
disk, it will b r f rr d to as sdx wh r th x is r plac d with an a for th fierst d t ct d driv
and b for th s cond, tc. In th sam way, th CDROM or DVD driv s conn ct d via th
SATA bus will b d t ct d as /dev/sr0 and th n /dev/sr1, tc.
Not that th /dev/sdx d vic nod s will includ USB and Fir wir d vic s. For
xampl , a primary SATA disk will b assign d sda. If you atteach a USB disk or a thumb driv
it will normally b d t ct d as sdb, and so on.
27
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
root@forensic1:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
|-sda1 8:1 0 256M 0 part /boot
|-sda2 8:2 0 32G 0 part [SWAP]
`-sda3 8:3 0 899.3G 0 part /
sdb 8:16 0 238.5G 0 disk
sdc 8:32 0 931.5G 0 disk
`-sdc1 8:33 0 931.5G 0 part
sdi 8:128 0 931.5G 0 disk
`-sdi1 8:129 0 931.5G 0 part /run/media/barry/Evid
sdj 8:144 1 29.3G 0 disk
`-sdj1 8:145 1 29.3G 0 part /run/media/barry/Kingston
sr0 11:0 1 2.6G 0 rom
You can s from th output that disks and partitions ar list d, and if any of th
partitions ar mount d, lsblk will also giv us th curr nt mount point. In this cas w s
/dev/sda1 is mount d on /boot, /dev/sda2 is our swap partition, /dev/sda3 is our root
partition, and w hav /dev/sdi1 mount d as /run/media/barry/Evid and /dev/sdj1
mount d as /run/media/barry/Kingston. The last two volum s ar from xt rnal d vic s,
plugg d in and mount d via th d sktop.
Anoth r som what mor us ful command that is lsscsi. I pr f r lsscsi b caus although it
do s not show partitions, it do s giv a b tte r id a of what th volum s ar
root@forensic1:~# lsscsi
[1:0:0:0] disk ATA ST1000DM003-1ER1 CC45 /dev/sda
[2:0:0:0] cd/dvd HL-DT-ST BD-RE WH16NS40 1.00 /dev/sr0
[11:0:0:0] disk ATA SAMSUNG MZHPV256 500Q /dev/sdb
[23:0:0:0] disk EXS3 CF Kiosk Reader 0575 /dev/sdd
[23:0:0:1] disk EXS3 SD Kiosk Reader 0575 /dev/sde
[23:0:0:2] disk EXS3 MS Kiosk Reader 0575 /dev/sdf
[23:0:0:3] disk EXS3 MSD Kiosk Reader 0575 /dev/sdg
[23:0:0:4] disk EXS3 XD Kiosk Reader 0575 /dev/sdh
[28:0:0:0] disk ST1000DM 003-1ER162 6207 /dev/sdc
[28:0:0:1] disk ST1000DM 003-1ER162 6207 /dev/sdi
[32:0:0:0] disk Kingston DataTraveler 3.0 PMAP /dev/sdj
You can s in th output abov that this particular syst m has a numb r of USB
d vic s and xt rnal m dia atteach d. Theis is a us ful way of fiending out what storag m dia
ar atteach d to a syst m. You’ll also notic that th r ar “disks” id ntifie d by lsscsi that ar
not list d by lsblk. Theis is b caus lsscsi is actually looking what is atteach d to th
int rfac , not th actual m dia. So lsscsi is id ntifying m dia r ad rs that hav no m dia
ins rt d. lsscsi do s not com on most platforms by d fault (although it do s on Slackwar ).
28
v.4.33 A Comprehensive Beginner’s Guide to Linux as a Digital Forensic Platform
If your syst m do s not hav it by d fault, ch ck your distribution’s packag manag r and
install it.
The r ar oth r nam s, using links, that can acc ss th s d vic nod s. If you xplor
th /dev/disk dir ctory you will s links that provid acc ss to th disk d vic s through
volum lab ls, disk UUID, k rn l path, tc. The s nam s ar us ful to us b caus th y can b
us d to acc ss a particular disk in a r p atabl mann r without having to know what d vic
nod (/dev/sdc or /dev/sdd for xampl ) a disk will b assign d. For now, just b awar that
you can acc ss a disk by a nam oth r than th simpl sdx assign d nod . Also not that som
of th assign d nod s might not y t hav m dia atteach d. In many cas s m dia r ad rs can b
d t ct d and assign d nod s b for m dia is ins rt d. In that cas , th following st ps will
simply display No medium found.
Now that w hav an id a of what our disks ar nam d, w can look at th partitions
and volum s. The fdisk program can b us d to cr at or list partitions on a support d d vic .
Theis is an xampl of th output of fdisk on a Linux workstation using th “list” option ( -l
[dash “ l”]):
fdisk –l /dev/sdx giv s you a list of all th partitions availabl on a particular driv .
Each partition is id ntifie d by its Linux nam . The b ginning and nding s ctors for ach
partition is giv n. The numb r of s ctors p r partition is display d. Finally, th partition typ
is display d.
Not that th output of fdisk will chang d p nding on th Disklabel type of th m dia
b ing qu ri d. The abov output shows a disk with a GPT lab l. If you hav a standard DOS
styl MBR, th output will show slightly diffo r nt fie lds. For nativ handling of GPT partition
lab ls, you can us gdisk
Do not confus Linux fdisk with th old r DOS fdisk (for thos of us old nough to
r m mb r such things). The y ar v ry diffo r nt. The Linux v rsion of fdisk provid s for
much gr at r control ov r partitioning.
29
Another random document with
no related content on Scribd:
and a moderate amount of health may be good. A gummy
intracranial or spinal growth, giving rise to alarming symptoms, may
vanish as by magic upon prompt treatment. The symptoms of these
frank, specific growths are, as a general thing, characteristic and
widely different from those of the more insidious destructive lesions.
“As to the pathology of these cases, I can say but little, as such
discussion opens the whole subject of the pathology of syphilis. This
I will say, that, so far as can be told without autopsies, no permanent
pathological condition was present in these cases which might not
have been brought about by other etiological factors which were
often present. The periencephalitis might be caused by alcohol,
mental strain, or excesses; the arterial occlusion might be due to
previous disease not specific.”
46 Medical News, vol. xlviii. No. 3, Jan. 16, 1886, p. 64.
While morphia and bromide of potassium are, on the whole, the most
useful remedies for the relief of pain and irritating symptoms of brain
tumor, other remedies can often be used with great advantage as
adjuvants. Ergot in the form of the solid or fluid extract has a
beneficial influence in relieving the congestive symptoms. Cannabis
indica in the form of the fluid extract in doses of five to ten minims, or
the tincture in doses of fifteen to thirty minims, may be
advantageously combined with morphia and a bromide, or
sometimes may be tried alone. Hyoscyamus, either the fluid extract
or tincture, in somewhat larger doses may also be tried. The great
severity of the headache and the imperative demand, however, will
usually compel the physician to fall back at last upon morphia in
large dose by the mouth or hypodermically.