Skip to content

Conversation

@drb-ra
Copy link

@drb-ra drb-ra commented Nov 27, 2023

Added additional information to the output of the host command for SSH results. SSH Key and Fingerprint are useful for threat hunting and data validation.


# Show optional ssh info
if 'ssh' in banner:
if 'key' in banner['ssh'] and banner['ssh']['key']:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this could be simplified like the following: if banner.get('ssh') and banner['ssh'].get('key')

Given that `bannher['ssh']['key'] returns a string, the second part of your nested if statement is not needed. I think the same could be said for your check for banner['ssh']['fingerprint']

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please feel free to adjust, the idea was more to provide a solution to the request at the same time as the request itself, if there's a better or preferred way to do it, I'm all for that. I think at the time I was just trying to make these changes as close to the original code as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants