BC-SECURITY / Empire

Empire is a post-exploitation and adversary emulation framework that is used to aid Red Teams and Penetration Testers.
https://bc-security.gitbook.io/empire-wiki/
BSD 3-Clause "New" or "Revised" License
4.26k stars 581 forks source link

Fix various Python 3.12 SyntaxWarning #748

Closed elboulangero closed 2 months ago

elboulangero commented 2 months ago

Python 3.12 is getting more chatty about some syntax warnings:

/usr/share/powershell-empire/empire/server/data/agent/ironpython_agent.py:1388: SyntaxWarning: invalid escape sequence '\$'
  """
/usr/share/powershell-empire/empire/server/data/module_source/python/privesc/linuxprivchecker.py:336: SyntaxWarning: invalid e
scape sequence '\('
  "cmd": "find / \( -wholename '/home/homedir*' -prune \) -o \( -type d -perm -0002 \) -exec ls -ld '{}' ';' 2>/dev/null | gre
p root",
/usr/share/powershell-empire/empire/server/data/module_source/python/privesc/linuxprivchecker.py:341: SyntaxWarning: invalid e
scape sequence '\('
  "cmd": "find / \( -wholename '/home/homedir*' -prune \) -o \( -type d -perm -0002 \) -exec ls -ld '{}' ';' 2>/dev/null | gre
p -v root",
/usr/share/powershell-empire/empire/server/data/module_source/python/privesc/linuxprivchecker.py:346: SyntaxWarning: invalid e
scape sequence '\('
  "cmd": "find / \( -wholename '/home/homedir/*' -prune -o -wholename '/proc/*' -prune \) -o \( -type f -perm -0002 \) -exec l
s -l '{}' ';' 2>/dev/null",
/usr/share/powershell-empire/empire/server/data/module_source/python/privesc/linuxprivchecker.py:351: SyntaxWarning: invalid e
scape sequence '\('
  "cmd": "find / \( -perm -2000 -o -perm -4000 \) -exec ls -ld {} \; 2>/dev/null",
/usr/share/powershell-empire/empire/server/data/module_source/python/privesc/linuxprivchecker.py:1174: SyntaxWarning: invalid 
escape sequence '\_'
  """
vinnybod commented 2 months ago

@elboulangero lgtm, thanks! Can you please add an entry to the changelog and then I will merge it.

elboulangero commented 2 months ago

Done! Thanks for the quick feedback