Replace `cat` with Ruby's `read_file`

Thanks to wvu-r7 for the comment
bug/bundler_fix
jvoisin 2016-09-28 23:22:19 +02:00
parent dbb2abeda1
commit b46073b34a
1 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ class MetasploitModule < Msf::Exploit::Local
# x_tables 36864 2 iptable_filter,ip_tables, Live 0x0000000000000000 # x_tables 36864 2 iptable_filter,ip_tables, Live 0x0000000000000000
vprint_status('Checking if ip_tables is loaded in kernel') vprint_status('Checking if ip_tables is loaded in kernel')
if target.name == "Ubuntu" if target.name == "Ubuntu"
iptables = cmd_exec('cat /proc/modules') iptables = read_file('/proc/modules')
if iptables.include?('ip_tables') if iptables.include?('ip_tables')
vprint_good('ip_tables.ko is loaded') vprint_good('ip_tables.ko is loaded')
else else
@ -75,7 +75,7 @@ class MetasploitModule < Msf::Exploit::Local
end end
return iptables.include?('ip_tables') return iptables.include?('ip_tables')
elsif target.name == "Fedora" elsif target.name == "Fedora"
iptables = cmd_exec('cat /proc/modules') iptables = read_file('/proc/modules')
if iptables.include?('iptable_raw') if iptables.include?('iptable_raw')
vprint_good('iptable_raw is loaded') vprint_good('iptable_raw is loaded')
else else