forked from evild3ad/MemProcFS-Analyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MemProcFS-Analyzer.ps1
12267 lines (10742 loc) · 728 KB
/
MemProcFS-Analyzer.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# MemProcFS-Analyzer v1.0
#
# @author: Martin Willing
# @copyright: Copyright (c) 2021-2023 Martin Willing. All rights reserved.
# @contact: Any feedback or suggestions are always welcome and much appreciated - [email protected]
# @url: https://lethal-forensics.com/
# @date: 2023-11-22
#
#
# ██╗ ███████╗████████╗██╗ ██╗ █████╗ ██╗ ███████╗ ██████╗ ██████╗ ███████╗███╗ ██╗███████╗██╗ ██████╗███████╗
# ██║ ██╔════╝╚══██╔══╝██║ ██║██╔══██╗██║ ██╔════╝██╔═══██╗██╔══██╗██╔════╝████╗ ██║██╔════╝██║██╔════╝██╔════╝
# ██║ █████╗ ██║ ███████║███████║██║█████╗█████╗ ██║ ██║██████╔╝█████╗ ██╔██╗ ██║███████╗██║██║ ███████╗
# ██║ ██╔══╝ ██║ ██╔══██║██╔══██║██║╚════╝██╔══╝ ██║ ██║██╔══██╗██╔══╝ ██║╚██╗██║╚════██║██║██║ ╚════██║
# ███████╗███████╗ ██║ ██║ ██║██║ ██║███████╗ ██║ ╚██████╔╝██║ ██║███████╗██║ ╚████║███████║██║╚██████╗███████║
# ╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═════╝╚══════╝
#
#
# Dependencies:
# 7-Zip 23.01 Standalone Console (2023-06-20)
# https://www.7-zip.org/download.html
#
# AmcacheParser v1.5.1.0 (.NET 6)
# https://ericzimmerman.github.io/
#
# AppCompatCacheParser v1.5.0.0 (.NET 6)
# https://ericzimmerman.github.io/
#
# ClamAV - Download --> Windows --> clamav-1.2.0.win.x64.msi (2023-08-28)
# https://www.clamav.net/downloads
# https://docs.clamav.net/manual/Usage/Configuration.html#windows --> First Time Set-Up
# https://blog.clamav.net/
#
# Dokany Library Bundle v2.0.6.1000 (2022-10-02)
# https://github.com/dokan-dev/dokany/releases/latest --> DokanSetup.exe
#
# Elasticsearch 8.9.2 (2023-09-06)
# https://www.elastic.co/downloads/elasticsearch
#
# entropy v1.1 (2023-07-28)
# https://github.com/merces/entropy
#
# EvtxECmd v1.5.0.0 (.NET 6)
# https://ericzimmerman.github.io/
#
# ImportExcel v7.8.6 (2023-10-12)
# https://github.com/dfinke/ImportExcel
#
# IPinfo CLI 3.1.1 (2023-10-02)
# https://github.com/ipinfo/cli
#
# jq v1.7 (2023-09-06)
# https://github.com/stedolan/jq
#
# Kibana 8.9.2 (2023-09-06)
# https://www.elastic.co/downloads/kibana
#
# lnk_parser v0.2.0 (2022-08-10)
# https://github.com/AbdulRhmanAlfaifi/lnk_parser
#
# MemProcFS v5.8.17 - The Memory Process File System (2023-08-20)
# https://github.com/ufrisk/MemProcFS
#
# RECmd v2.0.0.0 (.NET 6)
# https://ericzimmerman.github.io/
#
# SBECmd v2.0.0.0 (.NET 6)
# https://ericzimmerman.github.io/
#
# xsv v0.13.0 (2018-05-12)
# https://github.com/BurntSushi/xsv
#
# YARA v4.3.2 (2023-06-12)
# https://virustotal.github.io/yara/
#
# Zircolite v2.9.10 (2023-07-15)
# https://github.com/wagga40/Zircolite
#
#
# Changelog:
# Version 0.1
# Release Date: 2021-05-15
# Initial Release
#
# Version 0.2
# Release Date: 2021-05-26
# Added: IPinfo CLI
# Added: Collecting Registry Hives
# Added: AmcacheParser
# Added: AppCompatCacheParser (ShimCache)
# Added: PowerShell module 'ImportExcel'
# Added: Collection of PE_INJECT (PW: infected)
# Added: Hunting for suspicious Services
# Added: Hunting for suspicious Scheduled Tasks
# Fixed: Other minor fixes and improvements
#
# Version 0.3
# Release Date: 2021-06-17
# Added: OS Fingerprinting
# Added: Registry Explorer/RECmd
# Added: UserAssist
# Added: Syscache
# Added: ShellBags Explorer/SBECmd
# Added: Registry ASEPs (Auto-Start Extensibility Points)
# Fixed: Other minor fixes and improvements
#
# Version 0.4
# Release Date: 2022-07-27
# Added: Web Browser History
# Added: Forensic Timeline (CSV, XLSX)
# Added: JSON to CSV and XLSX output (including Handles)
# Added: Collecting output of pypykatz and regsecrets (MemProcFS Plugins)
# Added: RecentDocs
# Added: Office Trusted Documents
# Added: Adobe RecentDocs
# Added: Startup Folders
# Fixed: Other minor fixes and improvements
#
# Version 0.5
# Release Date: 2022-09-06
# Added: BitLocker Plugin
# Added: Kroll RECmd Batch File v1.20 (2022-06-01)
# Added: FS_Forensic_CSV + XLSX
# Added: FS_SysInfo_Users
# Added: Windows Shortcut Files (LNK)
# Added: Process Modules (Metadata)
# Added: Number of Sub-Processes (proc.csv, Processes.xlsx, and RunningandExited.xlsx)
# Added: Colorized Running and Exited Processes (RunningandExited.xlsx)
# Fixed: Other minor fixes and improvements
#
# Version 0.6
# Release Date: 2022-10-10
# Added: Process Tree (TreeView)
# Added: Unusual Number of Process Instances
# Added: Process Path Masquerading
# Added: Process Name Masquerading (Damerau Levenshtein Distance)
# Added: Suspicious Port Numbers
# Fixed: Other minor fixes and improvements
#
# Version 0.7
# Release Date: 2022-11-21
# Added: User Interface
# Added: Pagefile Support
# Added: Zircolite - A standalone SIGMA-based detection tool for EVTX
# Added: Event Log Overview
# Added: Checking for Processes w/ Unusual User Context
# Added: Process Tree: Properties View
# Added: Searching for Cobalt Strike Beacons Configuration(s) w/ 1768.py (needs to be installed manually, disabled by default)
# Added: Simple Prefetch View (based on Forensic Timeline)
# Fixed: Other minor fixes and improvements
#
# Version 0.8
# Release Date: 2023-01-23
# Added: MUICache
# Added: Windows Background Activity Moderator (BAM)
# Added: Check if it's a Domain Controller
# Added: Check if it's a Microsoft Exchange Server
# Added: jq - Command-line JSON processor
# Added: Checking for processes spawned from suspicious folder locations
# Added: Checking for suspicious processes without any command-line arguments
# Added: Checking for suspicious process lineage
# Added: Checking for processes with suspicious command-line arguments
# Added: Parent Name (proc.csv, Processes.xlsx, and RunningandExited.xlsx)
# Added: Listing of MiniDumps
# Added: Status Bar (User Interface)
# Fixed: Other minor fixes and improvements
#
# Version 0.9
# Release Date: 2023-05-25
# Added: FS_Forensic_Yara (YARA Custom Rules)
# Added: FS_Forensic_Files (incl. ClamAV)
# Added: Checking for suspicious processes with double file extensions
# Added: Checking for Command and Scripting Interpreters
# Added: Recent Folder Artifacts
# Added: Hunting Suspicious Image Mounts
# Added: OpenSaveMRU (OpenSavePidlMRU)
# Added: LastVisitedMRU (LastVisitedPidlMRU)
# Added: Terminal Server Client (RDP)
# Added: Kroll RECmd Batch File v1.21 (2023-03-04)
# Added: Improved Microsoft Defender AntiVirus Handling
# Added: Improved Drive Letter (Mount Point) Handling
# Fixed: Other minor fixes and improvements
#
# Version 1.0
# Release Date: 2023-11-22
# Added: Improved Hunting for Suspicious Scheduled Tasks
# Added: 318 YARA Custom Rules
# Added: Get-YaraCustomRules
# Added: Kroll RECmd Batch File v1.22 (2023-06-20)
# Added: Checkbox Forensic Timeline (CSV)
# Added: Checkbox Forensic Timeline (XLSX)
# Added: FindEvil: AV_DETECT
# Fixed: Other minor fixes and improvements
#
#
# Tested on Windows 10 Pro (x64) Version 22H2 (10.0.19045.3693) and PowerShell 5.1 (5.1.19041.3693)
#
#
#############################################################################################################################################################################################
#############################################################################################################################################################################################
<#
.SYNOPSIS
MemProcFS-Analyzer v1.0 - Automated Forensic Analysis of Windows Memory Dumps for DFIR
.DESCRIPTION
MemProcFS-Analyzer.ps1 is a PowerShell script utilized to simplify the usage of MemProcFS and to assist with the memory analysis workflow.
.EXAMPLE
PS> .\MemProcFS-Analyzer.ps1
.NOTES
Author - Martin Willing
.LINK
https://github.com/evild3ad/MemProcFS-Analyzer
#>
#############################################################################################################################################################################################
#############################################################################################################################################################################################
#region Declarations
# Declarations
# Script Root
if ($PSVersionTable.PSVersion.Major -gt 2)
{
# PowerShell 3+
$script:SCRIPT_DIR = $PSScriptRoot
}
else
{
# PowerShell 2
$script:SCRIPT_DIR = Split-Path -Parent $MyInvocation.MyCommand.Definition
}
# Analysis date (ISO 8601)
$script:Date = [datetime]::Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss") # YYYY-MM-DDThh:mm:ss
$script:Timestamp = $Date -replace ":", "" # YYYY-MM-DDThhmmss
# Tools
# 7-Zip
$script:7za = "$SCRIPT_DIR\Tools\7-Zip\7za.exe"
# AmcacheParser
$script:AmcacheParser = "$SCRIPT_DIR\Tools\AmcacheParser\AmcacheParser.exe"
# AppCompatCacheParser
$script:AppCompatCacheParser = "$SCRIPT_DIR\Tools\AppCompatCacheParser\AppCompatCacheParser.exe"
# ClamAV
$script:freshclam = "C:\Program Files\ClamAV\freshclam.exe"
$script:clamscan = "C:\Program Files\ClamAV\clamscan.exe"
$script:clamd = "C:\Program Files\ClamAV\clamd.exe"
$script:clamdscan = "C:\Program Files\ClamAV\clamdscan.exe"
# Elasticsearch
$script:Elasticsearch = "$SCRIPT_DIR\Tools\Elasticsearch\bin\elasticsearch.bat"
# entropy
$script:entropy = "$SCRIPT_DIR\Tools\entropy\entropy.exe"
# EvtxECmd
$script:EvtxECmd = "$SCRIPT_DIR\Tools\EvtxECmd\EvtxECmd.exe"
# IPinfo CLI & Access Token
# https://ipinfo.io/signup?ref=cli
$script:IPinfo = "$SCRIPT_DIR\Tools\IPinfo\ipinfo.exe"
$IPInfoToken = "f62a65aed34710" # Please insert your Access Token here
# jq
$script:jq = "$SCRIPT_DIR\Tools\jq\jq-win64.exe"
# Kibana
$script:Kibana = "$SCRIPT_DIR\Tools\Kibana\bin\kibana.bat"
# lnk_parser
$script:lnk_parser = "$SCRIPT_DIR\Tools\lnk_parser\lnk_parser_x86_64.exe"
# MemProcFS
$script:MemProcFS = "$SCRIPT_DIR\Tools\MemProcFS\MemProcFS.exe"
# RECmd
$script:RECmd = "$SCRIPT_DIR\Tools\RECmd\RECmd.exe"
# SBECmd
$script:SBECmd = "$SCRIPT_DIR\Tools\SBECmd\SBECmd.exe"
# xsv
$script:xsv = "$SCRIPT_DIR\Tools\xsv\xsv.exe"
# YARA
$script:yara64 = "$SCRIPT_DIR\Tools\YARA\yara64.exe"
# Zircolite
$script:zircolite = "$SCRIPT_DIR\Tools\Zircolite\zircolite_win10.exe"
# Archive Password
$script:PASSWORD = "MemProcFS"
# Process Whitelist (Forensic Mode)
# https://github.com/ufrisk/MemProcFS/wiki/_CommandLine#-forensic-process-skip
$script:ForensicProcessWhitelist = "cyserver.exe,MsMpEng.exe,tlaworker.exe"
# MsMpEng.exe = Microsoft Defender
# cyserver.exe = Palo Alto Cortex XDR
# tlaworker.exe = Palo Alto Cortex XDR
#endregion Declarations
#############################################################################################################################################################################################
#############################################################################################################################################################################################
#region Initialisations
# Set Progress Preference to Silently Continue
$OriginalProgressPreference = $Global:ProgressPreference
$Global:ProgressPreference = 'SilentlyContinue'
#endregion Initialisations
#############################################################################################################################################################################################
#############################################################################################################################################################################################
#region Header
Function Header {
# Windows Title
$script:DefaultWindowsTitle = $Host.UI.RawUI.WindowTitle
$Host.UI.RawUI.WindowTitle = "MemProcFS-Analyzer v1.0 - Automated Forensic Analysis of Windows Memory Dumps for DFIR"
# Check if the PowerShell script is being run with admin rights
if (!([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{
Write-Host "[Error] This PowerShell script must be run with admin rights." -ForegroundColor Red
$Host.UI.RawUI.WindowTitle = "$DefaultWindowsTitle"
Exit
}
# Requirements
# Dokany File System Library
$Dokany = "$env:SystemDrive\Windows\System32\dokan2.dll"
if (!(Test-Path "$($Dokany)"))
{
Write-Host "[Error] Dokany File System Library NOT found." -ForegroundColor Red
Write-Host " Please download/install the latest release of Dokany File System Library manually:" -ForegroundColor Red
Write-Host " https://github.com/dokan-dev/dokany/releases/latest (DokanSetup.exe)" -ForegroundColor Red
$Host.UI.RawUI.WindowTitle = "$DefaultWindowsTitle"
Exit
}
# EZTools
if (Get-Command -CommandType Application dotnet -ErrorAction SilentlyContinue)
{
# TargetFramework (.NET 6)
if (!(dotnet --list-runtimes | Select-String -Pattern "^Microsoft\.WindowsDesktop\.App" -Quiet))
{
Write-Host "[Error] Please download/install at least .NET 6.0 or newer manually:" -ForegroundColor Red
Write-Host " https://dotnet.microsoft.com/en-us/download/dotnet/6.0 (Recommended: .NET Desktop Runtime)" -ForegroundColor Red
$Host.UI.RawUI.WindowTitle = "$DefaultWindowsTitle"
Exit
}
}
else
{
Write-Host "[Error] Please download/install at least .NET 6.0 or newer manually:" -ForegroundColor Red
Write-Host " https://dotnet.microsoft.com/en-us/download/dotnet/6.0 (Recommended: .NET Desktop Runtime)" -ForegroundColor Red
$Host.UI.RawUI.WindowTitle = "$DefaultWindowsTitle"
Exit
}
# Function Get-FileSize
Function script:Get-FileSize {
Param ([long]$Size)
If ($Size -gt 1TB) {[string]::Format("{0:0.00} TB", $Size / 1TB)}
ElseIf ($Size -gt 1GB) {[string]::Format("{0:0.00} GB", $Size / 1GB)}
ElseIf ($Size -gt 1MB) {[string]::Format("{0:0.00} MB", $Size / 1MB)}
ElseIf ($Size -gt 1KB) {[string]::Format("{0:0.00} KB", $Size / 1KB)}
ElseIf ($Size -gt 0) {[string]::Format("{0:0.00} Bytes", $Size)}
Else {""}
}
# Add the required MessageBox class (Windows PowerShell)
Add-Type -AssemblyName System.Windows.Forms
#############################################################################################################################################################################################
# User Interface
Function Show-UserInterface
{
# Import Assemblies
[void][reflection.assembly]::Load('System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
[void][reflection.assembly]::Load('System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
[void][reflection.assembly]::Load('System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
# Form Objects
[System.Windows.Forms.Application]::EnableVisualStyles()
$FormMemProcFSAnalyzer = New-Object 'System.Windows.Forms.Form'
$Checkbox1 = New-Object 'System.Windows.Forms.CheckBox'
$Checkbox2 = New-Object 'System.Windows.Forms.CheckBox'
$Checkbox3 = New-Object 'System.Windows.Forms.CheckBox'
$Checkbox4 = New-Object 'System.Windows.Forms.CheckBox'
$StatusBar = New-Object 'System.Windows.Forms.StatusBar'
$StatusBarPanel1 = New-Object 'System.Windows.Forms.StatusBarPanel'
$LabelMemoryDump = New-Object 'System.Windows.Forms.Label'
$LabelPageFile = New-Object 'System.Windows.Forms.Label'
$ButtonBrowse1 = New-Object 'System.Windows.Forms.Button'
$ButtonBrowse2 = New-Object 'System.Windows.Forms.Button'
$TextBoxFile1 = New-Object 'System.Windows.Forms.TextBox'
$TextBoxFile2 = New-Object 'System.Windows.Forms.TextBox'
$OpenFileDialog1 = New-Object 'System.Windows.Forms.OpenFileDialog'
$OpenFileDialog2 = New-Object 'System.Windows.Forms.OpenFileDialog'
$ButtonStart = New-Object 'System.Windows.Forms.Button'
$ButtonExit = New-Object 'System.Windows.Forms.Button'
$LinkLabel = New-Object 'System.Windows.Forms.LinkLabel'
$ToolTip1 = New-Object 'System.Windows.Forms.ToolTip'
$MenuStrip1 = New-Object 'System.Windows.Forms.MenuStrip'
$FileToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$CheckForUpdatesToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$ExitToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$HelpToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$WikiToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$MemProcFSToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$MemProcFSWikiToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$AboutToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$GitHubToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
# Events
$ButtonBrowseMemory_Click={
if($OpenFileDialog1.ShowDialog() -eq 'OK')
{
$TextBoxFile1.Text = $OpenFileDialog1.FileName
$ButtonStart.Enabled =$true
$StatusBar.Text = "Ready"
}
}
$ButtonBrowsePagefile_Click={
if($OpenFileDialog2.ShowDialog() -eq 'OK')
{
$TextBoxFile2.Text = $OpenFileDialog2.FileName
}
}
$LinkLabel_LinkClicked=[System.Windows.Forms.LinkLabelLinkClickedEventHandler]{
Start-Process "https://github.com/evild3ad/MemProcFS-Analyzer"
}
$ButtonExit_Click={
$FormMemProcFSAnalyzer.Close()
}
$ExitToolStripMenuItem_Click={
$FormMemProcFSAnalyzer.Close()
}
$CheckForUpdatesToolStripMenuItem_Click={
$CurrentVersion = "1.0"
$StatusBar.Text = "Checking latest release on GitHub ..."
# Check for latest release on GitHub
$Repository = "evild3ad/MemProcFS-Analyzer"
$Releases = "https://api.github.com/repos/$Repository/releases"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
if (Test-Connection -ComputerName 8.8.8.8 -Count 1 -Quiet -ErrorAction SilentlyContinue)
{
$Response = (Invoke-WebRequest -Uri $Releases -UseBasicParsing -TimeoutSec 30 | ConvertFrom-Json)[0]
$Tag = $Response.tag_name
$LatestRelease = $Tag.Substring(1)
# Outdated
if ($CurrentVersion -lt $LatestRelease)
{
$MessageBody = "Latest Release: MemProcFS-Analyzer v$LatestRelease`n`nNote: You will be automatically redirected."
$MessageTitle = "MemProcFS-Analyzer v$CurrentVersion - Update available"
$ButtonType = "OKCancel"
$MessageIcon = "Warning"
$StatusBar.Text = "Latest Version: MemProcFS-Analyzer v$LatestRelease"
$Result = [System.Windows.Forms.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon)
if ($Result -eq "OK")
{
Start-Process "https://github.com/evild3ad/MemProcFS-Analyzer/releases/latest"
}
}
# Up-To-Date
if ($CurrentVersion -eq $LatestRelease)
{
$MessageBody = "MemProcFS-Analyzer v$CurrentVersion`nCopyright (c) 2021-2023 Martin Willing`n`nYou are using the latest version of MemProcFS-Analyzer."
$MessageTitle = "MemProcFS-Analyzer"
$ButtonType = "OK"
$MessageIcon = "Info"
$StatusBar.Text = "Latest Version: MemProcFS-Analyzer v$LatestRelease"
[System.Windows.Forms.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon)
}
# Beta-Tester
if ($CurrentVersion -gt $LatestRelease)
{
$MessageBody = "MemProcFS-Analyzer v$CurrentVersion`nCopyright (c) 2021-2023 Martin Willing`n`nHello Beta-Tester. Happy Testing! ;-)"
$MessageTitle = "MemProcFS-Analyzer"
$ButtonType = "OK"
$MessageIcon = "Info"
$StatusBar.Text = "Latest Version: MemProcFS-Analyzer v$LatestRelease"
[System.Windows.Forms.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon)
if(Test-Path $TextBoxFile1.Text)
{
$StatusBar.Text = "Ready"
}
else
{
$StatusBar.Text = ""
}
}
}
else
{
$StatusBar.Text = "Session Timeout"
}
}
$GitHubToolStripMenuItem_Click = {
Start-Process "https://github.com/evild3ad/MemProcFS-Analyzer"
}
$WikiToolStripMenuItem_Click={
Start-Process "https://github.com/evild3ad/MemProcFS-Analyzer/wiki"
}
$MemProcFSToolStripMenuItem_Click = {
Start-Process "https://github.com/ufrisk/MemProcFS"
}
$MemProcFSWikiToolStripMenuItem_Click = {
Start-Process "https://github.com/ufrisk/MemProcFS/wiki"
}
$AboutToolStripMenuItem_Click = {
$MessageBody = "MemProcFS-Analyzer v1.0`nCopyright (c) 2021-2023 Martin Willing"
$MessageTitle = "MemProcFS-Analyzer"
$ButtonType = "OK"
$MessageIcon = "Info"
[System.Windows.Forms.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon)
}
$Checkbox1_CheckedChanged =
{
if($Checkbox1.Checked -eq $true)
{
# Custom YARA Rules - Enabled
$script:YaraRules = "$SCRIPT_DIR\yara\index.yar"
}
if($Checkbox1.Checked -eq $false)
{
# Custom YARA Rules - Disabled
$script:YaraRules = $null
}
}
$Checkbox2_CheckedChanged =
{
if($Checkbox2.Checked -eq $true)
{
# ClamAV Scan - Enabled
$script:ClamAV = "Enabled"
}
if($Checkbox2.Checked -eq $false)
{
# ClamAV Scan - Disabled
$script:ClamAV = $null
}
}
$Checkbox3_CheckedChanged =
{
if($Checkbox3.Checked -eq $true)
{
# Forensic Timeline (CSV) - Enabled
$script:ForensicTimelineCSV = "Enabled"
}
if($Checkbox3.Checked -eq $false)
{
# Forensic Timeline (CSV) - Disabled
$script:ForensicTimelineCSV = $null
}
}
$Checkbox4_CheckedChanged =
{
if($Checkbox4.Checked -eq $true)
{
# Forensic Timeline (XLSX) - Enabled
$script:ForensicTimelineXLSX = "Enabled"
}
if($Checkbox4.Checked -eq $false)
{
# Forensic Timeline (XLSX) - Disabled
$script:ForensicTimelineXLSX = $null
}
}
$Form_StateCorrection_Load =
{
$FormMemProcFSAnalyzer.WindowState = $InitialFormWindowState
}
$Form_StoreValues_Closing =
{
$script:MemoryDump = $TextBoxFile1.Text
$script:Pagefile = $TextBoxFile2.Text
}
$Form_Cleanup_FormClosed =
{
try
{
$Checkbox1.remove_CheckedChanged($Checkbox1_CheckedChanged)
$Checkbox2.remove_CheckedChanged($Checkbox2_CheckedChanged)
$Checkbox3.remove_CheckedChanged($Checkbox3_CheckedChanged)
$Checkbox4.remove_CheckedChanged($Checkbox4_CheckedChanged)
$ButtonBrowse1.remove_Click($ButtonBrowseMemory_Click)
$ButtonBrowse2.remove_Click($ButtonBrowsePagefile_Click)
$ButtonStart.remove_MouseClick($ButtonStart_Click)
$ButtonExit.remove_MouseClick($ButtonExit_Click)
$LinkLabel.remove_LinkClicked($LinkLabel_LinkClicked)
$FormMemProcFSAnalyzer.remove_Load($FormMemProcFSAnalyzer_Load)
$CheckForUpdatesToolStripMenuItem.remove_Click($checkForUpdatesToolStripMenuItem_Click)
$ExitToolStripMenuItem.remove_Click($exitToolStripMenuItem_Click)
$WikiToolStripMenuItem.remove_Click($wikiToolStripMenuItem_Click)
$MemProcFSToolStripMenuItem.remove_Click($MemProcFSToolStripMenuItem_Click)
$MemProcFSWikiToolStripMenuItem.remove_Click($MemProcFSWikiToolStripMenuItem_Click)
$AboutToolStripMenuItem.remove_Click($AboutToolStripMenuItem_Click)
$GitHubToolStripMenuItem.remove_Click($GitHubToolStripMenuItem_Click)
$FormMemProcFSAnalyzer.remove_Load($Form_StateCorrection_Load)
$FormMemProcFSAnalyzer.remove_Closing($Form_StoreValues_Closing)
$FormMemProcFSAnalyzer.remove_FormClosed($Form_Cleanup_FormClosed)
}
catch { Out-Null }
}
# Form Code
$FormMemProcFSAnalyzer.SuspendLayout()
$MenuStrip1.SuspendLayout()
# FormMemProcFSAnalyzer
$FormMemProcFSAnalyzer.Controls.Add($Checkbox1)
$FormMemProcFSAnalyzer.Controls.Add($Checkbox2)
$FormMemProcFSAnalyzer.Controls.Add($Checkbox3)
$FormMemProcFSAnalyzer.Controls.Add($Checkbox4)
$FormMemProcFSAnalyzer.Controls.Add($StatusBar)
$FormMemProcFSAnalyzer.Controls.Add($LabelMemoryDump)
$FormMemProcFSAnalyzer.Controls.Add($LabelPageFile)
$FormMemProcFSAnalyzer.Controls.Add($ButtonBrowse1)
$FormMemProcFSAnalyzer.Controls.Add($ButtonBrowse2)
$FormMemProcFSAnalyzer.Controls.Add($TextBoxFile1)
$FormMemProcFSAnalyzer.Controls.Add($TextBoxFile2)
$FormMemProcFSAnalyzer.Controls.Add($ButtonStart)
$FormMemProcFSAnalyzer.Controls.Add($ButtonExit)
$FormMemProcFSAnalyzer.Controls.Add($LinkLabel)
$FormMemProcFSAnalyzer.Controls.Add($MenuStrip1)
$FormMemProcFSAnalyzer.AutoScaleDimensions = New-Object System.Drawing.SizeF(6, 13)
$FormMemProcFSAnalyzer.AutoScaleMode = 'Font'
$FormMemProcFSAnalyzer.ClientSize = New-Object System.Drawing.Size(626, 262)
$FormMemProcFSAnalyzer.FormBorderStyle = 'FixedDialog'
$FormMemProcFSAnalyzer.MainMenuStrip = $Menustrip1
$FormMemProcFSAnalyzer.MaximizeBox = $False
$FormMemProcFSAnalyzer.MinimizeBox = $False
$FormMemProcFSAnalyzer.Name = 'FormMemProcFSAnalyzer'
$FormMemProcFSAnalyzer.StartPosition = 'CenterScreen'
$FormMemProcFSAnalyzer.Text = 'MemProcFS-Analyzer v1.0 - Automated Forensic Analysis of Windows Memory Dumps for DFIR'
$FormMemProcFSAnalyzer.TopLevel = $True
$FormMemProcFSAnalyzer.TopMost = $True
$FormMemProcFSAnalyzer.Add_Shown({$FormMemProcFSAnalyzer.Activate()})
# Checkbox1
$Checkbox1.Location = New-Object System.Drawing.Point(96, 131)
$Checkbox1.Name = 'Checkbox1'
$Checkbox1.Size = New-Object System.Drawing.Size(172, 24)
$Checkbox1.TabIndex = 9
$Checkbox1.Text = 'Enable Custom YARA rules'
$Checkbox1.UseVisualStyleBackColor = $True
$Checkbox1.add_CheckedChanged($Checkbox1_CheckedChanged)
# Checkbox2
$Checkbox2.Location = New-Object System.Drawing.Point(96, 151)
$Checkbox2.Name = 'Checkbox2'
$Checkbox2.Size = New-Object System.Drawing.Size(155, 24)
$Checkbox2.TabIndex = 10
$Checkbox2.Text = 'Enable ClamAV Scan'
$Checkbox2.UseVisualStyleBackColor = $True
$Checkbox2.add_CheckedChanged($Checkbox2_CheckedChanged)
# Checkbox3
$Checkbox3.Location = New-Object System.Drawing.Point(270, 131)
$Checkbox3.Name = 'Checkbox3'
$Checkbox3.Size = New-Object System.Drawing.Size(200, 24)
$Checkbox3.TabIndex = 11
$Checkbox3.Text = 'Enable Forensic Timeline (CSV)'
$Checkbox3.UseVisualStyleBackColor = $True
$Checkbox3.add_CheckedChanged($Checkbox3_CheckedChanged)
# Checkbox4
$Checkbox4.Location = New-Object System.Drawing.Point(270, 151)
$Checkbox4.Name = 'Checkbox4'
$Checkbox4.Size = New-Object System.Drawing.Size(200, 24)
$Checkbox4.TabIndex = 12
$Checkbox4.Text = 'Enable Forensic Timeline (XLSX)'
$Checkbox4.UseVisualStyleBackColor = $True
$Checkbox4.add_CheckedChanged($Checkbox4_CheckedChanged)
# Status Bar
$StatusBar.Location = New-Object System.Drawing.Point(0, 240)
$StatusBar.Name = 'StatusBar'
[void]$StatusBar.Panels.Add($StatusBarPanel1)
$StatusBar.Size = New-Object System.Drawing.Size(626, 22)
$StatusBar.SizingGrip = $False
$StatusBar.TabIndex = 0
# LabelMemoryDump
$LabelMemoryDump.AutoSize = $True
$LabelMemoryDump.Location = New-Object System.Drawing.Point(12, 38)
$LabelMemoryDump.Name = 'LabelMemoryDump'
$LabelMemoryDump.Size = New-Object System.Drawing.Size(78, 13)
$LabelMemoryDump.TabIndex = 4
$LabelMemoryDump.Text = 'Memory Dump:'
# LabelPageFile
$LabelPageFile.AutoSize = $True
$LabelPageFile.Location = New-Object System.Drawing.Point(36, 87)
$LabelPageFile.Name = 'LabelPageFile'
$LabelPageFile.Size = New-Object System.Drawing.Size(54, 13)
$LabelPageFile.TabIndex = 3
$LabelPageFile.Text = 'Page File:'
# ButtonBrowse1
$ButtonBrowse1.Location = New-Object System.Drawing.Point(539, 33)
$ButtonBrowse1.Name = 'ButtonBrowse1'
$ButtonBrowse1.Size = New-Object System.Drawing.Size(75, 23)
$ButtonBrowse1.TabIndex = 0
$ButtonBrowse1.Text = 'Browse'
$ButtonBrowse1.UseVisualStyleBackColor = $True
$ButtonBrowse1.add_Click($ButtonBrowseMemory_Click)
$ToolTip1.SetToolTip($ButtonBrowse1, 'Select your Raw Physical Memory Dump')
# ButtonBrowse2
$ButtonBrowse2.Location = New-Object System.Drawing.Point(539, 84)
$ButtonBrowse2.Name = 'ButtonBrowse2'
$ButtonBrowse2.Size = New-Object System.Drawing.Size(75, 23)
$ButtonBrowse2.TabIndex = 1
$ButtonBrowse2.Text = 'Browse'
$ButtonBrowse2.UseVisualStyleBackColor = $True
$ButtonBrowse2.add_Click($ButtonBrowsePagefile_Click)
$ToolTip1.SetToolTip($ButtonBrowse2, 'Select your pagefile.sys (Optional)')
# TextBoxFile1
$TextBoxFile1.AccessibleRole = 'None'
$TextBoxFile1.AutoCompleteMode = 'SuggestAppend'
$TextBoxFile1.AutoCompleteSource = 'FileSystem'
$TextBoxFile1.BackColor = [System.Drawing.SystemColors]::Window
$TextBoxFile1.Cursor = 'Default'
$TextBoxFile1.ForeColor = [System.Drawing.SystemColors]::WindowText
$TextBoxFile1.Location = New-Object System.Drawing.Point(96, 35)
$TextBoxFile1.Name = 'TextBoxFile'
$TextBoxFile1.ReadOnly = $True
$TextBoxFile1.ShortcutsEnabled = $False
$TextBoxFile1.Size = New-Object System.Drawing.Size(437, 20)
$TextBoxFile1.TabIndex = 4
$TextBoxFile1.TabStop = $False
$TextBoxFile1.Text = 'Select your Raw Physical Memory Dump'
$ToolTip1.SetToolTip($TextBoxFile1, 'Select your Raw Physical Memory Dump')
# TextBoxFile2
$TextBoxFile2.AccessibleRole = 'None'
$TextBoxFile2.AutoCompleteMode = 'SuggestAppend'
$TextBoxFile2.AutoCompleteSource = 'FileSystem'
$TextBoxFile2.BackColor = [System.Drawing.SystemColors]::Window
$TextBoxFile2.Cursor = 'Default'
$TextBoxFile2.ForeColor = [System.Drawing.SystemColors]::WindowText
$TextBoxFile2.Location = New-Object System.Drawing.Point(96, 84)
$TextBoxFile2.Name = 'TextBoxFile2'
$TextBoxFile2.ReadOnly = $True
$TextBoxFile2.Size = New-Object System.Drawing.Size(437, 20)
$TextBoxFile2.TabIndex = 5
$TextBoxFile2.TabStop = $False
$TextBoxFile2.Text = 'Select your pagefile.sys (Optional)'
$ToolTip1.SetToolTip($TextBoxFile2, 'Select your pagefile.sys (Optional)')
# OpenFileDialog1
$OpenFileDialog1.Filter = 'Memory Dump Files (*.001;*.bin;*.dmp;*.img;*.mem;*.raw;*.vmem)|*.001;*.bin;*.dmp;*.img;*.mem;*.raw;*.vmem|All Files (*.*)|*.*'
$OpenFileDialog1.InitialDirectory = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" # MyComputer
$OpenFileDialog1.ReadOnlyChecked = $True
$OpenFileDialog1.Title = 'MemProcFS-Analyzer v1.0 - Select your Raw Physical Memory Dump'
# OpenFileDialog2
$OpenFileDialog2.Filter = 'Page Files (*.sys)|*.sys|All Files (*.*)|*.*'
$OpenFileDialog2.ReadOnlyChecked = $True
$OpenFileDialog2.Title = 'MemProcFS-Analyzer v1.0 - Select your pagefile.sys (Optional)'
# ButtonStart
$ButtonStart.DialogResult = 'OK'
$ButtonStart.Enabled = $False
$ButtonStart.Location = New-Object System.Drawing.Point(446, 202) # 227
$ButtonStart.Name = 'ButtonStart'
$ButtonStart.Size = New-Object System.Drawing.Size(75, 23)
$ButtonStart.TabIndex = 2
$ButtonStart.Text = 'Start'
$ButtonStart.UseCompatibleTextRendering = $True
$ButtonStart.UseVisualStyleBackColor = $True
$ButtonStart.Add_Click($ButtonStart_Click)
$ToolTip1.SetToolTip($ButtonStart, 'Start')
# ButtonExit
$ButtonExit.DialogResult = 'Cancel'
$ButtonExit.Location = New-Object System.Drawing.Point(539, 202) # 227
$ButtonExit.Name = 'ButtonExit'
$ButtonExit.Size = New-Object System.Drawing.Size(75, 23)
$ButtonExit.TabIndex = 3
$ButtonExit.Text = 'Exit'
$ButtonExit.UseCompatibleTextRendering = $True
$ButtonExit.UseVisualStyleBackColor = $True
$ButtonExit.Add_MouseClick($ButtonExit_Click)
$ToolTip1.SetToolTip($ButtonExit, 'Exit')
# LinkLabel
$LinkLabel.Location = New-Object System.Drawing.Point(12, 204) # 227
$LinkLabel.Name = 'LinkLabel'
$LinkLabel.Size = New-Object System.Drawing.Size(269, 23)
$LinkLabel.TabIndex = 7
$LinkLabel.TabStop = $True
$LinkLabel.Text = 'https://github.com/evild3ad/MemProcFS-Analyzer'
$LinkLabel.Add_LinkClicked($linklabel_LinkClicked)
# MenuStrip1
[void]$MenuStrip1.Items.Add($FileToolStripMenuItem)
[void]$MenuStrip1.Items.Add($HelpToolStripMenuItem)
$MenuStrip1.Location = New-Object System.Drawing.Point(0, 0)
$MenuStrip1.Name = 'MenuStrip1'
$MenuStrip1.Size = New-Object System.Drawing.Size(626, 24)
$MenuStrip1.TabIndex = 8
$MenuStrip1.Text = 'MenuStrip1'
# FileToolStripMenuItem
[void]$fileToolStripMenuItem.DropDownItems.Add($CheckForUpdatesToolStripMenuItem)
[void]$FileToolStripMenuItem.DropDownItems.Add($ExitToolStripMenuItem)
$FileToolStripMenuItem.Name = 'FileToolStripMenuItem'
$FileToolStripMenuItem.Size = New-Object System.Drawing.Size(37, 20)
$FileToolStripMenuItem.Text = 'File'
# HelpToolStripMenuItem
[void]$HelpToolStripMenuItem.DropDownItems.Add($GitHubToolStripMenuItem)
[void]$HelpToolStripMenuItem.DropDownItems.Add($WikiToolStripMenuItem)
[void]$HelpToolStripMenuItem.DropDownItems.Add($MemProcFSToolStripMenuItem)
[void]$HelpToolStripMenuItem.DropDownItems.Add($MemProcFSWikiToolStripMenuItem)
[void]$HelpToolStripMenuItem.DropDownItems.Add($AboutToolStripMenuItem)
$HelpToolStripMenuItem.Name = 'HelpToolStripMenuItem'
$HelpToolStripMenuItem.Size = New-Object System.Drawing.Size(44, 20)
$HelpToolStripMenuItem.Text = 'Help'
# CheckForUpdatesToolStripMenuItem
$CheckForUpdatesToolStripMenuItem.Name = 'CheckForUpdatesToolStripMenuItem'
$CheckForUpdatesToolStripMenuItem.Size = New-Object System.Drawing.Size(180, 22)
$CheckForUpdatesToolStripMenuItem.Text = 'Check for Updates...'
$CheckForUpdatesToolStripMenuItem.ToolTipText = 'Check for Updates...'
$CheckForUpdatesToolStripMenuItem.add_Click($CheckForUpdatesToolStripMenuItem_Click)
# ExitToolStripMenuItem
$ExitToolStripMenuItem.Name = 'ExitToolStripMenuItem'
$ExitToolStripMenuItem.Size = New-Object System.Drawing.Size(180, 22)
$ExitToolStripMenuItem.Text = 'Exit'
$ExitToolStripMenuItem.ToolTipText = 'Exit'
$ExitToolStripMenuItem.Add_Click($ExitToolStripMenuItem_Click)
# GitHubToolStripMenuItem
$GitHubToolStripMenuItem.Name = 'GitHubToolStripMenuItem'
$GitHubToolStripMenuItem.Size = New-Object System.Drawing.Size(152, 22)
$GitHubToolStripMenuItem.Text = 'GitHub'
$GitHubToolStripMenuItem.ToolTipText = 'GitHub'
$GitHubToolStripMenuItem.Add_Click($GitHubToolStripMenuItem_Click)
# WikiToolStripMenuItem
$WikiToolStripMenuItem.Name = 'WikiToolStripMenuItem'
$WikiToolStripMenuItem.Size = New-Object System.Drawing.Size(152, 22)
$WikiToolStripMenuItem.Text = 'GitHub Wiki'
$WikiToolStripMenuItem.ToolTipText = 'GitHub Wiki'
$WikiToolStripMenuItem.Add_Click($WikiToolStripMenuItem_Click)
# MemProcFSToolStripMenuItem
$MemProcFSToolStripMenuItem.Name = 'MemProcFSToolStripMenuItem'
$MemProcFSToolStripMenuItem.Size = New-Object System.Drawing.Size(152, 22)
$MemProcFSToolStripMenuItem.Text = 'MemProcFS'
$MemProcFSToolStripMenuItem.ToolTipText = 'MemProcFS - The Memory Process File System'
$MemProcFSToolStripMenuItem.Add_Click($MemProcFSToolStripMenuItem_Click)
# MemProcFSWikiToolStripMenuItem
$MemProcFSWikiToolStripMenuItem.Name = 'MemProcFSWikiToolStripMenuItem'
$MemProcFSWikiToolStripMenuItem.Size = New-Object System.Drawing.Size(152, 22)
$MemProcFSWikiToolStripMenuItem.Text = 'MemProcFS Wiki'
$MemProcFSWikiToolStripMenuItem.ToolTipText = 'MemProcFS Wiki'
$MemProcFSWikiToolStripMenuItem.Add_Click($MemProcFSWikiToolStripMenuItem_Click)
# AboutToolStripMenuItem
$AboutToolStripMenuItem.Name = 'AboutToolStripMenuItem'
$AboutToolStripMenuItem.Size = New-Object System.Drawing.Size(152, 22)
$AboutToolStripMenuItem.Text = 'About'
$AboutToolStripMenuItem.ToolTipText = 'About'
$AboutToolStripMenuItem.Add_Click($AboutToolStripMenuItem_Click)
$MenuStrip1.ResumeLayout()
$FormMemProcFSAnalyzer.ResumeLayout()
# Save the initial state of the form
$InitialFormWindowState = $FormMemProcFSAnalyzer.WindowState
$FormMemProcFSAnalyzer.Add_Load($Form_StateCorrection_Load)
$FormMemProcFSAnalyzer.Add_FormClosed($Form_Cleanup_FormClosed)
$FormMemProcFSAnalyzer.Add_Closing($Form_StoreValues_Closing)
return $FormMemProcFSAnalyzer.ShowDialog((New-Object System.Windows.Forms.Form -Property @{TopMost = $true}))
}
$Result = Show-UserInterface
if($Result -eq "OK")
{
if ($Pagefile -eq "Select your pagefile.sys (Optional)")
{
$script:Pagefile = $null
}
}
else
{
$Host.UI.RawUI.WindowTitle = "$DefaultWindowsTitle"
Exit
}
#############################################################################################################################################################################################
# FileName
$script:FileName = $MemoryDump.Split('\')[-1] | ForEach-Object{($_ -replace "\..*","")}
# Output Directory
$script:OUTPUT_FOLDER = "$SCRIPT_DIR\$Timestamp-$FileName"
# Drive Letter (Mount Point)
[char[]]$Taken = (Get-PSDrive -Name [A-Z]).Name
$script:DriveLetter = ([char[]]([int][char]"D" .. [int][char]"Z")).Where({ $_ -notin $Taken }, "First")[0] + ":"
if (!$script:DriveLetter)
{
Write-Host "[Error] No Drive Letter available." -ForegroundColor Red
$Host.UI.RawUI.WindowTitle = "$DefaultWindowsTitle"
Exit
}
# Create a record of your PowerShell session to a text file
Start-Transcript -Path "$SCRIPT_DIR\$Timestamp-$FileName.txt"
# Get Start Times
$script:StartTime_Processing = (Get-Date)
$script:StartTime_Analysis = (Get-Date)
# Logo
$Logo = @"
██╗ ███████╗████████╗██╗ ██╗ █████╗ ██╗ ███████╗ ██████╗ ██████╗ ███████╗███╗ ██╗███████╗██╗ ██████╗███████╗
██║ ██╔════╝╚══██╔══╝██║ ██║██╔══██╗██║ ██╔════╝██╔═══██╗██╔══██╗██╔════╝████╗ ██║██╔════╝██║██╔════╝██╔════╝
██║ █████╗ ██║ ███████║███████║██║█████╗█████╗ ██║ ██║██████╔╝█████╗ ██╔██╗ ██║███████╗██║██║ ███████╗
██║ ██╔══╝ ██║ ██╔══██║██╔══██║██║╚════╝██╔══╝ ██║ ██║██╔══██╗██╔══╝ ██║╚██╗██║╚════██║██║██║ ╚════██║
███████╗███████╗ ██║ ██║ ██║██║ ██║███████╗ ██║ ╚██████╔╝██║ ██║███████╗██║ ╚████║███████║██║╚██████╗███████║
╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═════╝╚══════╝
"@
Write-Host ""
Write-Host "$Logo"
# Header
Write-Output ""
Write-Output "MemProcFS-Analyzer v1.0 - Automated Forensic Analysis of Windows Memory Dumps for DFIR"
Write-Output "(c) 2021-2023 Martin Willing at Lethal-Forensics (https://lethal-forensics.com/)"
Write-Output ""
# Analysis date (ISO 8601)
$AnalysisDate = $Date -replace "T", " " # YYYY-MM-DD hh:mm:ss
Write-Output "Analysis date: $AnalysisDate UTC"
Write-Output ""
}
#endregion Header