Add index and session id to dnscnc list

This commit is contained in:
Oleksii Shevchuk 2017-03-01 21:54:32 +02:00
parent 23bcfd7546
commit 237bc4ab39
1 changed files with 5 additions and 2 deletions

View File

@ -765,9 +765,11 @@ class PupyCmd(cmd.Cmd):
objects = [] objects = []
for session in sessions: for idx, session in enumerate(sessions_:
objects.append({ objects.append({
'#': '{:03d}'.format(idx),
'NODE': '{:012x}'.format(session.system_info['node']), 'NODE': '{:012x}'.format(session.system_info['node']),
'SESSION': '{:08x}'.format(session.spi),
'EXTERNAL IP': '{}'.format( 'EXTERNAL IP': '{}'.format(
session.system_info['external_ip'] or '?' session.system_info['external_ip'] or '?'
), ),
@ -788,7 +790,8 @@ class PupyCmd(cmd.Cmd):
}) })
columns = [ columns = [
'NODE', 'OS', 'ONLINE', 'EXTERNAL IP', 'IDLE', 'DURATION', 'BOOTED', 'CMDS' '#', 'NODE', 'SESSION', 'OS', 'ONLINE',
'EXTERNAL IP', 'IDLE', 'DURATION', 'BOOTED', 'CMDS'
] ]
self.display( self.display(