-
Notifications
You must be signed in to change notification settings - Fork 0
/
customqueries.json
143 lines (140 loc) · 4.49 KB
/
customqueries.json
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
{
"queries":[
{
"name": "Kerberoastable Admins",
"queryList":[
{
"final":true,
"query":
"MATCH (n:Group) WHERE n.objectsid =~ $sid WITH n MATCH p=(n)<-[MemberOf*1..]-(m {hasspn: true}) RETURN p",
"allowCollapse": true,
"props": {
"sid": "(?i)S-1-5-.*-512"
}
}
]
},
{
"name": "All Kerberoastable Users",
"queryList":[
{
"final":true,
"requireNodeSelect": false,
"query": "MATCH (n {hasspn: true}) RETURN n",
"allowCollapse": true,
"props": {}
}
]
},
{
"name": "Where can owned users RDP",
"queryList":[
{
"final":true,
"requireNodeSelect": false,
"query": "MATCH p=(m:User {owned: true})-[r:MemberOf|CanRDP*1..]->(n:Computer) RETURN p",
"allowCollapse": true,
"props": {}
}
]
},
{
"name": "Users with most local admin rights",
"queryList":[
{
"final":true,
"requireNodeSelect": false,
"query": "MATCH (U:User)-[r:MemberOf|AdminTo*1..]->(C:Computer) WITH U.name as n, COUNT(DISTINCT(C)) AS c RETURN n,c ORDER BY c DESC LIMIT 5",
"allowCollapse": true,
"props": {}
}
]
},
{
"name": "All Owned Nodes",
"queryList":[
{
"final":true,
"requireNodeSelect": false,
"query": "MATCH (n {owned: true}) RETURN n",
"allowCollapse": true,
"props": {}
}
]
},
{
"name": "Find computers with owned Admins",
"queryList": [
{
"final": true,
"query": "MATCH p=shortestPath((n:User {owned:true})-[r:AdminTo|MemberOf*1..]->(c:Computer)) return p",
"allowCollapse": false
}
]
},
{
"name": "Find owned Groups",
"queryList":[
{
"final":true,
"requireNodeSelect": false,
"query": "MATCH (n:User {owned: true})-[r:MemberOf]->(g:Group) RETURN g",
"allowCollapse": true,
"props": {}
}
]
},
{
"name": "Find owned Domain Admins",
"queryList":[
{
"final": true,
"title": "Select a domain...",
"query": "MATCH (n:Group) WHERE n.name =~ $name AND n.owned=true WITH n MATCH p=(n)<-[r:MemberOf*1..]-(m) RETURN p",
"props": {
"name": "(?i).*DOMAIN ADMINS.*"
},
"allowCollapse": false
}
]
},
{
"name": "Find Shortest Path from owned Node to Domain Admin",
"queryList": [
{
"final": false,
"title": "Select a Domain Admin group...",
"query": "MATCH (n:Group) WHERE n.name =~ $name RETURN n.name ORDER BY n.name DESC",
"props": {
"name": "(?i).*DOMAIN ADMINS.*"
}
},
{
"final": true,
"query": "MATCH (n:User),(m:Group {name:$result}),p=shortestPath((n {owned:true})-[r:MemberOf|AdminTo|HasSession|Contains|GpLink|Owns|DCSync|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner*1..]->(m)) RETURN p",
"allowCollapse": true,
"endNode":"{}"
}
]
},
{
"name": "Find all other Rights Domain Users shouldn't have",
"queryList": [
{
"final": true,
"query": "MATCH p=(m:Group)-[r:Owns|WriteDacl|GenericAll|WriteOwner|ExecuteDCOM|GenericWrite|AllowedToDelegate|ForceChangePassword]->(n:Computer) WHERE m.objectid ENDS WITH '-513' OR m.objectsid ENDS WITH '-515' OR m.objectsid ENDS WITH 'S-1-5-11' OR m.objectsid ENDS WITH 'S-1-1-0' RETURN p",
"allowCollapse": true
}
]
},
{
"name": "Computers with administrative Domain Users",
"queryList": [
{
"final": true,
"query": "MATCH p=(m:Group)-[r:AddMember|AdminTo|AllExtendedRights|AllowedToDelegate|CanRDP|Contains|ExecuteDCOM|ForceChangePassword|GenericAll|GenericWrite|GetChanges|GetChangesAll|HasSession|Owns|ReadLAPSPassword|SQLAdmin|TrustedBy|WriteDACL|WriteOwner|AddAllowedToAct|AllowedToAct]->(t) WHERE m.objectsid ENDS WITH '-513' OR m.objectsid ENDS WITH '-515' OR m.objectsid ENDS WITH 'S-1-5-11' OR m.objectsid ENDS WITH 'S-1-1-0' RETURN p"
}
]
}
]
}