From 03f3bf0f2f68cef4538237bdda6f6df0ca9c8343 Mon Sep 17 00:00:00 2001 From: Spencer McIntyre Date: Thu, 4 Jan 2024 17:21:29 -0500 Subject: [PATCH] Readd the #sysinfo method --- lib/msf/core/session_compatibility.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/msf/core/session_compatibility.rb b/lib/msf/core/session_compatibility.rb index bd02ecd149bb..c57269f2a286 100644 --- a/lib/msf/core/session_compatibility.rb +++ b/lib/msf/core/session_compatibility.rb @@ -101,6 +101,19 @@ def session_display_info alias :client :session + # + # Cached sysinfo, returns nil for non-meterpreter sessions + # + # @return [Hash,nil] + def sysinfo + begin + @sysinfo ||= session.sys.config.sysinfo + rescue NoMethodError + @sysinfo = nil + end + @sysinfo + end + # # Can be overridden by individual modules to add new commands #