From 4d77c17e8fd4c6cac35a5cc9c5ab9d713cb35405 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Tue, 17 Sep 2024 14:01:04 +0700 Subject: [PATCH] Fix various Python 3.12 SyntaxWarning --- empire/server/data/agent/ironpython_agent.py | 2 +- .../module_source/python/privesc/linuxprivchecker.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/empire/server/data/agent/ironpython_agent.py b/empire/server/data/agent/ironpython_agent.py index 13fdcb04c..15636ea82 100644 --- a/empire/server/data/agent/ironpython_agent.py +++ b/empire/server/data/agent/ironpython_agent.py @@ -1393,7 +1393,7 @@ def run_command(self, command, cmdargs=None): if (-not $($o.User)) { $o = 'N/A' } else { - $o = "$($o.Domain)\$($o.User)" + $o = "$($o.Domain)\\$($o.User)" } } catch { $o = 'N/A' diff --git a/empire/server/data/module_source/python/privesc/linuxprivchecker.py b/empire/server/data/module_source/python/privesc/linuxprivchecker.py index 3b2721966..cf4b8648b 100644 --- a/empire/server/data/module_source/python/privesc/linuxprivchecker.py +++ b/empire/server/data/module_source/python/privesc/linuxprivchecker.py @@ -333,22 +333,22 @@ def search_file_perms(): fdperms = { "WWDIRSROOT": { - "cmd": "find / \( -wholename '/home/homedir*' -prune \) -o \( -type d -perm -0002 \) -exec ls -ld '{}' ';' 2>/dev/null | grep root", + "cmd": r"find / \( -wholename '/home/homedir*' -prune \) -o \( -type d -perm -0002 \) -exec ls -ld '{}' ';' 2>/dev/null | grep root", "msg": "World Writeable Directories for User/Group 'Root'", "results": [], }, "WWDIRS": { - "cmd": "find / \( -wholename '/home/homedir*' -prune \) -o \( -type d -perm -0002 \) -exec ls -ld '{}' ';' 2>/dev/null | grep -v root", + "cmd": r"find / \( -wholename '/home/homedir*' -prune \) -o \( -type d -perm -0002 \) -exec ls -ld '{}' ';' 2>/dev/null | grep -v root", "msg": "World Writeable Directories for Users other than Root", "results": [], }, "WWFILES": { - "cmd": "find / \( -wholename '/home/homedir/*' -prune -o -wholename '/proc/*' -prune \) -o \( -type f -perm -0002 \) -exec ls -l '{}' ';' 2>/dev/null", + "cmd": r"find / \( -wholename '/home/homedir/*' -prune -o -wholename '/proc/*' -prune \) -o \( -type f -perm -0002 \) -exec ls -l '{}' ';' 2>/dev/null", "msg": "World Writable Files", "results": [], }, "SUID": { - "cmd": "find / \( -perm -2000 -o -perm -4000 \) -exec ls -ld {} \; 2>/dev/null", + "cmd": r"find / \( -perm -2000 -o -perm -4000 \) -exec ls -ld {} \; 2>/dev/null", "msg": "SUID/SGID Files and Directories", "results": [], }, @@ -1171,7 +1171,7 @@ def write(self, message): bigline = "=======================================================================================" print(bigline) print( - """ + r""" __ _ ____ _ ________ __ / / (_)___ __ ___ __/ __ \_____(_) __/ ____/ /_ ___ _____/ /_____ _____ / / / / __ \/ / / / |/_/ /_/ / ___/ / | / / / / __ \/ _ \/ ___/ //_/ _ \/ ___/