@@ -41,13 +41,13 @@ def initialize(info={})
41
41
] , self . class )
42
42
end
43
43
44
- def run ( )
44
+ def run
45
45
if is_system?
46
46
# running as SYSTEM and will not pass any network credentials
47
47
print_error "Running as SYSTEM, module should be run with USER level rights"
48
48
return
49
49
else
50
- @ adv = client . railgun . advapi32
50
+ adv = client . railgun . advapi32
51
51
52
52
# Get domain and domain controller if options left blank
53
53
if datastore [ 'DOMAIN' ] . nil?
@@ -61,7 +61,7 @@ def run()
61
61
# Uses DC which applied policy since it would be a DC this device normally talks to
62
62
cmd = "gpresult /SCOPE COMPUTER"
63
63
# 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 / )
65
65
cmd << " /R"
66
66
end
67
67
res = run_cmd ( cmd )
@@ -78,7 +78,7 @@ def run()
78
78
end
79
79
end
80
80
81
- # main contrl method
81
+ # main control method
82
82
def run_host ( ip )
83
83
connect ( ip )
84
84
end
@@ -182,7 +182,7 @@ def enum_groups(user)
182
182
def connect(host)
183
183
user = client.sys.config.getuid
184
184
# 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
186
186
187
187
if(manag["return"] != 0) # we have admin rights
188
188
result = "#{ host . ljust ( 16 ) } #{ user } - Local admin found\n"
@@ -195,7 +195,7 @@ def connect(host)
195
195
end
196
196
197
197
# close the handle if connection was made
198
- @ adv.CloseServiceHandle(manag["return"])
198
+ adv.CloseServiceHandle(manag["return"])
199
199
# Append data to loot table within database
200
200
db_loot(host, user, "localadmin.user")
201
201
print_good(result.chomp("\n")) unless result.nil?
@@ -246,4 +246,4 @@ def db_loot(host, user, type)
246
246
)
247
247
end
248
248
end
249
- end
249
+ end
0 commit comments