C.W.K.
Stream
Lesson 13 of 14 · published

보안 스캔 — ssh-audit

~10 min · ssh-audit, scanning, weak-algorithms

Level 0Pinger
0 XP0/101 lessons0/12 achievements
0/150 XP to next level150 XP to go0% complete

sshd 자동 체크

ssh-audit 이 SSH 서버 연결해 advertising 알고리즘 보고, 약하거나 deprecated 된 거 flag. 네트워크 쪽에서 hardening 검증하는 싸고 자동인 방법 — sshd_config 읽고 어느 cipher 가 나쁜지 기억할 필요 X. 도구가 알아.

Code

ssh-audit 실행·bash
# Install
pip install ssh-audit
# or
brew install ssh-audit

# Audit your own server
ssh-audit 192.168.1.100

# Non-default port
ssh-audit 192.168.1.100:2222

# Batch — fleet-wide audit
for host in $(cat ~/.fleet/all.txt); do
    echo "=== $host ==="
    ssh-audit "$host" 2>&1 | tail -30
done

# Output uses colors:
#   green/✓  good algorithm or setting
#   yellow/⚠ acceptable but not ideal
#   red/✗    weak — fix it
필요시 sshd_config 알고리즘 조이기·bash
# Modern, restrictive
KexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com

# Validate and restart
sudo sshd -t
sudo systemctl restart sshd

# Re-run ssh-audit
ssh-audit 192.168.1.100

External links

Exercise

Fleet 의 모든 머신에 ssh-audit 실행. 빨강이나 노랑 보이는 거 메모. 각각 조사 — 합법 trade-off (호환성 위한 legacy cipher 필요) 또는 실제 drift? 위 batch 스크립트를 cron 에 주간, 자기 메일로. 이제 어느 서버 자세 drift 하는 순간 알아.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.