DFIR Toolkit: CLI tools for forensic investigation of Windows artifacts

DFIR Toolkit

CLI tools for forensic investigation of Windows artifacts

Overview of timelining tools

 

Windows forensic investigation

Install

cargo install dfir-toolkit

Tool

cleanhive

merges logfiles into a hive file

evtx2bodyfile

[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”Usage%3A%20evtx2bodyfile%20%5BOPTIONS%5D%20%5BEVTX_FILES%5D…%0A%0AArguments%3A%0A%20%20%5BEVTX_FILES%5D…%20%20names%20of%20the%20evtx%20files%0A%0AOptions%3A%0A%20%20-J%2C%20–json%20%20%20%20%20%20%20%20output%20json%20for%20elasticsearch%20instead%20of%20bodyfile%0A%20%20-S%2C%20–strict%20%20%20%20%20%20fail%20upon%20read%20error%0A%20%20-v%2C%20–verbose…%20%20More%20output%20per%20occurrence%0A%20%20-q%2C%20–quiet…%20%20%20%20Less%20output%20per%20occurrence%0A%20%20-h%2C%20–help%20%20%20%20%20%20%20%20Print%20help%0A%20%20-V%2C%20–version%20%20%20%20%20Print%20version”/]

Example

[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”%23%20convert%20to%20bodyfile%20only%0Aevtx2bodyfile%20Security.evtx%20%3ESecurity.bodyfile%0A%0A%23%20create%20a%20complete%20timeline%0Aevtx2bodyfile%20*.evtx%20%7C%20mactime2%20-d%20-b%20%3Eevtx_timeline.csv”/]

 

evtxanalyze

Analyze evtx files

[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”Usage%3A%20evtxanalyze%20%5BOPTIONS%5D%20%3CCOMMAND%3E%0A%0ACommands%3A%0A%20%20pstree%20%20%20%20generate%20a%20process%20tree%0A%20%20sessions%20%20display%20sessions%0A%20%20session%20%20%20display%20one%20single%20session%0A%20%20help%20%20%20%20%20%20Print%20this%20message%20or%20the%20help%20of%20the%20given%20subcommand(s)%0A%0AOptions%3A%0A%20%20-v%2C%20–verbose…%20%20More%20output%20per%20occurrence%0A%20%20-q%2C%20–quiet…%20%20%20%20Less%20output%20per%20occurrence%0A%20%20-h%2C%20–help%20%20%20%20%20%20%20%20Print%20help”/]

evtxscan

Finds time skews in an evtx file

[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”Find%20time%20skews%20in%20an%20evtx%20file%0A%0AUsage%3A%20evtxscan%20%5BOPTIONS%5D%20%3CEVTX_FILE%3E%0A%0AArguments%3A%0A%20%20%3CEVTX_FILE%3E%20%20name%20of%20the%20evtx%20file%20to%20scan%0A%0AOptions%3A%0A%20%20-S%2C%20–show-records%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20display%20also%20the%20contents%20of%20the%20records%20befor%20and%20after%20a%20time%20skew%0A%20%20-N%2C%20–negative-tolerance%20%3CNEGATIVE_TOLERANCE%3E%20%20negative%20tolerance%20limit%20(in%20seconds)%3A%20time%20skews%20to%20the%20past%20below%20this%20limit%20will%20be%20ignored%20%5Bdefault%3A%205%5D%0A%20%20-h%2C%20–help%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Print%20help%0A%20%20-V%2C%20–version%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Print%20version”/]

 

evtxcat

Display one or more events from an evtx file

