-
Notifications
You must be signed in to change notification settings - Fork 16
/
customqueries.json
176 lines (176 loc) · 6.94 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
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
{
"queries":
[
{
"name": "Shortest Paths to High Value Targets from Owned Principles",
"queryList": [
{
"final": false,
"title": "Select a Domain",
"query": "MATCH (n:Domain) RETURN n.name ORDER BY n.name DESC"
},
{
"final": true,
"query":
"MATCH (n),(m),p=shortestPath((n)-[r:{}*1..]->(m)) WHERE m.domain={result} AND m.highvalue=true AND NOT m = n AND n.owned=true RETURN p",
"allowCollapse": true,
"endNode": "{}"
}
]
},
{
"name": "List Computers where DOMAIN USERS are Local Admin",
"queryList": [
{
"final": true,
"query":
"MATCH p=(m:Group)-[r:AdminTo]->(n:Computer) WHERE m.name STARTS WITH 'DOMAIN USERS' RETURN p",
"allowCollapse": true
}
]
},
{
"name": "Find Workstations where DOMAIN USERS can RDP To",
"queryList": [
{
"final": true,
"query":
"match p=(g:Group)-[:CanRDP]->(c:Computer) where g.name STARTS WITH 'DOMAIN USERS' AND NOT c.operatingsystem CONTAINS 'Server' return p",
"allowCollapse": true
}
]
},
{
"name": "Find Servers where DOMAIN USERS can RDP To",
"queryList": [
{
"final": true,
"query":
"match p=(g:Group)-[:CanRDP]->(c:Computer) where g.name STARTS WITH 'DOMAIN USERS' AND c.operatingsystem CONTAINS 'Server' return p",
"allowCollapse": true
}
]
},
{
"name": "ALL Path from DOMAIN USERS to High Value Targets",
"queryList": [
{
"final": true,
"query":
"MATCH (g:Group) WHERE g.name STARTS WITH 'DOMAIN USERS' MATCH (n {highvalue:true}),p=shortestPath((g)-[r*1..]->(n)) return p",
"allowCollapse": true
}
]
},
{
"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.name STARTS WITH 'DOMAIN USERS' RETURN p",
"allowCollapse": true
}
]
},
{
"name": "DA Account Sessions",
"queryList": [
{
"final": true,
"query":
"MATCH (n:User)-[:MemberOf]->(g:Group) WHERE g.name STARTS WITH 'DOMAIN ADMINS' MATCH p = (c:Computer)-[:HasSession]->(n) return p",
"allowCollapse": true
}
]
},
{
"name": "DA Account Sessions to NON DC",
"queryList": [
{
"final": true,
"query":
"MATCH (c:Computer)-[:MemberOf]->(t:Group) WHERE NOT t.name STARTS WITH 'DOMAIN CONTROLLERS' WITH c as NonDC MATCH p=(NonDC)-[:HasSession]->(n:User)-[:MemberOf]-> (g:Group WHERE g.name STARTS WITH 'DOMAIN ADMINS') RETURN p",
"allowCollapse": true
}
]
},
{
"name": "Kerberoastable Accounts member of High Value Group",
"queryList": [
{
"final": true,
"query":
"MATCH (n:User)-[r:MemberOf]->(g:Group) WHERE g.highvalue=true AND n.hasspn=true RETURN n, g, r",
"allowCollapse": true
}
]
},
{
"name": "List all Kerberoastable Accounts",
"queryList": [
{
"final": true,
"query":
"MATCH (n:User)WHERE n.hasspn=true RETURN n",
"allowCollapse": true
}
]
},
{
"name": "Top Ten Users with Most Sessions",
"queryList": [
{
"final": true,
"query":
"MATCH (n:User),(m:Computer), (n)<-[r:HasSession]-(m) WHERE NOT n.name STARTS WITH 'ANONYMOUS LOGON' AND NOT n.name='' WITH n, count(r) as rel_count order by rel_count desc LIMIT 10 MATCH p=(m)-[r:HasSession]->(n) RETURN p",
"allowCollapse": true
}
]
},
{
"name": "Top Ten Computers with Most Admins",
"queryList": [
{
"final": true,
"query":
"MATCH (n:User),(m:Computer), (n)-[r:AdminTo]->(m) WHERE NOT n.name STARTS WITH 'ANONYMOUS LOGON' AND NOT n.name='' WITH m, count(r) as rel_count order by rel_count desc LIMIT 10 MATCH p=(m)<-[r:AdminTo]-(n) RETURN p",
"allowCollapse": true
}
]
},
{
"name": "Top Ten Computers with Most Sessions",
"queryList": [
{
"final": true,
"query":
"MATCH (n:User),(m:Computer), (n)<-[r:HasSession]-(m) WHERE NOT n.name STARTS WITH 'ANONYMOUS LOGON' AND NOT n.name='' WITH m, count(r) as rel_count order by rel_count desc LIMIT 10 MATCH p=(m)-[r:HasSession]->(n) RETURN n,r,m",
"allowCollapse": true
}
]
},
{
"name": "Top Ten Computers with Most Admin Sessions",
"queryList": [
{
"final": true,
"query":
"MATCH (n:User),(m:Computer), (n)<-[r:HasSession]-(m) WHERE NOT n.name STARTS WITH 'ANONYMOUS LOGON' AND NOT n.name='' WITH m, count(r) as rel_count order by rel_count desc LIMIT 10 MATCH p=(m)-[r:HasSession]->(n) RETURN n,r,m",
"allowCollapse": true
}
]
},
{
"name": "Top Ten Users with Most Local Admin Rights",
"queryList": [
{
"final": true,
"query":
"MATCH (n:User),(m:Computer), (n)-[r:AdminTo]->(m) WHERE NOT n.name STARTS WITH 'ANONYMOUS LOGON' AND NOT n.name='' WITH n, count(r) as rel_count order by rel_count desc LIMIT 10 MATCH p=(m)<-[r:AdminTo]-(n) RETURN p",
"allowCollapse": true
}
]
}
]
}