Unremovable Files in UNIX
Let's say you have put your super malicious backdoor in a server, and you did not want anyone to remove this backdoor file. How to do this? Just make it immutable in file-system level :v
1
$ touch u-cant-rm-this
2
3
$ ls -l
4
total 0
5
-rw-r--r-- 1 root root 0 Mar 14 09:39 u-cant-rm-this
6
7
$ chattr +i u-cant-rm-this
8
9
$ ls -l
10
total 0
11
-rw-r--r-- 1 root root 0 Mar 14 09:39 u-cant-rm-this
12
13
$ rm u-cant-rm-this
14
rm: cannot remove 'u-cant-rm-this': Operation not permitted
Copied!
Boom!
Last modified 5mo ago
Copy link