-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathqueries.json
80 lines (79 loc) · 2.04 KB
/
queries.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
{
"Queries":[
{
"Type": "Information Gathering",
"Title": "Database Links",
"Query": "SELECT srvname FROM master..sysservers"
},
{
"Type": "Information Gathering",
"Title": "Server Name",
"Query": "SELECT @@servername"
},
{
"Type": "Information Gathering",
"Title": "Version",
"Query": "SELECT @@version"
},
{
"Type": "Information Gathering",
"Title": "Current User",
"Query": "SELECT SUSER_SNAME()"
},
{
"Type": "Information Gathering",
"Title": "Current Role",
"Query": "SELECT IS_SRVROLEMEMBER('sysadmin')"
},
{
"Type": "Information Gathering",
"Title": "Current Database",
"Query": "SELECT db_name()"
},
{
"Type": "Information Gathering",
"Title": "List All Databases",
"Query": "SELECT name FROM master..sysdatabases"
},
{
"Type": "Information Gathering",
"Title": "List All Logins",
"Query": "SELECT * FROM sys.server_principals WHERE type_desc != 'SERVER_ROLE'"
},
{
"Type": "Information Gathering",
"Title": "List All Users for Database",
"Query": "SELECT * FROM sys.database_principals WHERE type_desc != 'DATABASE_ROLE'"
},
{
"Type": "Information Gathering",
"Title": "List All Sysadmins",
"Query": "SELECT name,type_desc,is_disabled FROM sys.server_principals WHERE IS_SRVROLEMEMBER ('sysadmin',name) = 1"
},
{
"Type": "Information Gathering",
"Title": "Effective Permissions for Server",
"Query": "SELECT * FROM fn_my_permissions(NULL, 'SERVER');"
},
{
"Type": "Information Gathering",
"Title": "Effective Permissions for Database",
"Query": "SELECT * FROM fn_my_permissions(NULL, 'DATABASE');"
},
{
"Type": "Information Gathering",
"Title": "Active User Tokens",
"Query": "SELECT * FROM sys.user_token"
},
{
"Type": "Information Gathering",
"Title": "Active Login Tokens",
"Query": "SELECT * FROM sys.login_token"
},
{
"Type": "Command execution",
"Title": "Command execution xp_cmdshell",
"Query": "EXEC xp_cmdshell 'whoami'"
}
]
}