You've already forked hackingtool
mirror of
https://github.com/Z4nzu/hackingtool.git
synced 2026-06-09 00:16:18 +02:00
Phase 13 (cont): Final os.system cleanup
- anonsurf.py: os.system("sudo anonsurf stop") → subprocess.run list form
- tool_manager.py: os.system(f"{priv}{cmd}") → subprocess.run(shell=True)
(shell=True justified: cmd is from hardcoded PACKAGE_UPDATE_CMDS dict, not user input)
This commit is contained in:
+2
-1
@@ -24,8 +24,9 @@ class AnonymouslySurf(HackingTool):
|
||||
super().__init__([("Stop", self.stop)])
|
||||
|
||||
def stop(self):
|
||||
import subprocess
|
||||
console.print("[bold magenta]Stopping Anonsurf...[/bold magenta]")
|
||||
os.system("sudo anonsurf stop")
|
||||
subprocess.run(["sudo", "anonsurf", "stop"])
|
||||
|
||||
|
||||
class Multitor(HackingTool):
|
||||
|
||||
@@ -25,7 +25,8 @@ class UpdateTool(HackingTool):
|
||||
cmd = PACKAGE_UPDATE_CMDS.get(mgr)
|
||||
if cmd:
|
||||
priv = "" if CURRENT_OS.system == "macos" else "sudo "
|
||||
os.system(f"{priv}{cmd}")
|
||||
# shell=True needed — cmd contains && chains; strings are hardcoded, not user input
|
||||
subprocess.run(f"{priv}{cmd}", shell=True, check=False)
|
||||
else:
|
||||
console.print("[warning]Unknown package manager — update manually.[/warning]")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user