mirror of
https://github.com/lgandx/Responder.git
synced 2025-12-07 21:21:34 +00:00
Fix various Python 3.12 SyntaxWarning
```
/usr/share/responder/tools/MultiRelay/RelayMultiCore.py:1957: SyntaxWarning: invalid escape sequence '\p'
Command = "c:\\Windows\\Temp\\"+FileName+" \"rpc::server /protseq:ncacn_np /endpoint:\pipe\\"+NamedPipe+" /guid:{"+DisplayGUID+"} /noreg\" service::me exit"
/usr/share/responder/tools/MultiRelay/impacket-dev/impacket/dcerpc/v5/transport.py:33: SyntaxWarning: invalid escape sequence '\['
+'([^\[]*)' # Network Address (opt.)
/usr/share/responder/tools/MultiRelay/impacket-dev/impacket/dcerpc/v5/transport.py:34: SyntaxWarning: invalid escape sequence '\['
+'(?:\[([^\]]*)\])?') # Endpoint and options (opt.)
/usr/share/responder/tools/MultiRelay/impacket-dev/impacket/hresult_errors.py:197: SyntaxWarning: invalid escape sequence '\<'
0x80004017: ("CO_E_RUNAS_SYNTAX", "A RunAs specification must be <domain name>\<user name> or simply <user name>."),
/usr/share/responder/tools/MultiRelay/impacket-dev/impacket/hresult_errors.py:285: SyntaxWarning: invalid escape sequence '\<'
0x8001012C: ("CO_E_WRONGTRUSTEENAMESYNTAX", "One of the trustee strings provided by the user did not conform to the <Domain>\<Name> syntax and it was not the *\" string\"."),
/usr/share/responder/tools/MultiRelay/impacket-dev/impacket/uuid.py:41: SyntaxWarning: invalid escape sequence '\d'
matches = re.match('([\dA-Fa-f]{8})-([\dA-Fa-f]{4})-([\dA-Fa-f]{4})-([\dA-Fa-f]{4})-([\dA-Fa-f]{4})([\dA-Fa-f]{8})', uuid)
/usr/share/responder/tools/MultiRelay/impacket-dev/impacket/uuid.py:71: SyntaxWarning: invalid escape sequence '\.'
g = re.search("([A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}).*?([0-9]{1,5}\.[0-9]{1,5})",s+" 1.0")
```
This commit is contained in:
@@ -38,7 +38,7 @@ def string_to_bin(uuid):
|
||||
|
||||
# If a UUID in the 00000000-0000-0000-0000-000000000000 format, parse it as Variant 2 UUID
|
||||
# The first three components of the UUID are little-endian, and the last two are big-endian
|
||||
matches = re.match('([\dA-Fa-f]{8})-([\dA-Fa-f]{4})-([\dA-Fa-f]{4})-([\dA-Fa-f]{4})-([\dA-Fa-f]{4})([\dA-Fa-f]{8})', uuid)
|
||||
matches = re.match(r'([\dA-Fa-f]{8})-([\dA-Fa-f]{4})-([\dA-Fa-f]{4})-([\dA-Fa-f]{4})-([\dA-Fa-f]{4})([\dA-Fa-f]{8})', uuid)
|
||||
(uuid1, uuid2, uuid3, uuid4, uuid5, uuid6) = [int(x, 16) for x in matches.groups()]
|
||||
uuid = pack('<LHH', uuid1, uuid2, uuid3)
|
||||
uuid += pack('>HHL', uuid4, uuid5, uuid6)
|
||||
@@ -68,7 +68,7 @@ def bin_to_uuidtup(bin):
|
||||
# "10000000-2000-3000-4000-500000000000 v 3.0" returns ('00000000-0000-0000-0000-000000000000','3.0')
|
||||
# "10000000-2000-3000-4000-500000000000" returns ('00000000-0000-0000-0000-000000000000','1.0')
|
||||
def string_to_uuidtup(s):
|
||||
g = re.search("([A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}).*?([0-9]{1,5}\.[0-9]{1,5})",s+" 1.0")
|
||||
g = re.search(r"([A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}).*?([0-9]{1,5}\.[0-9]{1,5})",s+" 1.0")
|
||||
if g:
|
||||
(u,v) = g.groups()
|
||||
return (u,v)
|
||||
|
||||
Reference in New Issue
Block a user