Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit 1bbe1ac

Browse files
author
mpgn
committed
Clean output of mssql protocol
1 parent f19f137 commit 1bbe1ac

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cme/protocols/mssql.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ def mssql_query(self):
214214
self.conn.sql_query(self.args.mssql_query)
215215
self.conn.printRows()
216216
for line in StringIO(self.conn._MSSQL__rowsPrinter.getMessage()).readlines():
217-
self.logger.highlight(line.strip())
217+
if line.strip() != '':
218+
self.logger.highlight(line.strip())
218219
return self.conn._MSSQL__rowsPrinter.getMessage()
219220

220221
@requires_admin
@@ -237,7 +238,8 @@ def execute(self, payload=None, get_output=False, methods=None):
237238
self.logger.success('Executed command via mssqlexec')
238239
buf = StringIO(output).readlines()
239240
for line in buf:
240-
self.logger.highlight(line.strip())
241+
if line.strip() != '':
242+
self.logger.highlight(line.strip())
241243

242244
return output
243245

0 commit comments

Comments
 (0)