Hands-on task
Who planted someone else's SSH key
Server access is handed out through the git repository /srv/access: lots of people have edited keys/authorized_keys. Today a stranger's key with the comment intruder@kali turned up in it.
- Find the commit in which this line first appeared, and write its full hash (40 characters) to
/root/culprit.txt. - Revoke the access: delete the line with this key from
keys/authorized_keys(handy in the Editor tab) and commit the change. Don't touch the other keys and don't rewrite history — the evidence must stay in the past commits.
- git blame
- git log -S
- line history
- git rev-parse
- investigation
- git commit