Skip to content

Commit 4591de4

Browse files
committed
last changes for persistence bash module after peer review
1 parent fa9d58b commit 4591de4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

documentation/modules/exploit/linux/persistence/bash_profile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Verified on Ubuntu 22.04 and 18.04 desktop with Gnome
1010

1111
1. Start `msfconsole`
1212
2. Get a Meterpreter session
13-
3. `use exploit/linux/local/bash_profile_persistence`
13+
3. `use exploit/linux/persistence/bash_profile`
1414
4. `set SESSION [SESSION]`
1515
5. `run`
1616
6. On victim, open a new Bash terminal

modules/exploits/linux/persistence/bash_profile.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def profile_path
8383
end
8484

8585
def check
86+
print_warning('Payloads in /tmp will only last until reboot, you want to choose elsewhere.') if datastore['WritableDir'].start_with?('/tmp')
8687
ppath = profile_path
8788

8889
# check that target Bash profile file exists
@@ -125,7 +126,7 @@ def install_persistence
125126
vprint_status('Created Bash profile persistence')
126127
print_good('Payload will be triggered when target opens a Bash terminal')
127128

128-
@clean_up_rc << "rm #{payload_path}\n"
129+
@clean_up_rc = "rm #{payload_path}\n"
129130
@clean_up_rc << "upload #{backup_profile_path} #{ppath}"
130131
end
131132
end

0 commit comments

Comments
 (0)