Linux 서버를 인터넷에 노출하면 SSH 포트(기본 22번)에 대한 자동화 공격이 수분 내로 시작됩니다. 이 모든 시도는 /var/log/auth.log (Debian/Ubuntu 계열) 또는 /var/log/secure (CentOS/RHEL 계열)에 기록됩니다.
`` May 10 03:22:11 web01 sshd[23451]: Failed password for invalid user admin from 203.0.113.42 port 52341 ssh2 May 10 03:22:12 web01 sshd[23452]: Failed password for root from 203.0.113.42 port 52342 ssh2 May 10 03:22:14 web01 sshd[23453]: Invalid user test from 203.0.113.42 `
` May 10 03:22:15 web01 sshd[23454]: error: maximum authentication attempts exceeded for invalid user admin from 203.0.113.42 port 52343 ssh2 May 10 03:22:15 web01 sshd[23454]: Disconnecting invalid user admin 203.0.113.42 port 52343: Too many authentication failures `
연속 실패가 MaxAuthTries(기본 6회)를 넘으면 SSH 데몬이 강제 연결 차단합니다.
` May 10 08:20:01 web01 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/usr/bin/apt update `
내부자 위협이나 권한 남용 탐지에 활용됩니다.
`bash grep 'Failed password' /var/log/auth.log \ | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head -20 `
`bash grep 'Invalid user' /var/log/auth.log \ | awk '{print $8}' | sort | uniq -c | sort -rn | head -20 `
공격자가 주로 시도하는 사용자명:
| 순위 | 사용자명 | 시도 횟수 |
|---|---|---|
| ------ | --------- | ----------- |
| 1 | admin | 1,204 |
| 2 | root | 987 |
| 3 | ubuntu | 643 |
| 4 | test | 412 |
| 5 | postgres | 311 |
| 탐지 패턴 | MITRE 기법 | 설명 |
| ----------- | ----------- | ------ |
| 반복 패스워드 시도 | T1110.001 | Brute Force: Password Guessing |
| 다수 사용자명 시도 | T1110.003 | Brute Force: Password Spraying |
| root 직접 로그인 시도 | T1078.001 | Valid Accounts: Default Accounts |
| 비정상 시간대 sudo | T1548.003 | Abuse Elevation: Sudo and Sudo Caching |
SSH 브루트포스 공격은 서버 노출 즉시 시작됩니다. 핵심 방어 순서: