Skip to content

Commit 155553a

Browse files
committed
revert db changes
1 parent f3d5f8d commit 155553a

3 files changed

Lines changed: 11 additions & 36 deletions

File tree

nxc/protocols/ldap.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,7 @@ def enum_host_info(self):
326326
self.host,
327327
self.hostname,
328328
self.domain,
329-
self.server_os,
330-
self.signing_required,
331-
self.cbt_status
329+
self.server_os
332330
)
333331
except Exception as e:
334332
self.logger.debug(f"Error adding host {self.host} into db: {e!s}")

nxc/protocols/ldap/database.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ def db_schema(db_conn):
3838
"ip" text,
3939
"hostname" text,
4040
"domain" text,
41-
"os" text,
42-
"signing" boolean,
43-
"cbt_status" text
41+
"os" text
4442
)"""
4543
)
4644

@@ -59,7 +57,7 @@ def reflect_tables(self):
5957
)
6058
sys.exit()
6159

62-
def add_host(self, ip, hostname, domain, os, signing=None, cbt_status=None):
60+
def add_host(self, ip, hostname, domain, os):
6361
"""Check if this host has already been added to the database, if not, add it in."""
6462
hosts = []
6563
updated_ids = []
@@ -73,9 +71,7 @@ def add_host(self, ip, hostname, domain, os, signing=None, cbt_status=None):
7371
"ip": ip,
7472
"hostname": hostname,
7573
"domain": domain,
76-
"os": os,
77-
"signing": signing,
78-
"cbt_status": cbt_status
74+
"os": os
7975
}
8076
hosts = [new_host]
8177
# update existing hosts data
@@ -89,12 +85,6 @@ def add_host(self, ip, hostname, domain, os, signing=None, cbt_status=None):
8985
host_data["hostname"] = hostname
9086
if domain is not None:
9187
host_data["domain"] = domain
92-
if os is not None:
93-
host_data["os"] = os
94-
if signing is not None:
95-
host_data["signing"] = signing
96-
if cbt_status is not None:
97-
host_data["cbt_status"] = cbt_status
9888
# only add host to be updated if it has changed
9989
if host_data not in hosts:
10090
hosts.append(host_data)

nxc/protocols/ldap/db_navigator.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ def display_hosts(self, hosts):
1010
"IP",
1111
"Hostname",
1212
"Domain",
13-
"OS",
14-
"Signing",
15-
"Channel Binding"
13+
"OS"
1614
]
1715
]
1816

@@ -27,18 +25,14 @@ def display_hosts(self, hosts):
2725
except Exception:
2826
os = host[4]
2927

30-
signing = "Enforced" if bool(host[5]) else "None"
31-
cbt_status = host[6]
32-
3328
data.append(
3429
[
3530
host_id,
3631
ip,
3732
hostname,
3833
domain,
39-
os,
40-
signing,
41-
cbt_status]
34+
os
35+
]
4236
)
4337
print_table(data, title="Hosts")
4438

@@ -60,9 +54,7 @@ def do_hosts(self, line):
6054
"IP",
6155
"Hostname",
6256
"Domain",
63-
"OS",
64-
"Signing",
65-
"Channel Binding"
57+
"OS"
6658
]
6759
]
6860
host_id_list = []
@@ -79,18 +71,13 @@ def do_hosts(self, line):
7971
except Exception:
8072
os = host[4]
8173

82-
signing = "Enforced" if bool(host[5]) else "None"
83-
cbt_status = host[6]
84-
8574
data.append(
8675
[
8776
host_id,
8877
ip,
8978
hostname,
9079
domain,
91-
os,
92-
signing,
93-
cbt_status
80+
os
9481
]
9582
)
9683
print_table(data, title="Host")
@@ -100,7 +87,7 @@ def help_hosts(self):
10087
hosts [filter_term]
10188
By default prints all hosts
10289
Table format:
103-
| 'HostID', 'IP', 'Hostname', 'Domain', 'OS', 'Signing, 'Channel Binding' |
90+
| 'HostID', 'IP', 'Hostname', 'Domain', 'OS' |
10491
Subcommands:
10592
filter_term - filters hosts with filter_term
10693
If a single host is returned (e.g. `hosts 15`, it prints the following tables:
@@ -201,4 +188,4 @@ def help_clear_database(self):
201188
THIS COMPLETELY DESTROYS ALL DATA IN THE CURRENTLY CONNECTED DATABASE
202189
YOU CANNOT UNDO THIS COMMAND
203190
"""
204-
print_help(help_string)
191+
print_help(help_string)

0 commit comments

Comments
 (0)