Linux/보안장비 운용

로그 log

GGkeeper 2022. 3. 4. 21:59

#########
## 로그 
#########

리눅스에서 로그가 기록되는 디렉터리
/var/log

/var/log/wtmp : data

# file /var/log/wtmp 
/var/log/wtmp: data


data 파일은 cat으로 보면 깨진다.
# cat /var/log/wtmp 
~~~reboot3.10.0-1160.el7.x86_64»^!bq
                                    3~~~runlevel3.10.0-1160.el7.x86_64!b$}󿾂tty1tty1󿾂!b¸󿾂tty1tty1LOGIN󿾂!b¸󿾂tty1tty1root󿾂$_!b5upts/0ts/0root192.168.108.1b񇀨ppts/0a»!bLQ
                                                            \{pts/0ts/0root192.168.108.1j»!br󿾆(l[root@firewall ~]# cat /var/l

data 파일 로그: data 파일을 볼 수 있는 전용 명령어가 있다.
# last
root     pts/0        192.168.108.1    Fri Mar  4 16:10   still logged in   
root     pts/0        192.168.108.1    Fri Mar  4 09:40 - 16:10  (06:30)    
root     tty1                          Fri Mar  4 09:36   still logged in   
reboot   system boot  3.10.0-1160.el7. Fri Mar  4 09:35 - 16:12  (06:37)    

wtmp begins Fri Mar  4 09:35:07 2022

strings : 바이너리 파일에서 text만 출력하는 명령어
# strings /var/log/wtmp 
reboot
3.10.0-1160.el7.x86_64
^!bq
runlevel
3.10.0-1160.el7.x86_64
^!b$}
tty1
tty1
tty1
tty1LOGIN
tty1
tty1root
$_!b52
pts/0
ts/0root
192.168.108.1
pts/0
!bLQ
pts/0
ts/0root
192.168.108.1


# strings /bin/ls

초기화 시켜놓고 확인하면 안나온다.
# > /var/log/wtmp 
# last

wtmp begins Fri Mar  4 16:18:45 2022