컴퓨터 보안

User Authentication

앜지 2024. 4. 12. 17:00

-User Authentication(message authentication과는 조금 다르다)

❖ Fundamental security building block

  • basis of access control & user accountability

❖ The process of verifying an identity claimed by or for a system entity(신원검증) 

❖ Two steps:

  • Identification: specify identifier(누구냐고 묻는것)
  • Verification: bind entity (person) and identifier(실제로 말한 주체인지 확인하는 것)

❖ Distinct from message authentication 

  • integrity of the exchanged messages. message authentication에서는 서로 전송된 메세지의 무결성에 더 관심이 잇다.

❖ Authentication = user authentication + message authentication

 

 

- A Model for Electronic User Authentication (EUA)

❖ NIST SP 800-63-2 defines EUA as:

  • The process of establishing confidence in user identity that are electronically presented
  • 전자적으로 제공된 사용자의 identity에 믿음을 가지게하는 과정

❖ The NIST SP 800-63-2 model

  •  The credential (기밀정보의 자료구조라고 생각하면 된다) binds an identity to a token possessed by the subscriber.
  • Claimant: the party to be authenticated(인증을 받아야 하는 주체)
  • Verifier: the party verifying (인증을 하는 주체)
  • Registration, credential issuance, maintenance activities
  • 1. An individual Applicant(Subscriber) applies to an RA through a registration process.(사용자 요청)
  • 2. The RA identity proofs that Applicant.(기관에서는 요청을 보증한다)
  • 3. On successful identity proofing, the RA sends the CSP a registration confirmation message.증명이 되었다면 등록 관련 정보를 바인딩해서 credential을 보낸다.
  • 4. A secret token and a corresponding credential are established between the CSP and the new Subscriber.
  • 5. The CSP maintains the credential, its status, and the registration data collected for the lifetime of the credential (at a minimum).
  • E-Authenticaiton using Token and Credential to perform eauthentication
    • 1. The Claimant proves to the Verifier that he or she possesses and controls the token through an authentication protocol.사용자는 Verifier에게 자신이 토큰의 소유권을 가지고 있다고 인증 프로토콜을 통해서 전해준다.
    • 2. The Verifier interacts with the CSP to validate the credential that binds the Subscriber’s identity to his or her token. 그렇다면 Verifier는 CSP와의 통신을 통해 사용자의 토큰에 연결되어 있는 credential을 확인한다.
    • 3. If the Verifier is separate from the RP (application), the Verifier provides an assertion about the Subscriber to the RP, which uses the information in the assertion to make an access control or authorization decision. 만약에 Verifier와 RP(서비스)와 별개의 객체라면 Verifier는 RP에게 사용자에 대한 인증정보를 제공한다. 그리고 RP는 이 인증정보를 통해서 Access control이나 User Authentication을 실행한다.
    • 4. An authenticated session is established between the Subscriber and the RP그러면 사용자와 RP사이에서는 인증된 세션이 설립이 된다..

왼쪽:사용자 등록/ 오른쪽:사용자 검증

- Means of User Authentication

Types based on something of the individual

multi factor authentication을 한다면 너무 많은 인증을 요해서 사용자가 불편을 겪을수가 있다.

❖ Four means of authenticating user's identity

  • Password authentication
  • Challenge-response authentication protocols
  • Biometrics
  • Token-based authentication

 

- Password Authentication

❖ Basic Idea 

  • 기본적인 전제로는 사용자가 비밀번호를 가지고 있다는 것이다. 시스템은 이 비밀번호를 사용해서 사용자를 인증을 한다.
  • 저장되어 있는 것과 비밀번호를 비교하여 로그인을 한다,

❖ Issues(그냥 naive하게 이런식으로 인증을 한다면 고려할점이 생긴다)

  • 비밀번호는 어떻게 저장될 것인가?
  • 시스템은 어떻게 비밀번호를 비교할 것인가?
  • 비밀번호는 얼마나 유추하기 쉬운가?
  • 비밀번호 저장파일의 유출이 쉽다는 전제하에, 저장파일이 있다고 해도 비밀번호를 유추할수 없도록 하는것이 최선이다.

