akde/infosec

Information security is ultimately about managing risk


Notes

Keys

Get fin­ger­prints

nmap -p22 --script ssh-hostkey $target

Get hostkeys

nmap -p22 --script ssh-hostkey --script-args ssh_hostkey=full $target

Extract fin­ger­prints from exist­ing key file:

ssh-keygen -E md5 -lf /tmp/found_key
ssh-keygen -E sha1 -lf /tmp/found_key
ssh-keygen -E sha256 -lf /tmp/found_key

Grab SSH keys from a host range

for ip in $(cat hosts.txt); do
nmap -p22 --script ssh-hostkey $ip > /tmp/$ip.keys
done;

Test­ing a pri­vate key against a host range

for ip in $(cat hosts.txt); do
echo For ip $ip
ssh -oBatchMode=yes -i t root@$ip "echo 'is valid'"
done;

Tools

Leave a Reply

About

Personal collection of some infosec stuff. Primary purpose of this site is to collect and organize for myself.

Note: Some content is not publicly visible due to copyright issues. Therefore, some links could be broken.

Checklists

Categories

Checklists: Ports

python -c 'import pty;pty.spawn("/bin/bash")';

python3 -c 'import pty;pty.spawn("/bin/bash")';