1
mirror of https://github.com/carlospolop/PEASS-ng synced 2024-11-20 12:39:21 +01:00

Fix Timeout parameter in Peass Metasploit module

time_out argument of cmd_exec function must be integer

When user sets its own timeout, module execution stops, because there is no conversion of string to int.
This commit is contained in:
Max Symonenko 2023-06-24 10:15:40 +03:00 committed by GitHub
parent 898b29b0fa
commit 36523f520f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -191,14 +191,14 @@ class MetasploitModule < Msf::Post
cmd_utf16le = cmd.encode("utf-16le")
cmd_utf16le_b64 = Base64.encode64(cmd_utf16le).gsub(/\r?\n/, "")
tmpout << cmd_exec("powershell.exe", args="-ep bypass -WindowStyle hidden -nop -enc #{cmd_utf16le_b64}", time_out=datastore["TIMEOUT"])
tmpout << cmd_exec("powershell.exe", args="-ep bypass -WindowStyle hidden -nop -enc #{cmd_utf16le_b64}", time_out=datastore["TIMEOUT"].to_i)
# If unix, then, suppose linpeas was loaded
else
cmd += "| #{decode_linpeass_cmd}"
cmd += "| sh -s -- #{datastore['PARAMETERS']}"
cmd += last_cmd
tmpout << cmd_exec(cmd, args=nil, time_out=datastore["TIMEOUT"])
tmpout << cmd_exec(cmd, args=nil, time_out=datastore["TIMEOUT"].to_i)
end
print "\n#{tmpout}\n\n"