Skip to content

Commit c64cf0a

Browse files
committed
Fix module options and rstrip to remove trailing null byte
1 parent 6a735c1 commit c64cf0a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

nxc/modules/ioxidresolver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class NXCModule:
1818

1919
def options(self, context, module_options):
2020
"""DIFFERENT show only ip address if different from target ip (Default: False)"""
21-
if module_options and "DIFFERENT" in module_options:
22-
self.pivot = module_options.get("DIFFERENT", "false").lower() in ("true", "1")
21+
self.pivot = module_options.get("DIFFERENT", "false").lower() in ["true", "1"]
22+
2323
def on_login(self, context, connection):
2424
try:
2525
rpctransport = transport.DCERPCTransportFactory(f"ncacn_ip_tcp:{connection.host}")
@@ -39,7 +39,7 @@ def on_login(self, context, connection):
3939
try:
4040
ip_address(NetworkAddr[:-1])
4141
if self.pivot:
42-
if NetworkAddr.rtrip() != connection.host.rtrip():
42+
if NetworkAddr.rstrip("\x00") != connection.host:
4343
context.log.highlight(f"Address: {NetworkAddr}")
4444
else:
4545
context.log.highlight(f"Address: {NetworkAddr}")

0 commit comments

Comments
 (0)