psexec_loggedin_users: NoMethodError. undefined method `each_line' for false

This commit is contained in:
g0t mi1k
2026-04-22 05:16:08 +01:00
parent a173ea15fa
commit 2e58eb1207
@@ -80,6 +80,7 @@ class MetasploitModule < Msf::Auxiliary
command = "#{cmd} /C echo reg.exe QUERY HKU ^> %SYSTEMDRIVE%#{text} > #{bat} & #{cmd} /C start cmd.exe /C #{bat}"
out = psexec(command)
output = get_output(ip, smbshare, text)
return nil unless output
cleanout = Array.new
output.each_line { |line| cleanout << line.chomp if line.include?("HKEY") && line.split("-").size == 8 && !line.split("-")[7].include?("_") }
return cleanout