[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”%0AUsage%3A%20evtxcat%20%5BOPTIONS%5D%20%3CEVTX_FILE%3E%0A%0AArguments%3A%0A%20%20%3CEVTX_FILE%3E%20%20Name%20of%20the%20evtx%20file%20to%20read%20from%0A%0AOptions%3A%0A%20%20%20%20%20%20–min%20%3CMIN%3E%20%20%20%20%20%20%20%20filter%3A%20minimal%20event%20record%20identifier%0A%20%20%20%20%20%20–max%20%3CMAX%3E%20%20%20%20%20%20%20%20filter%3A%20maximal%20event%20record%20identifier%0A%20%20-i%2C%20–id%20%3CID%3E%20%20%20%20%20%20%20%20%20%20show%20only%20the%20one%20event%20with%20this%20record%20identifier%0A%20%20-T%2C%20–display-table%20%20%20%20don’t%20display%20the%20records%20in%20a%20table%20format%0A%20%20-F%2C%20–format%20%3CFORMAT%3E%20%20%5Bdefault%3A%20xml%5D%20%5Bpossible%20values%3A%20json%2C%20xml%5D%0A%20%20-h%2C%20–help%20%20%20%20%20%20%20%20%20%20%20%20%20Print%20help%0A%20%20-V%2C%20–version%20%20%20%20%20%20%20%20%20%20Print%20version%0A”/]

 

evtxls

Display one or more events from an evtx file

[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”Usage%3A%20evtxls%20%5BOPTIONS%5D%20%5BEVTX_FILES%5D…%0A%0AArguments%3A%0A%20%20%5BEVTX_FILES%5D…%0A%20%20%20%20%20%20%20%20%20%20Name%20of%20the%20evtx%20files%20to%20read%20from%0A%0AOptions%3A%0A%20%20-d%2C%20–delimiter%20%3CDELIMITER%3E%0A%20%20%20%20%20%20%20%20%20%20use%20this%20delimiter%20instead%20of%20generating%20fixed%20space%20columns%0A%0A%20%20-i%2C%20–include%20%3CINCLUDED_EVENT_IDS%3E%0A%20%20%20%20%20%20%20%20%20%20List%20events%20with%20only%20the%20specified%20event%20ids%2C%20separated%20by%20’%2C’%0A%0A%20%20-x%2C%20–exclude%20%3CEXCLUDED_EVENT_IDS%3E%0A%20%20%20%20%20%20%20%20%20%20Exclude%20events%20with%20the%20specified%20event%20ids%2C%20separated%20by%20’%2C’%0A%0A%20%20-c%2C%20–colors%0A%20%20%20%20%20%20%20%20%20%20highlight%20interesting%20content%20using%20colors%0A%0A%20%20-f%2C%20–from%20%3CNOT_BEFORE%3E%0A%20%20%20%20%20%20%20%20%20%20hide%20events%20older%20than%20the%20specified%20date%20(hint%3A%20use%20RFC%203339%20syntax)%0A%0A%20%20-t%2C%20–to%20%3CNOT_AFTER%3E%0A%20%20%20%20%20%20%20%20%20%20hide%20events%20newer%20than%20the%20specified%20date%20(hint%3A%20use%20RFC%203339%20syntax)%0A%0A%20%20-r%2C%20–regex%20%3CHIGHLIGHT%3E%0A%20%20%20%20%20%20%20%20%20%20highlight%20event%20data%20based%20on%20this%20regular%20expression%0A%0A%20%20-s%2C%20–sort%20%3CSORT_ORDER%3E%0A%20%20%20%20%20%20%20%20%20%20sort%20order%0A%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%5Bdefault%3A%20storage%5D%0A%0A%20%20%20%20%20%20%20%20%20%20Possible%20values%3A%0A%20%20%20%20%20%20%20%20%20%20-%20storage%3A%20%20%20don’t%20change%20order%2C%20output%20records%20as%20they%20are%20stored%0A%20%20%20%20%20%20%20%20%20%20-%20record-id%3A%20sort%20by%20event%20record%20id%0A%20%20%20%20%20%20%20%20%20%20-%20time%3A%20%20%20%20%20%20sort%20by%20date%20and%20time%0A%0A%20%20-b%2C%20–base-fields%20%3CDISPLAY_SYSTEM_FIELDS%3E%0A%20%20%20%20%20%20%20%20%20%20display%20fields%20common%20to%20all%20events.%20multiple%20values%20must%20be%20separated%20by%20’%2C’%0A%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%5Bdefault%3A%20event-id%20event-record-id%5D%0A%0A%20%20%20%20%20%20%20%20%20%20Possible%20values%3A%0A%20%20%20%20%20%20%20%20%20%20-%20event-id%3A%20%20%20%20%20%20%20%20%20%20%20%20The%20identifier%20that%20the%20provider%20used%20to%20identify%20the%20event%0A%20%20%20%20%20%20%20%20%20%20-%20event-record-id%3A%20%20%20%20%20The%20record%20number%20assigned%20to%20the%20event%20when%20it%20was%20logged%0A%20%20%20%20%20%20%20%20%20%20-%20activity-id%3A%20%20%20%20%20%20%20%20%20A%20globally%20unique%20identifier%20that%20identifies%20the%20current%20activity.%20The%20events%20that%20are%20published%20with%20this%20identifier%20are%20part%20of%20the%20same%20activity%0A%20%20%20%20%20%20%20%20%20%20-%20related-activity-id%3A%20A%20globally%20unique%20identifier%20that%20identifies%20the%20activity%20to%20which%20control%20was%20transferred%20to.%20The%20related%20events%20would%20then%20have%20this%20identifier%20as%20their%20ActivityID%20identifier%0A%20%20%20%20%20%20%20%20%20%20-%20process-id%3A%20%20%20%20%20%20%20%20%20%20The%20ID%20of%20the%20process%20that%20created%20the%20event%0A%0A%20%20-B%2C%20–hide-base-fields%0A%20%20%20%20%20%20%20%20%20%20don’t%20display%20any%20common%20event%20fields%20at%20all.%20This%20corresponds%20to%20specifying%20′–base-fields’%20without%20any%20values%20(which%20is%20not%20allowed%2C%20that’s%20why%20there%20is%20this%20flag)%0A%0A%20%20-h%2C%20–help%0A%20%20%20%20%20%20%20%20%20%20Print%20help%20(see%20a%20summary%20with%20′-h’)%0A%0A%20%20-V%2C%20–version%0A%20%20%20%20%20%20%20%20%20%20Print%20version”/]

