Skip to content

Commit 343a0d7

Browse files
committed
Delete admin check
1 parent 7164c4e commit 343a0d7

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

modules/auxiliary/admin/mssql/mssql_enum_domain_accounts.rb

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@ def run
4747
return
4848
end
4949

50-
# Query for sysadmin status
51-
print_status("Checking if #{datastore['USERNAME']} has the sysadmin role...")
52-
user_status = check_sysadmin
53-
54-
# Check if user has sysadmin role
55-
if user_status == 1
56-
print_good("#{datastore['USERNAME']} is a sysadmin.")
57-
else
58-
print_status("#{datastore['USERNAME']} is NOT a sysadmin.")
59-
end
60-
6150
# Get the server name
6251
sql_server_name = get_sql_server_name
6352
print_status("SQL Server Name: #{sql_server_name}")
@@ -138,23 +127,6 @@ def run
138127
print_status("Query results have been saved to: #{path}")
139128
end
140129

141-
# Checks if user is a sysadmin
142-
def check_sysadmin
143-
144-
# Setup query to check for sysadmin
145-
sql = "select is_srvrolemember('sysadmin') as IsSysAdmin"
146-
147-
# Run query
148-
result = mssql_query(sql)
149-
150-
# Parse query results
151-
parse_results = result[:rows]
152-
status = parse_results[0][0]
153-
154-
# Return status
155-
return status
156-
end
157-
158130
# Get list of windows accounts,groups,and computer accounts
159131
def get_win_domain_users(windows_domain_sid)
160132

0 commit comments

Comments
 (0)