❖ Basic Password Scheme

  • Hash function h: strings → strings
    • 기본적으로 해시함수를 사용한다. 해시함수는 한 문자열이 주어진다면 완전히 다른 문자열을 출력하는 함수이다.
  • When user enters password 사용자가 비밀번호를 입력한다면
    • System computes h(password) 시스템은 이 입력에 해시함수를 수행한다.
    • Compares with entry in password file 저장파일에 있는 것과 해시함수의 결과를 비교한다.

❖ Why a Salt Value?

  • Salt Value라는 개념이 사용이 되는데, 이는 동일 비밀번호에 대한 보호가 주 목적이다.
  • 해시함수를 사용하더라도 동일한 비밀번호라면 동일한 해시값을 보이기 때문에 이를 방지하기 위해서 해시함수를 수행하기 전, 솔트값을 집어넣는 것이다.
  • Increases the difficulty of offline dictionary attacks.
  •  

- UNIX Implementation(실제로 유닉스에서 적용된 방식)

❖ Original Scheme

  • 8 character password form 56-bit key.
  • 12-bit salt used to modify DES encryption into a one-way hash function.
  • Output translated to 11 character sequence
  • Now regarded as insecure 하지만 12비트 salt value는 뚫릴수 있다.(최근 기술의 발전으로 )
    • e.g. supercomputer, 50 million tests, 80 min

❖ Improved Scheme(그래서 더 향상된 방식을 사용한다)

  • Have other, stronger, hash/salt variants
  • Many systems now use MD5(DES같은 알고리즘의 한계때문에 다른 알고리즘을 사용한다)
    • with 48-bit salt
    • password length is unlimited
    • is hashed with 1000 times inner loop
    • produces 128-bit hash
  • OpenBSD uses Blowfish block cipher based hash algorithm called Bcrypt
    • uses 128-bit salt to create 192-bit hash value

 

 

- Password Types and Cracking Types

❖ Password Types

❖ Password Cracking Types

❖ Dictionary attacks ▪

  • Try each word then obvious variants in large dictionary against hash in password file(보통 해시함수로 변환이 되기 때문에 )
  • Typical password dictionary : '0000', '1234', 'qwerty', 'password', '1q2w3e4r'처럼 비밀번호로 자주 쓰이는 문자열들을 대입해서 암호를 찾아내는 방법이다
    • 1,000,000 entries of common passwords – people's names, common pet names, and ordinary words. 
    • Suppose you generate and analyze 10 (entry) guesses per second – This may be reasonable for a web site; offline is much faster • Dictionary attack in at most 100,000 seconds = 28 hours, or 14 hours on average 
    • If passwords were random – Assume six-character password » Upper- and lowercase letters, digits, 32 punctuation characters » 689,869,781,056 password combinations. » Exhaustive search requires 1,093 years on average 정말 랜덤이라면 brute force로는 뚫기가 힘들다.

❖ Rainbow table attacks:가능한 모든 평문에 대해서 그 해시값을 미리 계산해 놓은 테이블이다

  • A large dictionary of possible passwords 
  • For each password: 
    • Precompute tables of hash values for all salts 
    • A mammoth table of hash values: e.g. 1.4GB table cracks 99.9% of alphanumeric Windows passwords in 13.8 secs
    •  Not feasible if larger salt values used

물론 이런 공격들은 저장파일들에 대한 액세스를 통해 얻었다는 것을 가정한 공격이다.

 

- Password File Access Control

❖ Can block offline guessing attacks by denying access to encrypted passwords 원천적으로 file access를 막는 방법이다. 

  • make available only to privileged users 저장된 비밀번호 파일들을 특정 유저에게만 공개한다
  • often using a separate shadow password (for su only) 주로 리눅스에서 su에게만 권한이 주어지는 것을 뜻한다.