es4forensics

[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”Usage%3A%20es4forensics%20%5BOPTIONS%5D%20–index%20%3CINDEX_NAME%3E%20–password%20%3CPASSWORD%3E%20%3CCOMMAND%3E%0A%0ACommands%3A%0A%20%20create-index%20%20%0A%20%20import%20%20%20%20%20%20%20%20%0A%20%20help%20%20%20%20%20%20%20%20%20%20Print%20this%20message%20or%20the%20help%20of%20the%20given%20subcommand(s)%0A%0AOptions%3A%0A%20%20-v%2C%20–verbose…%20%20%20%20%20%20%20%20%20%20%20More%20output%20per%20occurrence%0A%20%20-q%2C%20–quiet…%20%20%20%20%20%20%20%20%20%20%20%20%20Less%20output%20per%20occurrence%0A%20%20%20%20%20%20–strict%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20strict%20mode%3A%20do%20not%20only%20warn%2C%20but%20abort%20if%20an%20error%20occurs%0A%20%20-I%2C%20–index%20%3CINDEX_NAME%3E%20%20%20name%20of%20the%20elasticsearch%20index%0A%20%20-H%2C%20–host%20%3CHOST%3E%20%20%20%20%20%20%20%20%20%20server%20name%20or%20IP%20address%20of%20elasticsearch%20server%20%5Bdefault%3A%20localhost%5D%0A%20%20-P%2C%20–port%20%3CPORT%3E%20%20%20%20%20%20%20%20%20%20API%20port%20number%20of%20elasticsearch%20server%20%5Bdefault%3A%209200%5D%0A%20%20%20%20%20%20–proto%20%3CPROTOCOL%3E%20%20%20%20%20protocol%20to%20be%20used%20to%20connect%20to%20elasticsearch%20%5Bdefault%3A%20https%5D%20%5Bpossible%20values%3A%20http%2C%20https%5D%0A%20%20-k%2C%20–insecure%20%20%20%20%20%20%20%20%20%20%20%20%20omit%20certificate%20validation%0A%20%20-U%2C%20–username%20%3CUSERNAME%3E%20%20username%20for%20elasticsearch%20server%20%5Bdefault%3A%20elastic%5D%0A%20%20-W%2C%20–password%20%3CPASSWORD%3E%20%20password%20for%20authenticating%20at%20elasticsearch%0A%20%20-h%2C%20–help%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Print%20help%0A%20%20-V%2C%20–version%20%20%20%20%20%20%20%20%20%20%20%20%20%20Print%20version”/]

