Fix: LinPEASS doesn't run via metasploit module

If you set "WINPEASS" to "false" - it's a string, and therefore "true". So it would run WinPEASS anyway.

The fix converts value of the variable to string before comparing it.
This commit is contained in:
Max K.
2025-10-28 13:19:03 +02:00
committed by GitHub
parent d75525ebbc
commit 6877f39193

View File

@@ -270,7 +270,7 @@ class MetasploitModule < Msf::Post
if datastore['CUSTOM_URL'] != "" if datastore['CUSTOM_URL'] != ""
url_peass = datastore['CUSTOM_URL'] url_peass = datastore['CUSTOM_URL']
else else
url_peass = datastore['WINPEASS'] ? "https://github.com/peass-ng/PEASS-ng/releases/latest/download/winPEASany_ofs.exe" : "https://github.com/peass-ng/PEASS-ng/releases/latest/download/linpeas.sh" url_peass = datastore['WINPEASS'].to_s.strip.downcase == 'true' ? "https://github.com/peass-ng/PEASS-ng/releases/latest/download/winPEASany_ofs.exe" : "https://github.com/peass-ng/PEASS-ng/releases/latest/download/linpeas.sh"
end end
# If URL is set, check if it is a valid URL or local file # If URL is set, check if it is a valid URL or local file
if url_peass.include?("http://") || url_peass.include?("https://") if url_peass.include?("http://") || url_peass.include?("https://")