❖ Still have vulnerabilities 물론 이런 방법도 한계점이 잇다.

  • exploit O/S bug 애초에 운영체제에 구멍이 있을수도 있다.
  • accident with permissions making it readable 권한설정에 실수가 있을수도 있고
  •  users with same password on other systems (이거는 사람에 대한 문제이다) 다른 시스템과 같은 비밀번호를 쓸수도 있다.
  • access from unprotected backup media 백업파일에 대해 접근을 당할수도 있고 
  • sniff passwords in unprotected network traffic 네트워크에서 스니핑을 통해서 파일이 접근될수도 있다.

 

-Proactive Password Checking: 비밀번호 자체에도 더 보안성을 높이는 방법이다.

❖ Rule enforcement plus user advice, e.g. 8+ chars, upper/lower/numeric/punctuation 우리가 웹사이트에서 볼수 있듯이 비밀번호에 제약조건을 걸어놓는 것이다.

  • may not suffice 물론 충분하지는 않다

❖ Password cracker

  • list of bad passwords :크래커를 사용해서 약한 비밀번호들을 사용금지한다.
  • time and space issues: 비밀번호 해독과정이 소요되는 시간과 메모리 공간이 제약되니까 이거를 고려해서 보안정책을 수립하고 보호조치를 취한다.

❖ Markov model

  • generates guessable passwords: 마르코브 모델로 유추가능한 비밀번호들을 만든다.
  • hence reject any password it might generate

❖ Bloom filter: 확률적인 자료 구조로, 많은 양의 데이터 중에서 특정 요소가 존재하는지 여부를 빠르게 확인할 수 있도록 해준

  • use to build table based on dictionary using hashes
  • check desired password against this table

- Remote User Authentication

❖ Authentication over network more complex: 네트워크에서는 다양한 공격이 가능하기 때문에 인증과정이 더 복잡하다.

  • Problems of eavesdropping, replay,spoofing

❖ Generally use challenge-response: 일반적으로 사용하는 방식이 challenge-response방식이다.

  • User sends identity
  • Host responds with random number r
  • User computes f(r,h(P)) and sends back 
  • Host compares value from user with own computed value, if match user authenticated

❖ Protects against a number of attacks

-Challenge-Response Authentication

왼쪽이 Alice, 오른쪽이 Bob.

 

  • 기본전제: Alice는 Bob에게 자신임을 알리고 싶다.
  • Alice는 먼저 Bob에게 자신이라는 메세지를 보낸다
  • Bob은 그렇다면 Alice에게 난수 R을 보낸다.
  • Alice는 자신임을 증명하기 위해서 자신과 Bob만이 아는 공유비밀 키(Key)를 사용해서 R을 암호화 하여 보낸다.
  • Bob은 자신의 비밀 키를 사용하여 난수를 확인하고 Alice임을 알수가 있다.

 

  • Public Key사용 예시
    • Public Key를 사용한다면 
    • 와 같이, Bob은 Alice의 Public Key로 Alice가 보낸 패킷을 분석한다면 Alice임을 확인 할수가 있다.

-Token-based Authentication

 

❖ Object user possesses to authenticate, e.g.

  • ▪ Memory card (magnetic stripe)
    • Store but do not process data
    • Magnetic stripe card, e.g. bank card 
    • Electronic memory card 
    • Used alone for physical access (e.g., hotel rooms) 
    • Some with password/PIN (e.g., ATMs) 
    • Drawbacks of memory cards include:
      • need special reader
      • loss of token issues
      • user dissatisfaction (OK for ATM, not OK for computer access)
  •  Smartcard : Credit-card like
    •  Has own processor, memory, I/O ports – ROM, EEPROM, RAM memory
    •  Executes protocol to authenticate with reader/computer – static: similar to memory cards – dynamic: passwords created every minute; entered manually by user or electronically – challenge-response: computer creates a random number; smart card provides its hash 
    • Provides tamperproof function

 