hivescan

scans a registry hive file for deleted entries

[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”Usage%3A%20hivescan%20%5BOPTIONS%5D%20%3CHIVE_FILE%3E%0A%0AArguments%3A%0A%20%20%3CHIVE_FILE%3E%20%20name%20of%20the%20file%20to%20scan%0A%0AOptions%3A%0A%20%20-L%2C%20–log%20%3CLOGFILES%3E%20%20transaction%20LOG%20file(s).%20This%20argument%20can%20be%20specified%20one%20or%20two%20times%0A%20%20-v%2C%20–verbose…%20%20%20%20%20%20More%20output%20per%20occurrence%0A%20%20-q%2C%20–quiet…%20%20%20%20%20%20%20%20Less%20output%20per%20occurrence%0A%20%20-b%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20output%20as%20bodyfile%20format%0A%20%20-h%2C%20–help%20%20%20%20%20%20%20%20%20%20%20%20Print%20help%0A%20%20-V%2C%20–version%20%20%20%20%20%20%20%20%20Print%20version%0A”/]

mactime2

Replacement for mactime

Changes to original mactime

  • no implicit conversion of timestamp to local date/time
  • possibility of explicit timezone correction
  • other datetime format (RFC3339) which always includes the timezone offset
  • faster

mft2bodyfile

yet to be come

pol_export

Exporter for Windows Registry Policy Files

[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”USAGE%3A%0A%20%20%20%20pol_export%20%3CPOLFILE%3E%0A%0AARGS%3A%0A%20%20%20%20%3CPOLFILE%3E%20%20%20%20Name%20of%20the%20file%20to%20read%0A%0AOPTIONS%3A%0A%20%20%20%20-h%2C%20–help%20%20%20%20%20%20%20Print%20help%20information%0A%20%20%20%20-V%2C%20–version%20%20%20%20Print%20version%20information”/]

More information

regdump

[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”Usage%3A%20regdump%20%5BOPTIONS%5D%20%3CHIVE_FILE%3E%0A%0AArguments%3A%0A%20%20%3CHIVE_FILE%3E%20%20name%20of%20the%20file%20to%20dump%0A%0AOptions%3A%0A%20%20-L%2C%20–log%20%3CLOGFILES%3E%20%20%20%20%20transaction%20LOG%20file(s).%20This%20argument%20can%20be%20specified%20one%20or%20two%20times%0A%20%20-b%2C%20–bodyfile%20%20%20%20%20%20%20%20%20%20%20print%20as%20bodyfile%20format%0A%20%20-I%2C%20–ignore-base-block%20%20ignore%20the%20base%20block%20(e.g.%20if%20it%20was%20encrypted%20by%20some%20ransomware)%0A%20%20-T%2C%20–hide-timestamps%20%20%20%20hide%20timestamps%2C%20if%20output%20is%20in%20reg%20format%0A%20%20-v%2C%20–verbose…%20%20%20%20%20%20%20%20%20More%20output%20per%20occurrence%0A%20%20-q%2C%20–quiet…%20%20%20%20%20%20%20%20%20%20%20Less%20output%20per%20occurrence%0A%20%20-h%2C%20–help%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Print%20help%0A%20%20-V%2C%20–version%20%20%20%20%20%20%20%20%20%20%20%20Print%20version”/]

Copyright (C) 2023 DFIR-DD

Source: https://github.com/dfir-dd/

Support Our Threat Intelligence

If you find our technology report and cybersecurity news helpful, consider supporting our work.

Crypto QR Code
USDT (TRC20):
TN8BdV8cp4T1Cd28gK9qTAnZknzzuwyUtm
USDT (ERC20):
0x3725e1a7d3bc5765499fa6aaafe307fabcd75bce