Skip to content

Commit b80a5a0

Browse files
committed
Readd signing check for database site
1 parent c751ede commit b80a5a0

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

nxc/modules/sccm-recon6.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from impacket.dcerpc.v5.rpcrt import DCERPCException
66
from impacket.smbconnection import SessionError
77
from nxc.helpers.misc import CATEGORY
8+
from impacket.smbconnection import SMBConnection
89

910

1011
class NXCModule:
@@ -109,10 +110,26 @@ def EnumerateDB(self, dce, hRootKey):
109110
else:
110111
for subkey in subkeys:
111112
self.context.log.success(f"Site Database : {subkey}")
112-
if self.connection.conn.isSigningRequired():
113-
self.context.log.display(f" SMB signing: {self.connection.conn.isSigningRequired()}")
113+
114+
# Resolve site database name
115+
target = self.connection.resolver(subkey)
116+
if target is None:
117+
try:
118+
new_conn = SMBConnection(subkey, subkey)
119+
except Exception as e:
120+
self.context.log.fail(f"Connection error to {subkey}: {e}")
121+
continue
122+
else:
123+
try:
124+
new_conn = SMBConnection(subkey, target["host"])
125+
except Exception as e:
126+
self.context.log.fail(f"Connection error to {target['host']}: {e}")
127+
continue
128+
129+
if new_conn.isSigningRequired():
130+
self.context.log.display(f" SMB signing: {new_conn.isSigningRequired()}")
114131
else:
115-
self.context.log.highlight(f" SMB signing: {self.connection.conn.isSigningRequired()} - TAKEOVER-2")
132+
self.context.log.highlight(f" SMB signing: {new_conn.isSigningRequired()} - TAKEOVER-2")
116133

117134
def trigger_winreg(self, connection, context):
118135
# Original idea from https://twitter.com/splinter_code/status/1715876413474025704

0 commit comments

Comments
 (0)