Skip to content

Commit c70f1e3

Browse files
committed
modified local_admin_search_enum.rb
1 parent 9833039 commit c70f1e3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

modules/post/windows/gather/local_admin_search_enum.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ def initialize(info={})
4141
], self.class)
4242
end
4343

44-
def run()
44+
def run
4545
if is_system?
4646
# running as SYSTEM and will not pass any network credentials
4747
print_error "Running as SYSTEM, module should be run with USER level rights"
4848
return
4949
else
50-
@adv = client.railgun.advapi32
50+
adv = client.railgun.advapi32
5151

5252
# Get domain and domain controller if options left blank
5353
if datastore['DOMAIN'].nil?
@@ -61,7 +61,7 @@ def run()
6161
# Uses DC which applied policy since it would be a DC this device normally talks to
6262
cmd = "gpresult /SCOPE COMPUTER"
6363
# If Vista/2008 or later add /R
64-
if (client.sys.config.sysinfo['OS'] =~ /Build [6-9]\d\d\d/)
64+
if (sysinfo['OS'] =~ /Build [6-9]\d\d\d/)
6565
cmd << " /R"
6666
end
6767
res = run_cmd(cmd)
@@ -78,7 +78,7 @@ def run()
7878
end
7979
end
8080

81-
# main contrl method
81+
# main control method
8282
def run_host(ip)
8383
connect(ip)
8484
end
@@ -182,7 +182,7 @@ def enum_groups(user)
182182
def connect(host)
183183
user = client.sys.config.getuid
184184
# use railgun and OpenSCManagerA api to connect to remote host
185-
manag = @adv.OpenSCManagerA("\\\\#{host}", nil, 0xF003F) # SC_MANAGER_ALL_ACCESS
185+
manag = adv.OpenSCManagerA("\\\\#{host}", nil, 0xF003F) # SC_MANAGER_ALL_ACCESS
186186
187187
if(manag["return"] != 0) # we have admin rights
188188
result = "#{host.ljust(16)} #{user} - Local admin found\n"
@@ -195,7 +195,7 @@ def connect(host)
195195
end
196196
197197
# close the handle if connection was made
198-
@adv.CloseServiceHandle(manag["return"])
198+
adv.CloseServiceHandle(manag["return"])
199199
# Append data to loot table within database
200200
db_loot(host, user, "localadmin.user")
201201
print_good(result.chomp("\n")) unless result.nil?
@@ -246,4 +246,4 @@ def db_loot(host, user, type)
246246
)
247247
end
248248
end
249-
end
249+
end

0 commit comments

Comments
 (0)