fix unicode errors in netstat

This commit is contained in:
n1nj4sec 2017-03-23 22:00:25 +01:00
parent 771f182baa
commit 60966145db
1 changed files with 2 additions and 2 deletions

View File

@ -69,10 +69,10 @@ class NetStatModule(PupyModule):
'LADDR': colorize(':'.join([str(x) for x in connection['laddr']]), color), 'LADDR': colorize(':'.join([str(x) for x in connection['laddr']]), color),
'RADDR': colorize(':'.join([str(x) for x in connection['raddr']]), color), 'RADDR': colorize(':'.join([str(x) for x in connection['raddr']]), color),
'PID': colorize(connection.get('pid', ''), color), 'PID': colorize(connection.get('pid', ''), color),
'USER': colorize(connection.get('username', ''), color), 'USER': colorize(connection.get('username', '').encode('utf8','replace'), color),
'EXE': colorize( 'EXE': colorize(
connection.get( connection.get(
'exe', connection.get('name', '') 'exe', connection.get('name', '').encode('utf8','replace')
), color) ), color)
}) })