def netcat(self): if os.path.exists("/bin/nc"): admin.AdminExec("apt-get purge netcat-openbsd -y") admin.AdminExec("apt-get purge netcat-traditional -y") #One may fail, that's alright! admin.AdminExec("apt-get purge netcat -y") else: return False
def disable(self): print("Disabling Guest Account...") if os.path.exists("/usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf"): admin.AdminExec( 'echo "allow-guest=false" >> /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf' ) print("Guests are not welcome!")
def enable(self, rp): UserPasswd = rp print('Enabling Universal Firewall...') admin.AdminExec("ufw enable", UserPasswd) print('Firewall Enabled!') tkMessageBox.showinfo(title="SecureMe - Firewall", message="Successfully enabled the Firewall!")
def disable(self, rp): UserPasswd = rp print('Disabling Universal Firewall...') admin.AdminExec("ufw disable", UserPasswd) print('Firewall Disabled!') tkMessageBox.showinfo(title="SecureMe - Updated", message="Successfully disabled the Firewall!")
def updateall(self, enc): UserPasswd = enc.decrypt() print("Completely upgrading all packages...") admin.AdminExec('apt-get dist-upgrade -y', UserPasswd) tkMessageBox.showinfo( title="SecureMe - Updated", message="Successfully Updated the packages on your system!")
def RmMediaFiles(): for root, dirs, files in os.walk("/"): for file in files: if file.endswith("*.mp3"): admin.AdminExec("chown root " + os.path.join(root, file), UserPasswd) admin.AdminExec("rm " + os.path.join(root, file), UserPasswd) if file.endswith("*.m4a"): admin.AdminExec("chown root " + os.path.join(root, file), UserPasswd) admin.AdminExec("rm " + os.path.join(root, file), UserPasswd) if file.endswith("*.mov"): admin.AdminExec("chown root " + os.path.join(root, file), UserPasswd) admin.AdminExec("rm " + os.path.join(root, file), UserPasswd) if file.endswith("*.mp4"): admin.AdminExec("chown root " + os.path.join(root, file), UserPasswd) admin.AdminExec("rm " + os.path.join(root, file), UserPasswd) if file.endswith("*.jpeg"): admin.AdminExec("chown root " + os.path.join(root, file), UserPasswd) admin.AdminExec("rm " + os.path.join(root, file), UserPasswd)
def install(self): admin.AdminExec("apt-get install rkhunter -y", UserPasswd)
def update(self): admin.AdminExec("rkhunter --update", UserPasswd)
def install(self): admin.AdminExec("apt-get install clamav -y", UserPasswd)
def update(self): admin.AdminExec("freshclam", UserPasswd)
def blockport(self, port): admin.AdminExec("ufw deny port " + port, UserPassword) print("Blocking port: " + port)
def blockip(self, ipaddress): admin.AdminExec("ufw deny from " + ipaddress, UserPassword) print("Blocking IP Address: " + ipaddress)
def addtogroups(self, user, groups): #Here 'groups' is a list admin.AdminExec('usermod -a -G ' + str(groups) + ' ' + user, UserPasswd)
def stop(self, service): admin.AdminExec("service " + service + " stop", UserPasswd)
def upgrade(self, enc): UserPasswd = enc.decrypt() print("Upgrading new packages...") admin.AdminExec('apt-get upgrade -y', UserPasswd) tkMessageBox.showinfo(title="SecureMe - Updated", message="Successfully Upgraded the system!")
def adduser(self, username, password): admin.AdminExec('useradd ' + username + ' -p ' + password, UserPasswd)
def reboot(self): admin.AdminExec("reboot", UserPasswd)
def shutdown(self, time): admin.AdminExec("shutdown -h " + time, UserPasswd)
def telnet(self): if os.path.exists("/usr/bin/telnet"): admin.AdminExec("apt-get purge telnet -y") else: return False
def scan(self): admin.AdminExec("yes | rkhunter --check", UserPasswd)
def addtogroup(self, user, group): admin.AdminExec('usermod -a -G ' + group + ' ' + user, UserPasswd)
def delete(self, filetorm): admin.AdminExec("rm " + filetorm, UserPasswd)
def start(self, service): admin.AdminExec("service " + service + " start", UserPasswd)
def copy(self, source, destination): admin.AdminExec("cp " + source + " " + destination, UserPasswd)
def deluser(self, user): admin.AdminExec("deluser -r " + user, UserPasswd)