양쪽 이전 판이전 판다음 판 | 이전 판 |
tech:ssh_bruteforce_attack [2013/05/11 13:33] – V_L | tech:ssh_bruteforce_attack [2019/05/22 23:56] (현재) – [Ssh Bruteforce Attack] V_L |
---|
| {{tag>ssh bruteforce attack 서버 공격 해킹 방어 중국 해커}} |
| ======Ssh Bruteforce Attack====== |
| |
| 중국의 해커들이 최근 가장 많이 사용하고 있는 공격 방법 중 어느정도 그 실체가 드러난 것은 대략 두 가지임. 서버 관리자들은 잘 알겠지만 |
| |
| 첫 번째는 ssh bruteforce attack임. 이것은 /etc/passwd 파일에 등록되어 있는 각 계정과 패스워드를 무작위 대입 방법을 사용하여 서버에 접속하는 방법임. 이 |
| 공격을 하면 다음과 같은 로그가 /var/log/auth.log 파일에 남는다. |
| |
| <file> |
| Jul 25 08:31:32 localhost sshd[23569]: Failed password for invalid user samba from ::ffff:211.140.122.36 port 56974 ssh2 |
| Jul 25 08:31:33 localhost sshd[23572]: Invalid user wwwrun from ::ffff:211.140.122.36 |
| Jul 25 08:31:36 localhost sshd[23572]: Failed password for invalid user wwwrun from ::ffff:211.140.122.36 port 57533 ssh2 |
| Jul 25 08:31:37 localhost sshd[23575]: Invalid user ldap from ::ffff:211.140.122.36 |
| </file> |
| |
| <code>May 5 15:09:40 ubuntu sshd[15558]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=122.115.62.34 user=root |
| May 5 15:09:40 ubuntu sshd[15558]: pam_winbind(sshd:auth): getting password (0x00000388) |
| May 5 15:09:40 ubuntu sshd[15558]: pam_winbind(sshd:auth): pam_get_item returned a password |
| May 5 15:09:40 ubuntu sshd[15558]: pam_winbind(sshd:auth): request wbcLogonUser failed: WBC_ERR_AUTH_ERROR, PAM error: PAM_USER_UNKNOWN (10), NTSTATUS: NT_STATUS_NO_SUCH_USER, Er$ |
| May 5 15:09:40 ubuntu sshd[15560]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=122.115.62.34 user=root |
| May 5 15:09:40 ubuntu sshd[15560]: pam_winbind(sshd:auth): getting password (0x00000388) |
| May 5 15:09:40 ubuntu sshd[15560]: pam_winbind(sshd:auth): pam_get_item returned a password |
| May 5 15:09:40 ubuntu sshd[15560]: pam_winbind(sshd:auth): request wbcLogonUser failed: WBC_ERR_AUTH_ERROR, PAM error: PAM_USER_UNKNOWN (10), NTSTATUS: NT_STATUS_NO_SUCH_USER, Er$ |
| May 5 15:09:41 ubuntu sshd[15561]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=122.115.62.34 user=root |
| May 5 15:09:41 ubuntu sshd[15561]: pam_winbind(sshd:auth): getting password (0x00000388) |
| May 5 15:09:41 ubuntu sshd[15561]: pam_winbind(sshd:auth): pam_get_item returned a password |
| May 5 15:09:41 ubuntu sshd[15561]: pam_winbind(sshd:auth): request wbcLogonUser failed: WBC_ERR_AUTH_ERROR, PAM error: PAM_USER_UNKNOWN (10), NTSTATUS: NT_STATUS_NO_SUCH_USER, Er$ |
| May 5 15:09:42 ubuntu sshd[15557]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=122.115.62.34 user=root |
| May 5 15:09:42 ubuntu sshd[15557]: pam_winbind(sshd:auth): getting password (0x00000388) |
| May 5 15:09:42 ubuntu sshd[15557]: pam_winbind(sshd:auth): pam_get_item returned a password |
| May 5 15:09:42 ubuntu sshd[15557]: pam_winbind(sshd:auth): request wbcLogonUser failed: WBC_ERR_AUTH_ERROR, PAM error: PAM_USER_UNKNOWN (10), NTSTATUS: NT_STATUS_NO_SUCH_USER, Er$ |
| May 5 15:09:42 ubuntu sshd[15558]: Failed password for root from 122.115.62.34 port 1410 ssh2 |
| May 5 15:09:42 ubuntu sshd[15560]: Failed password for root from 122.115.62.34 port 1420 ssh2 |
| </code> |
| |
| 이 로그에 남아 있는 아이피를 조사해보면 중국 아이피 임을 알 수 있다. 실제 이 공격에 의해 한번에 10개의 서버가 당한 경우도 있었다. |
| |
| 이에 대한 대비책으로 |
| - /etc/passwd 파일에 사용되지 않는 계정 앞에 comment 처리를 하고, |
| - 사용되는 계정의 패스워드는 ssh bruteforce attack에 사용되는 **[[https://packetstormsecurity.com/Crackers/wordlists|사전파일]]**에 나오지 않는 강력한 패스워드를 사용해야 함. 강력한 패스워드란 흔한 사람 이름이나 지역 이름, 그리고 일반적으로 많이 사용되는 영어단어를 제외한 특수문자와의 조합을 말함. |
| - [[fail2ban]]과 같은 도구 이용 |
| |
| 두 번째로 많이 사용되고 있는 것은 자동화된 공격툴임. 현재 가장 많이 사용되고 있는 자동화된 공격툴은 HDSI, MSSQL WEB SHELL, NBSI 등을 비롯한 툴들이 있다. 이 툴들의 공통점은 자동화된 웹해킹을 실행하고, 이를 통해 각종 데이터베이스의 정보를 빼 간다는 것임. 데이터베이스에는 각종 중요한 정보들이 들어 있다. 만약 그 정보들이 암호화되어 있지 않다면 심각한 결과를 초래할 수도 있다. 또한 웹 쉘을 이용해 로컬 공격을 실행하고, 이를 통해 시스템 전체를 장악한다는 것임. |
| |
| * [[https://www.linux.co.kr/home/lecture/files/serversecurity.pdf|리눅스포털]] |
| |