-Electronic Identify Cards

❖ An important application of smart cards

❖ A national e-identity (eID)

❖ Serves the same purpose as other national ID cards (e.g., a driver’s license) 

  • Can provide stronger proof of identity
  • A German card • Personal data, Document number, Card access number (six digit random number), Machine readable zone (MRZ): the password • Uses: ePass (government use), eID (general use), eSign (can have private key and certificat

-Smartcard Attack Technique

-Biometric Authentication

❖ Authenticate user based on one of their physical characteristics:

  • ▪ Facial 
  • Fingerprint 
  • Hand geometry 
  • Retina pattern 
  • Iris 
  • Signature 
  • Voice

 

- Authentication Security Issues

 

❖ Client attacks: attacker attempts to achieve user authentication without accessing to the remote host.

  •  Masquerade as a legitimate user (e.g., guess the password or try all passwords) ▪ Countermeasure: strong passwords; limit number of attempts. host에 접근을 하지않고 비밀번호를 유추하거나 brute force로 가능한 모든 비밀번호를 시도하여 합법적 사용자로 위장을 하는 공격이다.
  • 이러한 공격에 대한 대책은 강력한 비밀번호를 설정하는 것과 인증 시도 횟수 제한이다. 

❖ Host attacks: 비밀번호가 저장되어 있는 호스트를 공격하는 것을 의미한다.

  • 호스트 공격에 대한 대책: 비밀번호를 해싱해서 저장하기, 데이터베이스를 보호하기(데이터베이스 암호화나 접근제어등)

❖ Eavesdropping: 사용자를 관찰하거나 키로깅을 통해서 비밀번호를 알아내려는 공격

  • Countermeasures
    • 사용자에게 비밀번호 안전하게 보관하기를 권고
    • 비밀번호 외 다른 인증수단을 도입
    • 침해된 비밀번호를 폐기, 혹은 변경

❖ Replay: 공격자가 이전에 잡힌 사용자 응답을 반복하는 것

  • Countermeasure
    •  Challenge-response
    • 1-time passcodes(일회용 비밀번호)

 

❖ Trojan horse: 애플리케이션이나 물리적 장치가 진짜 애플리케이션이나 장치로 위장하는 것

  • Countermeasure: 신뢰할 수 있는 보안 환경에서 클라이언트의 인증을 수행

 

❖ Denial of service(Dos): 서비스를 다운 시키는 공격

  • Countermeasure: 토큰을 사용한 다중 인증 요소를 도입하여 보안을 강화한다. 이렇게 하면 사용자 인증 서비스가 마비되더라도 보안이 유지될 수 있다.

 

❖ Injection attacks ▪ 인젝션 공격은 애플리케이션에 의도하지 않은 명령을 포함시키도록 속여서 발생시킨다.

  • Key Idea: Interperter 들이 입력창에 받은 문자열을 명령어라고 인식을 해서 발생하는 문제이다. 
  • Ex: SQL, shell (cmd.exe, bash), LDAP, XPath 
  •  

❖ SQL Injection in PHP

$link = mysql_connect($DB_HOST, $DB_USERNAME, $DB_PASSWORD) or die ("Couldn't connect: " . mysql_error()); mysql_select_db($DB_DATABASE);

$query = "select count(*) from users where username = '$username' and password = '$password‘ ";

$result = mysql_query($query);

이런식으로 sql문을 짠다면 

이런식의 공격이 들어오면 실제 비밀번호가 아닌데도 true가 나오기 때문에 로그인이 된다.

아니면 이런식으로 데이터베이스의 변형을 야기한다.

 

'컴퓨터 보안' 카테고리의 다른 글

Database Security  (0) 2024.04.13
Computer Security Overview  (0) 2024.03.08