Table of Contents

인증 시스템

시스템 보안

리눅스 계정 관리

계정 리스트만 뽑아 보기

snippet.shell
cut -f1 -d: /etc/passwd

UID 500 이상인 계정만 뽑아 보기

snippet.shell
awk -F':' '{if($3>=500)print $1}' /etc/passwd

사용자 계정 개수 확인하기

snippet.shell
cat /etc/passwd | wc -l

UID 500 이상인 계정 개수 확인하기

snippet.shell
awk -F':' '{if($3>=500) print $1}' /etc/passwd | wc -l

리눅스 계정 관리

리눅스 패스워드 크랙

테스트용 유저 생성 (간단한 암호 입력)

snippet.shell
s@ubuntu:~/john/john-1.9.0/run$ sudo ./john /etc/shadow --show
s:s:18038:0:99999:7:::
 
1 password hash cracked, 1 left

좀 더 간단한 방법 (우분투)

사전 파일 생성

테스트용 유저 생성, 암호 입력, 패스워드 파일 복사는 동일

사전 파일을 이용해 패스워드 크래킹

snippet.shell
s@ubuntu:~$ sudo john --wordlist=dic.txt --format=crypt pass.txt
Loaded 2 password hashes with 2 different salts (crypt, generic crypt(3) [?/64])
Remaining 1 password hash
Press 'q' or Ctrl-C to abort, almost any other key for status
qwert            (user03)
1g 0:00:00:00 100% 33.33g/s 66.66p/s 66.66c/s 66.66C/s 12345..qwert
Use the "--show" option to display all of the cracked passwords reliably
Session completed
s@ubuntu:~$ cat dic.txt
12345
qwert
s@ubuntu:~$ 

리눅스 로그 시스템

UTMP

snippet.shell
w, who, users
 
s@ubuntu:~$ w
 07:13:00 up  3:07,  1 user,  load average: 0.38, 0.27, 0.27
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
s        tty7     :0               04:06    3:06m  8:32   0.38s /sbin/upstart -
s@ubuntu:~$ who
s        tty7         2019-05-22 04:06 (:0)
s@ubuntu:~$ users
s