-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVynae.ps1
More file actions
613 lines (602 loc) · 25.8 KB
/
Vynae.ps1
File metadata and controls
613 lines (602 loc) · 25.8 KB
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
param($ID, $Name, [switch]$Hash, [switch]$Trace, [switch]$NetOnly, [switch]$help, [switch]$AlertOnly, [switch]$NoPath, [switch]$Service, [switch]$NetSupress, [switch]$Colorblind, $Time, $Date, $TimeActive, $ServiceState, $ParentID, $NetStatus, $Output, $Module, $Mode, [switch]$Default, $Algorithm, $MatchHash, $RemoteAddress, $LocalAddress, $LocalPort, $RemotePort, $ExePath)
# Parameters accepted
function GlobalOptions(){
$global:DateTime = get-date
$global:Path =Get-location
$global:ErrorActionPreference="SilentlyContinue"
# $host.UI.RawUI.BackgroundColor = "Black"
if($Colorblind){
$global:GoodColor = 'cyan'
$global:BadColor = 'magenta'
}else{
$global:GoodColor = 'green'
$global:BadColor = 'red'
}
}
# Primary Filters
function ProcessInformation(){
if($Name){
if($NetOnly -or $NetStatus){
foreach($x in (get-ciminstance CIM_Process | ? Name -match $Name)){
try{
$TestNetConnection = get-nettcpconnection -OwningProcess $x.ProcessID -State $NetStatus
if($NetStatus -eq $null){
throw
}
}catch{
$TestNetConnection = get-nettcpconnection -OwningProcess $x.ProcessID
}
if($TestNetConnection){
ProcessPrint($x)
}
}
}else{
foreach($x in (get-ciminstance CIM_Process | ? Name -match $Name)){
ProcessPrint($x)
}
}
}elseif($ID){
foreach($x in (get-ciminstance CIM_Process | ? ProcessID -eq $ID)){
ProcessPrint($x)
}
}elseif($ParentID){
if($NetOnly -or $NetStatus){
foreach($x in (get-ciminstance CIM_Process | ? ParentProcessID -eq $ParentID)){
try{
$TestNetConnection = get-nettcpconnection -OwningProcess $x.ProcessID -State $NetStatus
if($NetStatus -eq $null){
throw
}
}catch{
$TestNetConnection = get-nettcpconnection -OwningProcess $x.ProcessID
}
if($TestNetConnection){
ProcessPrint($x)
}
}
}else{
foreach($x in (get-ciminstance CIM_Process | ? ParentProcessID -eq $ParentID)){
ProcessPrint($x)
}
}
}elseif($LocalAddress){
foreach($x in (get-ciminstance CIM_Process)){
$TestNetConnection = get-nettcpconnection -OwningProcess $x.ProcessID -LocalAddress $LocalAddress
if($TestNetConnection){
ProcessPrint($x)
}
}
}elseif($RemoteAddress){
foreach($x in (get-ciminstance CIM_Process)){
$TestNetConnection = get-nettcpconnection -OwningProcess $x.ProcessID -RemoteAddress $RemoteAddress
if($TestNetConnection){
ProcessPrint($x)
}
}
}elseif($LocalPort){
foreach($x in (get-ciminstance CIM_Process)){
$TestNetConnection = get-nettcpconnection -OwningProcess $x.ProcessID -LocalPort $LocalPort
if($TestNetConnection){
ProcessPrint($x)
}
}
}elseif($RemotePort){
foreach($x in (get-ciminstance CIM_Process)){
$TestNetConnection = get-nettcpconnection -OwningProcess $x.ProcessID -RemotePort $RemotePort
if($TestNetConnection){
ProcessPrint($x)
}
}
}else{
if($NetOnly -or $NetStatus){
foreach($x in (get-ciminstance CIM_Process)){
try{
$TestNetConnection = get-nettcpconnection -OwningProcess $x.ProcessID -State $NetStatus
if($NetStatus -eq $null){
throw
}
}catch{
$TestNetConnection = get-nettcpconnection -OwningProcess $x.ProcessID
}
if($TestNetConnection){
ProcessPrint($x)
}
}
}else{
foreach($x in (get-ciminstance CIM_Process)){
ProcessPrint($x)
}
}
}
}
#Print Filters and Information print functions
function ProcessPrint($Process){
$ActiveTime = New-TimeSpan -Start $Process.CreationDate -End $DateTime
if($Date -And $Process.CreationDate.Date -notcontains $Date){
return
}
if($Time -in 0..24 -And $Process.CreationDate.Hour -ne [int]$Time){
return
}
if($TimeActive -in 0..24 -And $ActiveTime.Hours -ne [int]$TimeActive){
return
}
if($MatchHash){
try{
if((Get-FileHash $Process.ExecutablePath -algorithm $algorithm).Hash -ne $MatchHash){
throw
}
write-host $Process.ExecutablePath
}catch{
return
}
}
if($ExePath){
if($Process.ExecutablePath -notmatch $ExePath){
return
}
}
$ParentPath = get-ciminstance CIM_Process | ? ProcessID -eq $Process.ParentProcessID
Write-Host "<-----Process Information----->" -ForegroundColor $GoodColor
Write-Host "Process Name: " -NoNewLine
Write-Host $Process.ProcessName -ForegroundColor $GoodColor
Write-Host "Process ID: " -NoNewLine
Write-Host $Process.ProcessId -ForegroundColor $GoodColor
Write-Host "PPID Name: " -NoNewLine
Write-Host $ParentPath.Name -ForegroundColor $GoodColor
Write-Host "Process PPID: " -NoNewLine
Write-Host $Process.ParentProcessID -ForegroundColor $GoodColor
if($ParentPath.ExecutablePath){
Write-Host "PPID Path:" $ParentPath.ExecutablePath
}
if($Process.CreationDate){
Write-Host "Creation Date:" $Process.CreationDate
Write-Host "Active for: " $ActiveTime.Hours 'Hours' $ActiveTime.Minutes 'Minutes'
}
Write-Host "CSName:" $Process.CSName
if($Process.ExecutablePath){
$ProcessHashOut = (Get-FileHash $Process.ExecutablePath -algorithm $algorithm)
Write-Host "Executable Path:" $Process.ExecutablePath
if($Algorithm){
Write-Host "Executable $Algorithm Hash:" $ProcessHashOut.Hash
}
}
if($Process.CommandLine){
Write-Host "Command Line:" $Process.CommandLine
}
Write-Host
NetworkInformation($Process.ProcessID)
}
function NetworkInformation($ProcessID){
if($NetSupress){
return
}
if(get-nettcpconnection | ? OwningProcess -eq $ProcessID | ? State -eq $NetStatus){
Write-Host "<-----Net Information----->" -ForegroundColor $GoodColor
foreach($x in (get-nettcpconnection | ? OwningProcess -eq $ProcessID | ? State -eq $NetStatus)){
NetworkPrint($x)
}
}elseif(get-nettcpconnection | ? OwningProcess -eq $ProcessID){
Write-Host "<-----Net Information----->" -ForegroundColor $GoodColor
foreach($x in (get-nettcpconnection | ? OwningProcess -eq $ProcessID)){
NetworkPrint($x)
}
}
}
function NetworkPrint($Conn){
Write-Host "State: " -NoNewLine
Write-Host $Conn.State -ForegroundColor $GoodColor
if($Conn.LocalAddress | Select-String -Pattern "::"){
if($Conn.LocalAddress -eq '::'){
Write-Host "Local IPv6 Address/Port:" -NoNewLine
Write-Host " ALL ADDRESSES " -ForegroundColor $BadColor -NoNewLine
Write-Host ":" $Conn.LocalPort
}elseif($Conn.LocalAddress -eq '::1'){
Write-Host "Local IPv6 Address/Port:" -NoNewLine
Write-Host " LOCALHOST " -ForegroundColor $BadColor -NoNewLine
Write-Host ":" $Conn.LocalPort
}else{
Write-Host "Local IPv6 Address/Port: " $Conn.LocalAddress ":" $Conn.LocalPort
}
if($Conn.RemoteAddress -eq '::'){
Write-Host "Remote IPv6 Address/Port:" -NoNewLine
Write-Host " ALL ADDRESSES " -ForegroundColor $BadColor -NoNewLine
Write-Host ":" $Conn.RemotePort
}else{
Write-Host "Remote IPv6 Address/Port:" $Conn.RemoteAddress ":" $Conn.RemotePort
}
}else{
if($Conn.LocalAddress -eq '0.0.0.0'){
Write-Host "Local IPv4 Address/Port:" -NoNewLine
Write-Host " ALL ADDRESSES " -ForegroundColor $BadColor -NoNewLine
Write-Host ":" $Conn.LocalPort
}elseif($Conn.LocalAddress -eq '127.0.0.1'){
Write-Host "Local IPv4 Address/Port:" -NoNewLine
Write-Host " LOCALHOST " -ForegroundColor $BadColor -NoNewLine
Write-Host ":" $Conn.LocalPort
}else{
Write-Host "Local IPv4 Address/Port:" $Conn.LocalAddress ":" $Conn.LocalPort
}
if($Conn.RemoteAddress -eq '0.0.0.0'){
Write-Host "Remote IPv4 Address/Port:" -NoNewLine
Write-Host " ALL ADDRESSES " -ForegroundColor $BadColor -NoNewLine
Write-Host ":" $Conn.RemotePort
}elseif($Conn.RemoteAddress -eq '127.0.0.1'){
Write-Host "Local IPv4 Address/Port:" -NoNewLine
Write-Host " LOCALHOST " -ForegroundColor $BadColor -NoNewLine
Write-Host ":" $Conn.RemotePort
}else{
Write-Host "Remote IPv4 Address/Port:" $Conn.RemoteAddress ":" $Conn.RemotePort
}
}
Write-Host
}
function ParentProcessTracing(){
if($ID){
foreach($x in get-ciminstance CIM_Process | ? ProcessID -eq $ID){
ProcessPrint($x)
ProcessTrace($x)
}
}elseif($Name){
foreach($x in get-ciminstance CIM_Process | ? ProcessName -match $Name){
ProcessPrint($x)
ProcessTrace($x)
}
}
}
function ProcessTrace($Process){
if((get-ciminstance CIM_Process | ? ProcessId -eq $Process.ParentProcessID) -And [int]$Process.ProcessId -ne 0){
$ID = $Process.ParentProcessID
ParentProcessTracing
}else{
Write-Host "<--Process cannot Be traced further-->" -ForegroundColor $BadColor
}
}
function ProcessHashing(){
$HashedArray=@()
Write-Host "<----- Loading Hashes ----->" -ForegroundColor $GoodColor
Try{
$HashList = Get-Content Hashes.txt
if($HashList -eq $null){
throw
}
Write-Host
Write-Host "<----- Hashes Successfully Loaded ----->" -ForegroundColor $GoodColor
}Catch{
Write-Host "<----- Hashes not loaded! ----->" -ForegroundColor $BadColor
exit
}
if($ID){
$Process = get-ciminstance CIM_Process | ? ProcessID -eq $ID
}elseif($Name){
$Process = get-ciminstance CIM_Process | ? Name -match $Name
}else{
$Process = get-ciminstance CIM_Process
}
foreach($x in $Process){
$ProcessHash = Get-FileHash $x.ExecutablePath
$FoundHash = $False
if(-Not $HashedArray.contains($ProcessHash.hash)){
if($x.ExecutablePath){
foreach($h in $HashList){
if($ProcessHash.Hash -eq $h){
$FoundHash = $True
}
}
$HashedArray += $ProcessHash.hash
if($FoundHash -eq $false -And -Not $AlertOnly){
Write-Host "No matches found!" -ForegroundColor $GoodColor
Write-Host "<-----Process Information----->" -ForegroundColor $GoodColor
Write-Host "Process Name: " -NoNewLine
Write-Host $x.ProcessName -ForegroundColor $GoodColor
Write-Host "Process ID: " -NoNewLine
Write-Host $x.ProcessId -ForegroundColor $GoodColor
Write-Host "Process PPID: " -NoNewLine
Write-Host $x.ParentProcessID -ForegroundColor $GoodColor
Write-Host "Creation Date:" $x.CreationDate
Write-Host "CSName:" $x.CSName
if($x.ExecutablePath){
Write-Host "Executable Path:" $x.ExecutablePath
}
if($x.CommandLine){
Write-Host "Command Line:" $x.CommandLine
}
Write-Host "Hash: " $ProcessHash.Hash
Write-Host
}elseif($FoundHash -eq $True){
Write-Host "<-----Hash Comparison----->" -ForegroundColor $GoodColor
Write-Host
Write-Host "Alert -- Found match!" -ForegroundColor $BadColor
Write-Host "Hash of " $x.ProcessName "with ID " $x.ProcessId "and ExecutablePath of " $x.ExecutablePath "matches hash " $h
Write-Host
Write-Host "<-----Process Information----->" -ForegroundColor $GoodColor
Write-Host "Process Name: " -NoNewLine
Write-Host $x.ProcessName -ForegroundColor $GoodColor
Write-Host "Process ID: " -NoNewLine
Write-Host $x.ProcessId -ForegroundColor $GoodColor
Write-Host "Process PPID: " -NoNewLine
Write-Host $x.ParentProcessID -ForegroundColor $GoodColor
Write-Host "Creation Date:" $x.CreationDate
Write-Host "CSName:" $x.CSName
if($x.ExecutablePath){
Write-Host "Executable Path:" $x.ExecutablePath
}
if($x.CommandLine){
Write-Host "Command Line:" $x.CommandLine
}
Write-Host "Hash: " $ProcessHash.Hash
Write-Host
}
}elseif(-Not $NoPath){
Write-Host "Alert -- Could not find Path!" -ForegroundColor $BadColor
Write-Host "Could not find Executable Path for " $x.ProcessName " with ID " $x.ProcessID
Write-Host
Write-Host "<-----Process Information----->" -ForegroundColor $GoodColor
Write-Host "Process Name: " -NoNewLine
Write-Host $x.ProcessName -ForegroundColor $GoodColor
Write-Host "Process ID: " -NoNewLine
Write-Host $x.ProcessId -ForegroundColor $GoodColor
Write-Host "Process PPID: " -NoNewLine
Write-Host $x.ParentProcessID -ForegroundColor $GoodColor
Write-Host "Creation Date:" $x.CreationDate
Write-Host "CSName:" $x.CSName
if($x.ExecutablePath){
Write-Host "Executable Path:" $x.ExecutablePath
}
if($x.CommandLine){
Write-Host "Command Line:" $x.CommandLine
}
Write-Host
}
}
}
}
function ServiceInformation(){
if($Name){
if($NetOnly -or $NetStatus){
try{
$Services = get-ciminstance Win32_Service | ? Name -match $Name | ? State -eq $ServiceState
if($ServiceState -eq $null){
throw
}
}catch{
$Services = get-ciminstance Win32_Service | ? Name -match $Name
}
foreach($x in $Services){
try{
$TestNetConnection = get-nettcpconnection | ? OwningProcess -eq $Services.ProcessID | ? State -eq $NetStatus
if($NetStatus -eq $null){
throw
}
}catch{
$TestNetConnection = get-nettcpconnection | ? OwningProcess -eq $Services.ProcessID
}
if($TestNetConnection){
foreach($y in $x){
ServicePrint($x)
NetworkInformation($x.ProcessID)
}
}
}
}else{
try{
$Services = get-ciminstance Win32_Service | ? Name -match $Name | ? State -eq $ServiceState
if($ServiceState -eq $null){
throw
}
}catch{
$Services = get-ciminstance Win32_Service | ? Name -match $Name
}
foreach($x in $Services){
ServicePrint($x)
NetworkInformation($x.ProcessID)
}
}
}else{
if($NetOnly -or $NetStatus){
try{
$Services = get-ciminstance Win32_Service | ? State -eq $ServiceState
if($ServiceState -eq $null){
throw
}
}catch{
$Services = get-ciminstance Win32_Service
}
foreach($x in $Services){
try{
$TestNetConnection = get-nettcpconnection | ? OwningProcess -eq $x.ProcessID | ? State -eq $NetStatus
if($NetStatus -eq $null){
throw
}
}catch{
$TestNetConnection = get-nettcpconnection | ? OwningProcess -eq $x.ProcessID
}
if($TestNetConnection){
foreach($y in $x){
ServicePrint($x)
NetworkInformation($x.ProcessID)
}
}
}
}else{
try{
$Services = get-ciminstance Win32_Service | ? State -eq $ServiceState
if($ServiceState -eq $null){
throw
}
}catch{
$Services = get-ciminstance Win32_Service
}
foreach($x in $Services){
ServicePrint($x)
NetworkInformation($x.ProcessID)
}
}
}
}
function ServicePrint($Service){
$Process = get-ciminstance Win32_Process | ? ProcessID -eq $Service.ProcessID
Write-Host "<-----Service Information----->" -ForegroundColor $GoodColor
Write-Host "Service Name: " -NoNewLine
Write-Host $Service.Name -ForegroundColor $GoodColor
Write-Host "Service Status: " -NoNewLine
Write-Host $Service.Status -ForegroundColor $GoodColor
Write-Host "Service State: " -NoNewLine
Write-Host $Service.State -ForegroundColor $GoodColor
Write-Host "Process ID: " -NoNewLine
Write-Host $Service.ProcessId -ForegroundColor $GoodColor
Write-Host "Process PPID: " -NoNewLine
Write-Host $Process.ParentProcessID -ForegroundColor $GoodColor
Write-Host "Creation Class:" $Service.CreationClassName
Write-Host "System Name:" $Service.SystemName
if($Service.PathName){
Write-Host "Executable Path:" $Service.PathName
}
if($Service.InstallDate){
Write-Host "Install Date:" $Service.InstallDate
}
Write-Host "Description: " $Service.Description
Write-Host
}
function VynaeHelp(){
Write-Host
Write-Host "Vynae"
Write-Host "A PowerShell tool for extracting process Information"
Write-Host
Write-Host "Usage"
Write-Host
Write-Host " -Default" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Runs Vynae's process information gatherer"
Write-Host " Gathers Name, ID, PPID Name, PPID, PPID Path, Creation Date, Active Time"
Write-Host " CSName, Executable Path, and Command Line options"
Write-Host
Write-Host " Filter with ID, Name, ParentID, Time options, or Net options"
Write-Host
Write-Host " -ID" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Used to pull information on a specific ProcessID"
Write-Host
Write-Host " -ParentID" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Used to list all processes spawned by the given ParentID"
Write-Host
Write-Host " -Name" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Used to pull information on ALL processes whose names match the value"
Write-Host
Write-Host " -ExePath" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Specify executable path for processes. E.g., -ExePath Desktop for processes running from the Desktop"
Write-Host
Write-Host " -Trace" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Used to trace a process ParentProcessID back to the originating process"
Write-Host " Must specify a -Name or -ID"
Write-Host
Write-Host " -LocalAddress/RemoteAddress" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Used to search processes by remote or local address. Supports IPv4 and IPv6 addresses"
Write-Host
Write-Host " -Time -Date -TimeActive" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Used to filter by date [str], time [int 0-23], and time active(hours) [int 0-23]"
Write-Host
Write-Host " -MatchHash" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Specify a hash value to search for"
Write-Host
Write-Host " -Algorithm" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Specify algorith to use with -MatchHash"
Write-Host
Write-Host " -Colorblind" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Uses magenta and cyan colors to help alleviate colorblind issues"
Write-Host
Write-Host " -NetOnly" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Used to only pull processes with network connections"
Write-Host
Write-Host " -NetStatus" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Used to only pull processes with matching network connection states"
Write-Host
Write-Host " -NetSupress" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Used to hide network information."
Write-Host
Write-Host " -Service" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Used to scan services instead of processes"
Write-Host " Use -ServiceState to filter by Running/Stopped"
Write-Host
Write-Host " -Output" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Specifies the output path for the PowerShell transcript of the session"
Write-Host
Write-Host " -Hash" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Hashes each process executable and compares it to the list Hashes.txt"
Write-Host " Alerts on matched hashes and processes without executable paths"
Write-Host " Hide No Path alerts with -NoPath, and hide No match found messages with -AlertOnly."
Write-Host
Write-Host " -Module" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Runs modules in /Modules"
Write-Host " Unless specified, Modules run in either -Mode Task or -Mode Control"
Write-Host " -Mode Task will create the scheduled task associated with the module"
Write-Host " -Mode Control will manually run the module's function"
Write-Host " Integrity"
Write-Host " Creates a scheduled task that compares a control list of processes"
Write-Host " to the current running processes and reports the differences, if any."
Write-Host " RunKeys"
Write-Host " Checks registry keys and temp files for known malicious hashes"
Write-Host " Use -Mode to specify RegKey check or TempFiles check"
Write-Host " Alternatively, run without -Mode to scan both"
Write-Host " BlackWall"
Write-Host " Creates a scheduled task that auto-bans IP addresses associated with security event 4625"
Write-Host " Can be modified using BlackWall.xml"
Write-Host
Write-Host " -Help" -ForegroundColor $GoodColor -NoNewLine
Write-Host " Displays this menu"
Write-Host
Write-Host "Running with no parameters will scan all processes and list process information and network information"
Write-Host
}
GlobalOptions
if($Module){
if($Module -eq 'Integrity'){
$Path = get-location
$Path = $Path.Path
& "$Path\Modules\VynaeIntegrityCheck.ps1" -Mode Control -Path $Path
}elseif($Module -eq 'RunKeys'){
$Path = get-location
$Path =$Path.Path
& "$Path\Modules\VynaeRegCheck.ps1" -Mode $Mode -Path $Path
}elseif($Module -eq 'BlackWall'){
$Path = get-location
$Path = $Path.Path
& "$Path\Modules\VynaeBlackWall.ps1" -Mode $Mode
}
exit
}
if($Output){
start-transcript -path $output -append
}
if($Service){
ServiceInformation
}
if($Trace){
ParentProcessTracing
}
if($Hash){
ProcessHashing
}
if($Help){
VynaeHelp
}
if($Default){
ProcessInformation
}
if($Output){
stop-transcript
}
if($PSBoundParameters.Values.Count -eq 0){
Write-Host
Write-Host "Vynae"
Write-Host
Write-Host " A PowerShell tool for extracting process information"
Write-Host
Write-Host "Created By Liam Powell for use in NCCDC 2022-23"
Write-Host
Write-Host "For usage details, see Vynae -help"
Write-Host "For examples, see https://www.github.com/lpowell/vynae"
Write-Host "For more information, please visit https://blog.bajiri.com"
exit
}
if(-Not $Trace -and -Not $Hash -And -Not $Help -And -Not $Service){
ProcessInformation
}