Improper Restriction of Excessive Authentication Attempts System Network

  • Slides: 14
Download presentation
Improper Restriction of Excessive Authentication Attempts System & Network Security Lab 석사 25기 유창훈

Improper Restriction of Excessive Authentication Attempts System & Network Security Lab 석사 25기 유창훈 2013. 5. 31

코드예제 • C / C++ int validate. User(char *host, int port) { … while

코드예제 • C / C++ int validate. User(char *host, int port) { … while ((is. Valid. User == 0)) { if (get. Next. Message(socket, username, USERNAME_SIZE) > 0) { if (get. Next. Message(socket, password, PASSWORD_SIZE) > 0){ is. Valid. User = Authenticate. User(username, password); } } }

대응방법 1) 로그인 시도 횟수 제한 <C / C++> int validate. User(char *host, int

대응방법 1) 로그인 시도 횟수 제한 <C / C++> int validate. User(char *host, int port) { int count = 0; while ((is. Valid. User == 0) && (count < MAX_ATTEMPTS)) { if (get. Next. Message(socket, username, USERNAME_SIZE) > 0) { if (get. Next. Message(socket, password, PASSWORD_SIZE) > 0){ is. Valid. User = Authenticate. User(username, password); } } count++; } }

대응방법 2) PAM을 이용한 방법 - /etc/pam. d/system-auth 를 편집 - /etc/pam. d/ssh 편집

대응방법 2) PAM을 이용한 방법 - /etc/pam. d/system-auth 를 편집 - /etc/pam. d/ssh 편집 - 아래 내용 추가 auth required /lib/security/pam_tally. so no_magic_root account required /lib/security/pam_tally. so deny=4 rock_time=120 no_magic_root reset - # pam_tally 라는 명령어로 실패횟수 볼수 있음 - # faillog –u 유저네임 -r 로 잠금계정 해제