rusthound 1.1.69

Active Directory data collector for Bloodhound written in rust.
Documentation
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

{
   "_comment": "Custom queries v1.0",
   "_comment2": "Certipy customqueries https://github.com/ly4k/Certipy/blob/main/customqueries.json",
   "queries": [

      {
         "name": "[A1] Return all users: MATCH (u:User) return u",
         "category": "Simple custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (u:User) return u"
            }
         ]
      },
      {
         "name": "[A2] Return all computers: MATCH (c:Computer) return c",
         "category": "Simple custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (c:Computer) return c"
            }
         ]
      },
      {
         "name": "[A3] Return all groups: MATCH (g:Group) return g",
         "category": "Simple custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (g:Group) return g"
            }
         ]
      },
      {
         "name": "[A4] Return all ous: MATCH (o:OU) return o",
         "category": "Simple custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (o:OU) return o"
            }
         ]
      },
      {
         "name": "[A5] Return all gpos: MATCH (g:GPO) return g",
         "category": "Simple custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (g:GPO) return g"
            }
         ]
      },
      {
         "name": "[A6] Return all containers: MATCH (c:Container) return c",
         "category": "Simple custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (c:Container) return c"
            }
         ]
      },
      {
         "name": "[A7] Return all domains: MATCH (d:Domain) return d",
         "category": "Simple custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (d:Domain) return d"
            }
         ]
      },
      {
         "name": "[A8] Return users content specified word: MATCH (u:User) WHERE u.name CONTAINS 'g0h4n' return u",
         "category": "Simple custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (u:User) WHERE u.name CONTAINS 'g0h4n' return u"
            }
         ]
      },
      {
         "name": "[B1] List all owned users",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH (m:User) WHERE m.owned=TRUE RETURN m"
             }
         ]
      },
      {
         "name": "[B2] List all owned computers",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH (m:Computer) WHERE m.owned=TRUE RETURN m"
             }
         ]
      },
      {
         "name": "[B3] List all owned groups",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH (m:Group) WHERE m.owned=TRUE RETURN m"
             }
         ]
      },
      {
         "name": "[B4] List all owned computers",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH (m:Computer) WHERE m.owned=TRUE RETURN m"
             }
         ]
      },
      {
         "name": "[B5] List the groups of all owned users",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (m:User) WHERE m.owned=TRUE WITH m MATCH p=(m)-[:MemberOf*1..]->(n:Group) RETURN p"
            }
         ]
      },
      {
         "name": "[B6] Find the Shortest path to a high value target from an owned object",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH p=shortestPath((g {owned:true})-[*1..]->(n {highvalue:true})) WHERE  g<>n return p"
             }
         ]
      },
      {
         "name": "[B7] Find the Shortest path to a unconstrained delegation system from an owned object",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH (n) MATCH p=shortestPath((n)-[*1..]->(m:Computer {unconstraineddelegation: true})) WHERE NOT n=m AND n.owned = true RETURN p"
             }
         ]
      },
      {

         "name": "[B8] Find all Kerberoastable Users where n.hasspn=true (Kerberosting attack)",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH (n:User) WHERE n.hasspn=true RETURN n",
                 "allowCollapse": false
             }
         ]
      },
		{
         "name": "[B9] Find Kerberoastable Users with a path to DA",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH (u:User {hasspn:true}) MATCH (g:Group) WHERE g.objectid ENDS WITH '-512' MATCH p = shortestPath( (u)-[*1..]->(g) ) RETURN p"
             }
         ]
     },
     {
         "name": "[B10] Find users that can be AS-REP roasted (ASREPRoast)",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (u:User {dontreqpreauth: true}) RETURN u"
            }
         ]
      },
      {
         "name": "[B11] Find groups that can reset passwords (Warning: Heavy)",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH p=(m:Group)-[r:ForceChangePassword]->(n:User) RETURN p"
            }
         ]
      },
      {
         "name": "[B12] Find groups that have local admin rights (Warning: Heavy)",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH p=(m:Group)-[r:AdminTo]->(n:Computer) RETURN p"
             }
         ]
     },
     {
         "name": "[B13] Find all users that have local admin rights",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH p=(m:User)-[r:AdminTo]->(n:Computer) RETURN p"
            }
         ]
      },
      {
         "name": "[B14] Find all active Domain Admin sessions",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH (n:User)-[:MemberOf]->(g:Group) WHERE g.objectid ENDS WITH '-512' MATCH p = (c:Computer)-[:HasSession]->(n) return p"
             }
         ]
     },
     {
         "name": "[B15] Find all computers with Unconstrained Delegation",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (c:Computer {unconstraineddelegation:true}) return c"
            }
         ]
      },
		{
         "name": "[B16] Find all computers with unsupported operating systems",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH (H:Computer) WHERE H.operatingsystem = '.*(2000|2003|2008|xp|vista|7|me).*' RETURN H"
             }
         ]
     },
     {
         "name": "[B17.1] Return the name of every computer in the database where at least one SPN for the computer contains the string 'MSSQL'",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (c:Computer) WHERE ANY (x IN c.serviceprincipalnames WHERE toUpper(x) CONTAINS 'MSSQL') RETURN c"
            }
         ]
      },
      {
         "name": "[B17.2] Return the name of every user in the database where at least one SPN for the computer contains the string 'MSSQL'",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (u:User) WHERE ANY (x IN u.serviceprincipalnames WHERE toUpper(x) CONTAINS 'MSSQL') RETURN u"
            }
         ]
      },
     {
         "name": "[B18] View all groups that contain the word 'admin'",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "Match (n:Group) WHERE n.name CONTAINS 'ADMIN' RETURN n"
            }
         ]
      },
      {
         "name": "[B19] Show all high value target's groups",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH p=(n:User)-[r:MemberOf*1..]->(m:Group {highvalue:true}) RETURN p"
             }
         ]
      },
      {
         "name": "[B20] Find groups that contain both users and computers",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH (c:Computer)-[r:MemberOf*1..]->(groupsWithComps:Group) WITH groupsWithComps MATCH (u:User)-[r:MemberOf*1..]->(groupsWithComps) RETURN DISTINCT(groupsWithComps) as groupsWithCompsAndUsers"
             }
         ]
      },
      {
         "name": "[B21] Find all users a part of the VPN group",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "Match p=(u:User)-[:MemberOf]->(g:Group) WHERE toUPPER (g.name) CONTAINS 'VPN' return p"
             }
         ]
     },
      {
         "name": "[B22] Find if any domain user has interesting permissions against a GPO (Warning: Heavy)",
         "category": "Other RustHound custom queries",
         "queryList": [
             {
                 "final": true,
                 "query": "MATCH p=(u:User)-[r:AllExtendedRights|GenericAll|GenericWrite|Owns|WriteDacl|WriteOwner|GpLink*1..]->(g:GPO) RETURN p"
             }
         ]
     },
     {
         "name": "[B23] Find All edges any owned user has on a computer",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH p=shortestPath((m:User)-[r*]->(b:Computer)) WHERE m.owned RETURN p"
            }
         ]
      },
      {
         "name": "[B24] Find all computer or objects who can read GMSA password (ReadGMSAPassword limit 25)",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH p=()-[r:ReadGMSAPassword]->() RETURN p LIMIT 25"
            }
         ]
      },
      {
         "name": "[B25] Find all computer or objects who can DCSync (limit 25)",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH p=(n:Computer)-[r:DCSync]->() RETURN p LIMIT 25"
            }
         ]
      },
      {
         "name": "[B26.1] Find all users who description contains 'pass'",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (n:User WHERE n.description CONTAINS 'pass') RETURN n"
            }
         ]
      },
      {
         "name": "[B26.2] Find all computers who description contains 'pass'",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (n:Computer WHERE n.description CONTAINS 'pass') RETURN n"
            }
         ]
      },
      {
         "name": "[B26.3] Find all groups who description contains 'pass'",
         "category": "Other RustHound custom queries",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (n:Group WHERE n.description CONTAINS 'pass') RETURN n"
            }
         ]
      },
      {
         "name": "[C1] KUD (Kerberos Unconstrained Delegation): Find unconstrained delegation",
         "category": "Kerberos",
         "_comment": "https://mayfly277.github.io/posts/GOADv2-pwning-part10/",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (c {unconstraineddelegation:true}) return c"
            }
         ]
      },
      {
         "name": "[C2] KUD: search for unconstrained delegation system (out of domain controller)",
         "category": "Kerberos",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (c1:Computer)-[:MemberOf*1..]->(g:Group) WHERE g.objectid ENDS WITH '-516' WITH COLLECT(c1.name) AS domainControllers MATCH (c2 {unconstraineddelegation:true}) WHERE NOT c2.name IN domainControllers RETURN c2"
            }
         ]
      },
      {
         "name": "[C3] KUD: Find the Shortest path to a unconstrained delegation system from an owned object",
         "category": "Kerberos",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (n) MATCH p=shortestPath((n)-[*1..]->(m:Computer {unconstraineddelegation: true})) WHERE NOT n=m AND n.owned = true RETURN p"
            }
         ]
      },
      {
         "name": "[C4] KCD (Kerberos Constrained Delegation): Find constrained delegation (User to Computer)",
         "category": "Kerberos",
         "queryList": [
            {
               "final": true,
               "query": "MATCH p=(u:User)-[:AllowedToDelegate]->(c) RETURN p"
            }
         ]
      },
      {
         "name": "[C5] KCD: Find constrained delegation (Computer to Computer)",
         "category": "Kerberos",
         "queryList": [
            {
               "final": true,
               "query": "MATCH p=(u:Computer)-[:AllowedToDelegate]->(c) RETURN p"
            }
         ]
      },
      {
         "name": "[C6] RBCD (Resource Based Constrained Delegation): Computer with msDS-AllowedToActOnBehalfOfOtherIdentity value",
         "category": "Kerberos",
         "queryList": [
            {
               "final": true,
               "query": "MATCH p=(c)-[:AllowedToAct]->(c) RETURN p"
            }
         ]
      },
      {
         "name": "[C7] RBCD: User with GenericAll or GenericWrite or WriteDACL on Computer",
         "category": "Kerberos",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (n) MATCH p=shortestPath((n:User)-[:AllExtendedRights|GenericAll|GenericWrite|Owns|WriteDacl*1..]->(m:Computer)) RETURN p"
            }
         ]
      },
      {
         "name": "[C8] KDC:RBCD: Find all computer who can AllowedToAct or AllowToDelegate (limit 25)",
         "category": "Kerberos",
         "queryList": [
            {
               "final": true,
               "query": "MATCH (m:Computer),(n {highvalue:true}),p=shortestPath((m)-[r*1..]->(n)) WHERE NONE (r IN relationships(p) WHERE type(r)= 'GetChanges') AND NONE (r in relationships(p) WHERE type(r)='GetChangesAll') AND NOT m=n RETURN p LIMIT 25"
            }
         ]
      },
      {
         "name": "Find all Certificate Templates",
         "category": "Certificates",
         "queryList": [
           {
             "final": true,
             "query": "MATCH (n:GPO) WHERE n.type = 'Certificate Template' RETURN n"
           }
         ]
       },
       {
         "name": "Find enabled Certificate Templates",
         "category": "Certificates",
         "queryList": [
           {
             "final": true,
             "query": "MATCH (n:GPO) WHERE n.type = 'Certificate Template' and n.Enabled = true RETURN n"
           }
         ]
       },
       {
         "name": "Find Certificate Authorities",
         "category": "Certificates",
         "queryList": [
           {
             "final": true,
             "query": "MATCH (n:GPO) WHERE n.type = 'Enrollment Service' RETURN n"
           }
         ]
       },
       {
         "name": "Show Enrollment Rights for Certificate Template",
         "category": "Certificates",
         "queryList": [
           {
             "final": false,
             "title": "Select a Certificate Template...",
             "query": "MATCH (n:GPO) WHERE n.type = 'Certificate Template' RETURN n.name"
           },
           {
             "final": true,
             "query": "MATCH p=(g)-[:Enroll|AutoEnroll]->(n:GPO {name:$result}) WHERE n.type = 'Certificate Template' return p",
             "allowCollapse": false
           }
         ]
       },
       {
         "name": "Show Rights for Certificate Authority",
         "category": "Certificates",
         "queryList": [
           {
             "final": false,
             "title": "Select a Certificate Authority...",
             "query": "MATCH (n:GPO) WHERE n.type = 'Enrollment Service' RETURN n.name"
           },
           {
             "final": true,
             "query": "MATCH p=(g)-[:ManageCa|ManageCertificates|Auditor|Operator|Read|Enroll]->(n:GPO {name:$result}) return p",
             "allowCollapse": false
           }
         ]
       },
       {
         "name": "Find Misconfigured Certificate Templates (ESC1)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH (n:GPO) WHERE n.type = 'Certificate Template' and n.`Enrollee Supplies Subject` = true and n.`Client Authentication` = true and n.`Enabled` = true  RETURN n"
           }
         ]
       },
       {
         "name": "Shortest Paths to Misconfigured Certificate Templates from Owned Principals (ESC1)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH p=allShortestPaths((g {owned:true})-[*1..]->(n:GPO)) WHERE  g<>n and n.type = 'Certificate Template' and n.`Enrollee Supplies Subject` = true and n.`Client Authentication` = true and n.`Enabled` = true return p"
           }
         ]
       },
       {
         "name": "Find Misconfigured Certificate Templates (ESC2)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH (n:GPO) WHERE n.type = 'Certificate Template' and n.`Enabled` = true and (n.`Extended Key Usage` = [] or 'Any Purpose' IN n.`Extended Key Usage`)  RETURN n"
           }
         ]
       },
       {
         "name": "Shortest Paths to Misconfigured Certificate Templates from Owned Principals (ESC2)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH p=allShortestPaths((g {owned:true})-[*1..]->(n:GPO)) WHERE  g<>n and n.type = 'Certificate Template' and n.`Enabled` = true and (n.`Extended Key Usage` = [] or 'Any Purpose' IN n.`Extended Key Usage`) return p"
           }
         ]
       },
       {
         "name": "Find Enrollment Agent Templates (ESC3)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH (n:GPO) WHERE n.type = 'Certificate Template' and n.`Enabled` = true and (n.`Extended Key Usage` = [] or 'Any Purpose' IN n.`Extended Key Usage` or 'Certificate Request Agent' IN n.`Extended Key Usage`)  RETURN n"
           }
         ]
       },
       {
         "name": "Shortest Paths to Enrollment Agent Templates from Owned Principals (ESC3)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH p=allShortestPaths((g {owned:true})-[*1..]->(n:GPO)) WHERE  g<>n and n.type = 'Certificate Template' and n.`Enabled` = true and (n.`Extended Key Usage` = [] or 'Any Purpose' IN n.`Extended Key Usage` or 'Certificate Request Agent' IN n.`Extended Key Usage`) return p"
           }
         ]
       },
       {
         "name": "Shortest Paths to Vulnerable Certificate Template Access Control (ESC4)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH p=shortestPath((g)-[:GenericAll|GenericWrite|Owns|WriteDacl|WriteOwner*1..]->(n:GPO)) WHERE  g<>n and n.type = 'Certificate Template' and n.`Enabled` = true RETURN p"
           }
         ]
       },
       {
         "name": "Shortest Paths to Vulnerable Certificate Template Access Control from Owned Principals (ESC4)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH p=allShortestPaths((g {owned:true})-[r*1..]->(n:GPO)) WHERE g<>n and n.type = 'Certificate Template' and n.Enabled = true and NONE(x in relationships(p) WHERE type(x) = 'Enroll' or type(x) = 'AutoEnroll') return p"
           }
         ]
       },
       {
         "name": "Find Certificate Authorities with User Specified SAN (ESC6)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH (n:GPO) WHERE n.type = 'Enrollment Service' and n.`User Specified SAN` = 'Enabled' RETURN n"
           }
         ]
       },
       {
         "name": "Shortest Paths to Vulnerable Certificate Authority Access Control (ESC7)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH p=shortestPath((g)-[r:GenericAll|GenericWrite|Owns|WriteDacl|WriteOwner|ManageCa|ManageCertificates*1..]->(n:GPO)) WHERE  g<>n and n.type = 'Enrollment Service' RETURN p"
           }
         ]
       },
       {
         "name": "Shortest Paths to Vulnerable Certificate Authority Access Control from Owned Principals (ESC7)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH p=allShortestPaths((g {owned:true})-[*1..]->(n:GPO)) WHERE  g<>n and n.type = 'Enrollment Service' and NONE(x in relationships(p) WHERE type(x) = 'Enroll' or type(x) = 'AutoEnroll') RETURN p"
           }
         ]
       },
       {
         "name": "Find Certificate Authorities with HTTP Web Enrollment (ESC8)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH (n:GPO) WHERE n.type = 'Enrollment Service' and n.`Web Enrollment` = 'Enabled' RETURN n"
           }
         ]
       },
       {
         "name": "Find Unsecured Certificate Templates (ESC9)",
         "category": "Domain Escalation",
         "queryList": [
           {
             "final": true,
             "query": "MATCH (n:GPO) WHERE n.type = 'Certificate Template' and n.`Enrollee Supplies Subject` = true and n.`Client Authentication` = true and n.`Enabled` = true  RETURN n"
           }
         ]
       },
       {
         "name": "Find Unsecured Certificate Templates (ESC9)",
         "category": "PKI",
         "queryList": [
           {
             "final": true,
             "query": "MATCH (n:GPO) WHERE n.type = 'Certificate Template' and 'NoSecurityExtension' in n.`Enrollment Flag` and n.`Enabled` = true  RETURN n"
           }
         ]
       },
       {
         "name": "Shortest Paths to Unsecured Certificate Templates from Owned Principals (ESC9)",
         "category": "PKI",
         "queryList": [
           {
             "final": true,
             "query": "MATCH p=allShortestPaths((g {owned:true})-[r*1..]->(n:GPO)) WHERE n.type = 'Certificate Template' and g<>n and 'NoSecurityExtension' in n.`Enrollment Flag` and n.`Enabled` = true and NONE(rel in r WHERE type(rel) in ['EnabledBy','Read','ManageCa','ManageCertificates']) return p"
           }
         ]
       }
   ]
}