We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 292142f commit 76d3be6Copy full SHA for 76d3be6
IP-Changer.py
@@ -90,6 +90,11 @@ def main():
90
sys.exit("\033[1;91m[-] Invalid choice.\033[0m")
91
try:
92
with tarfile.open(filename, "r:gz") as tar:
93
+ members = tar.getmembers()
94
+ for member in members:
95
+ # Just in case path traversal attack protection
96
+ if not os.path.commonpath([os.path.abspath(os.path.join(tor_path, member.name))]).startswith(os.path.abspath(tor_path)):
97
+ raise tarfile.TarError(f"Security warning: File '{member.name}' attempts to extract outside '{tor_path}'")
98
tar.extractall(f"{extract_path}\\Tor Expert Bundle", filter='fully_trusted')
99
os.remove(filename)
100
print(f"\033[1;92m[+] Tor has been successfully extracted to the '{extract_path}\\Tor Expert Bundle'\033[0m")
0 commit comments