From 499b0a857ff3956816e0ad61f1d20a281ba5475f Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Thu, 5 Apr 2018 05:25:36 +0000 Subject: [PATCH] Add kernel_modules method --- lib/msf/core/post/linux/kernel.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/msf/core/post/linux/kernel.rb b/lib/msf/core/post/linux/kernel.rb index a635b1188e..722cca1d63 100644 --- a/lib/msf/core/post/linux/kernel.rb +++ b/lib/msf/core/post/linux/kernel.rb @@ -18,6 +18,17 @@ module Kernel raise 'Could not determine kernel version' end + # + # Returns the kernel modules + # + # @return [String] + # + def kernel_modules + cmd_exec('cat /proc/modules').to_s + rescue + raise 'Could not determine kernel modules' + end + # # Returns true if kernel and hardware supports Supervisor Mode Access Prevention (SMAP), false if not. #