Skip to content

Commit 77e1f88

Browse files
authored
Merge pull request Pennyw0rth#380 from nikaiw/add_ioxidresolver_option
add an option to ioxidresolver to get only IP values different than targets
2 parents b387260 + c64cf0a commit 77e1f88

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

nxc/modules/ioxidresolver.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class NXCModule:
1717
multiple_hosts = True
1818

1919
def options(self, context, module_options):
20-
"""No module options"""
20+
"""DIFFERENT show only ip address if different from target ip (Default: False)"""
21+
self.pivot = module_options.get("DIFFERENT", "false").lower() in ["true", "1"]
2122

2223
def on_login(self, context, connection):
2324
try:
@@ -37,7 +38,11 @@ def on_login(self, context, connection):
3738
NetworkAddr = binding["aNetworkAddr"]
3839
try:
3940
ip_address(NetworkAddr[:-1])
40-
context.log.highlight(f"Address: {NetworkAddr}")
41+
if self.pivot:
42+
if NetworkAddr.rstrip("\x00") != connection.host:
43+
context.log.highlight(f"Address: {NetworkAddr}")
44+
else:
45+
context.log.highlight(f"Address: {NetworkAddr}")
4146
except Exception as e:
4247
context.log.debug(e)
4348
except DCERPCException as e:

0 commit comments

Comments
 (0)