feat(cmedb): add additional fields to smb db

main
Marshall Hallenbeck 2023-03-03 09:50:28 -05:00 committed by Marshall Hallenbeck
parent 50a74951c8
commit 5e9ea346fd
2 changed files with 11 additions and 4 deletions

View File

@ -19,7 +19,10 @@ class database:
"os" text,
"dc" boolean,
"smbv1" boolean,
"signing" boolean
"signing" boolean,
"spooler" boolean,
"zerologon" boolean,
"petitpotam" boolean
)''')
# type = hash, plaintext
@ -171,7 +174,7 @@ class database:
return results
#pull/545
def add_computer(self, ip, hostname, domain, os, smbv1, signing, dc=None):
def add_computer(self, ip, hostname, domain, os, smbv1, signing=None, spooler=None, zerologon=None, petitpotam=None, dc=None):
"""
Check if this host has already been added to the database, if not add it in.
"""

View File

@ -43,13 +43,17 @@ class navigator(DatabaseNavigator):
#pull/545
def display_hosts(self, hosts):
data = [['HostID', 'Admins', 'IP', 'Hostname', 'Domain', 'OS', 'SMBv1', 'Signing']]
data = [['HostID', 'Admins', 'IP', 'Hostname', 'Domain', 'OS', 'SMBv1', 'Signing', 'Spooler', 'Zerologon', 'PetitPotam']]
for host in hosts:
hostID = host[0]
ip = host[1]
hostname = host[2]
domain = host[3]
spooler = host[5]
zerologon = host[6]
petitpotam = host[7]
try:
os = host[4].decode()
except:
@ -58,7 +62,7 @@ class navigator(DatabaseNavigator):
smbv1 = host[6]
signing = host[7]
links = self.db.get_admin_relations(hostID=hostID)
data.append([hostID, str(len(links)) + ' Cred(s)', ip, hostname, domain, os, smbv1, signing])
data.append([hostID, str(len(links)) + ' Cred(s)', ip, hostname, domain, os, smbv1, signing, spooler, zerologon, petitpotam])
except:
links = self.db.get_admin_relations(hostID=hostID)
data.append([hostID, str(len(links)) + ' Cred(s)', ip, hostname, domain, os])