대부분의 사람들은 인지하기 쉬운 패스워드를 사용하기 때문에 계정(ID)과 동일한 패스워드를 하거나 1234와 같이 연속된 숫자로 설정하여 사용합니다. 이렇게 패스워드를 사용하면 추측이나 패스워드 크랙툴로 인한 패스워드 유출이 될 가능성이 높습니다. 이번 포스팅에서는 John the ripper라는 패스워드 크랙 툴을 이용하여 패스워드를 점검하는 방법에 대해 소개하고자 합니다.
▷ John the Ripper는 많은 운영 체제에서 사용할 수있는 오픈 소스 패스워드 보안 감사 및 암호 복구 도구입니다. 아래 링크는 공식 홈페이지로 설치 파일 다운로드와 사용법 등 관련 문서를 제공하고 있습니다.
John the Ripper password cracker
John the Ripper password cracker John the Ripper is an Open Source password security auditing and password recovery tool available for many operating systems. John the Ripper jumbo supports hundreds of hash and cipher types, including for: user passwords o
www.openwall.com
▷ 다양한 OS에서 사용할 수 있으며, 해당 도구를 이용하여 패스워드를 점검하여 취약한 패스워드를 사용 중인 ID를 찾을 수 있습니다.
▷ John the ripper 설치는 아래와 같이 설치를 진행 합니다.
# john the ripper 설치 파일 다운로드
[root@localhost ~]# wget https://www.openwall.com/john/k/john-1.9.0.tar.gz
# john the ripper 설치 파일 압축 해제
[root@localhost ~]# tar xvfz john-1.9.0.tar.gz
# john the ripper 소스 컴파일
[root@localhost ~]# cd john-1.9.0/src
[root@localhost src]# make linux-x86-64
# make error 발생시
[root@localhost src]# make clean linux-x86-64
# john the ripper 설치 확인
[root@localhost src]# cd ../run
[root@localhost run]# ./john
John the Ripper password cracker, version 1.9.0
Copyright (c) 1996-2019 by Solar Designer
Homepage: http://www.openwall.com/john/
Usage: john [OPTIONS] [PASSWORD-FILES]
--single "single crack" mode
--wordlist=FILE --stdin wordlist mode, read words from FILE or stdin
--rules enable word mangling rules for wordlist mode
--incremental[=MODE] "incremental" mode [using section MODE]
--external=MODE external mode or word filter
--stdout[=LENGTH] just output candidate passwords [cut at LENGTH]
--restore[=NAME] restore an interrupted session [called NAME]
--session=NAME give a new session the NAME
--status[=NAME] print status of a session [called NAME]
--make-charset=FILE make a charset, FILE will be overwritten
--show show cracked passwords
--test[=TIME] run tests and benchmarks for TIME seconds each
--users=[-]LOGIN|UID[,..] [do not] load this (these) user(s) only
--groups=[-]GID[,..] load users [not] of this (these) group(s) only
--shells=[-]SHELL[,..] load users with[out] this (these) shell(s) only
--salts=[-]N load salts with[out] at least N passwords only
--save-memory=LEVEL enable memory saving, at LEVEL 1..3
--node=MIN[-MAX]/TOTAL this node's number range out of TOTAL count
--fork=N fork N processes
--format=NAME force hash type NAME: descrypt/bsdicrypt/md5crypt/
bcrypt/LM/AFS/tripcode/dummy/crypt
▷ John the ripper 설치 완료 후 아래와 같이 시스템에 등록된 ID와 PW를 복호화하여 패스워드를 점검 합니다.
# shadow 파일 패스워드 복호화 방법 (1)
[root@localhost run]# ./john /etc/shadow
Loaded 3 password hashes with 3 different salts (crypt, generic crypt(3) [?/64])
Press 'q' or Ctrl-C to abort, almost any other key for status
**** (root)
**** (magicpipe)
**** (mpjamong)
3g 0:00:00:01 100% 1/3 3.000g/s 478.0p/s 480.0c/s 480.0C/s m999998..mpjamongv
Use the "--show" option to display all of the cracked passwords reliably
Session completed
# shadow 파일 패스워드 복호화 방법 (2)
[root@localhost run]# ./unshadow /etc/passwd /etc/shadow > /tmp/passwd.txt
[root@localhost run]# ./john /tmp/passwd.txt
Loaded 3 password hashes with 3 different salts (crypt, generic crypt(3) [?/64])
Press 'q' or Ctrl-C to abort, almost any other key for status
**** (root)
**** (magicpipe)
**** (mpjamong)
3g 0:00:00:01 100% 1/3 3.000g/s 478.0p/s 480.0c/s 480.0C/s mpjamong`..mpjamong!!
Use the "--show" option to display all of the cracked passwords reliably
Session completed
# 크랙된 패스워드 해시 확인
[root@localhost run]# cat john.pot
▷ 취약한 패스워드를 사용하는 계정을 조치하는 방법은 아래와 같이 계정을 잠금으로 설정 후 실 사용자에게 연락이 오면 계정 잠금 해제 후 패스워드를 변경하는 것입니다.
# 계정 잠금 조치
[root@localhost run]# passwd -l magicpipe
Locking password for user magicpipe.
passwd: Success
# 계정 잠금 해제
[root@localhost run]# passwd -u magicpipe
Unlocking password for user magicpipe.
passwd: Success
# 참고 : 잠금 시 shadow 파일 !! 표시로 변경
[root@localhost run]# cat /etc/shadow | grep magicpipe
magicpipe:!!$6$YwkjZ72MBoIa2x8o$u7BGEou2e4xCnlbm1wozE7bjdiMsrqdu4i3YV2oukBDcPO/luCOHnOHseM0NjnIib4zObfUAIm3Vf57SMDOmN0::0:99999:7:::
▽ 같이 보면 더 좋은 블로그 글 ▽
[CentOS 8] psacct 로 사용자 활동 모니터링하는 방법
psacct 패키지는 사용자 활동을 모니터링하는 유용한 도구를 포함하고 있습니다. 이번 포스팅에는 해당 패키지를 설치하고 사용하는 방법에 대해 알아보겠습니다. psacct 패키지 소개 ▷ psacct 패키
mpjamong.tistory.com
[CentOS 8] Auditd 설정과 사용법
Auditd는 리눅스 시스템의 보안 관련 정보를 감사할 수 있는 정보를 수집합니다. 수집하는 정보는 시스템 호출, 보안 이벤트, 파일 접근, 명령어 실행 등으로 해당 로그를 확인함으로써 보안 위협
mpjamong.tistory.com
[CentOS 8] faillock으로 서버 접근 통제하는 방법 (1) | 2021.02.06 |
---|---|
[CentOS 8] pwquality를 이용한 패스워드 규칙 적용하는 방법 (0) | 2021.02.05 |
[CentOS 8] Snoopy Logger를 이용한 명령어 히스토리 로깅하는 방법 (2) | 2021.02.02 |
[CentOS 8] 명령어 히스토리(history) 관리하는 방법 (1) | 2021.02.01 |
[CentOS 8] Lynis를 이용한 시스템 보안 감사와 보안 취약점 진단 (2) | 2021.01.29 |
댓글 영역