본문 바로가기
리눅스와 웹개발

시스템 보안 VII

by kuksool 2024. 1. 12.
728x90
반응형

1. Linux 구동 단계



POWER ON
ROM BIOS
부트 매니저 실행
Linux Kernel
init 프로세스
/etc/inittab
/etc/rc.d/rc.sysinit
/etc/rc.d/rc?.d
/etc/rc.local

Login

2. 주요 설정 파일 1



사용자 계정 관련
/etc/passwd
/etc/shadow
/etc/groups

r 계열 명령어 관련(rsh, rcp…)
/etc/hosts.equiv
~/.rhosts

tcpwrapper 관련
/etc/hosts.allow
/etc/hosts.deny

3. 주요 설정 파일 2



runlevel 에 따른 구동
/etc/rc.d/*

inetd/xinetd super daemon 관련
/etc/inetd.conf
/etc/xinetd.d/

syslog 관련
/etc/syslog.conf

cron 관련
crontab

4. /proc 파일 시스템 1



kcore - 시스템의 물리적인 메모리 내용

ksyms - 커널 모듈이 사용하는 심볼 정의 내용

modules - 시스템에 로드된 커널 모듈 목록

net - 네트워크 레이어 각각에 대한 정보

5. /proc 파일 시스템 2



프로세스 정보

cmdline : 프로세스에 대한 커맨드 라인 전체
cwd : 프로세스의 작업 디렉토리
exe : 실행 바이너리 포인터
fd : 프로세스가 사용하는 file descriptor
0 - 표준 입력
1 - 표준 출력
2 - 표준 에러

6. 로그파일



/var/adm 이하

/var/log 이하

7. /proc 정보 모으기



Linux 의 PID 1번 init 의 정보
cd /proc/1
cat /proc/1/cmdline
cat /proc/1/environ
cat /proc/1/maps
cat /proc/1/stat
cat /proc/1/statm
cat /proc/1/status
ls -alt /proc/1/fd/
dd if=/proc/1/exe of=/tmp/res

8. /proc 정보 모으기 스크립트



정보수집 스크립트
ls -alt /proc/$PID
cat /proc/$PID/cmdline
cat /proc/$PID/environ
cat /proc/$PID/maps
cat /proc/$PID/stat
cat /proc/$PID/statm
cat /proc/$PID/status
ls -alt /proc/$PID/fd/
dd if=/proc/$PID/exe of=/some/where/$PID.out

반응형

9. nmap

nmap 으로 localhost 를 스캔


nmap –sT –p 1-65535 localhost (TCP 포트 스캔)
nmap –sU –p 1-65535 localhost (UDP 포트 스캔)
nmap –sP [IP]/subnet mask (특정 네트워크에 살아있는 호스트 리턴)

10. 정리



Linux 는 구동시에
inittab  /etc/rc.d/rc.sysinit  /etc/rc.d/rc?.d  /etc/rc.local 파일들을 수행하면서 초기화 및 각종 데몬들을 구동시킨다.

주요 설정파일은
/etc 이하에 passwd, shadow, groups, hosts.equiv, hosts.allow, hosts.deny, rc.d, inetd.conf, xinetd.d, syslog.conf
~/.rhosts
crontab 
   이 있다.

/proc 파일 시스템은 프로세스 및 시스템 상태에 대한 다양한 정보를 가지고 있다.

nmap 은 시스템 또는 네트워크 스캔에 사용된다.



1. Linux Drive Phase

POWER ON
ROM BIOS
Running Boot Manager
Linux Kernel
init process
/etc/inittab
/etc/rc.d/rc.sysinit
/etc/rc.d/rc?.d
/etc/rc.local

Login

2. Key Settings File 1

User Account Related
/etc/passwd
/etc/shadow
/etc/groups

Related to r-series commands (rsh, rcp…)
/etc/hosts.equiv
~/.rhosts

Related to tcpwrapper
/etc/hosts.allow
/etc/hosts.deny

3. Key Settings File 2

Drive according to run level
/etc/rc.d/*

inetd/xinetd super daemon 관련
/etc/inetd.conf
/etc/xinetd.d/

Syslog related
/etc/syslog.conf

Cron-related
crontab

4. /proc File System 1

kcore - The physical memory content of the system

ksyms - The contents of the symbol definition used by the kernel module

modules - List of kernel modules loaded on the system

net - Information for each network layer

5. /proc File System 2

Process Information

cmdline : the entire command line for the process
cwd : working directory of the process
exe : Run binary pointer
fd : file descriptor used by the process
0 - Standard Input
1 - Standard Output
2 - Standard Error

6. log file

/var/adm or less

/var/log and below

7. /proc Gathering Information

About PID No. 1 init on Linux
cd /proc/1
cat /proc/1/cmdline
cat /proc/1/environ
cat /proc/1/maps
cat /proc/1/stat
cat /proc/1/statm
cat /proc/1/status
ls -alt /proc/1/fd/
dd if=/proc/1/exe of=/tmp/res

8. /proc Information Gathering Script

Information gathering script
ls -alt /proc/$PID
cat /proc/$PID/cmdline
cat /proc/$PID/environ
cat /proc/$PID/maps
cat /proc/$PID/stat
cat /proc/$PID/statm
cat /proc/$PID/status
ls -alt /proc/$PID/fd/
dd if=/proc/$PID/exe of=/some/where/$PID.out

9. 9. nmap

Scan localhost with nmap
nmap –sT –p 1-65535 localhost (TCP port scan)
nmap –sU –p 1-65535 localhost (UDP port scan)
nmap –sP [IP]/subnet mask (return of hosts alive on a particular network)

10. Clean up

When Linux is running
Initialize and run various daemons while executing intitab  /etc/rc.d/rc.sysinit  /etc/rc.d/rc?d  /etc/rc.local files.

The main configuration file is
/etc 이하에 passwd, shadow, groups, hosts.equiv, hosts.allow, hosts.deny, rc.d, inetd.conf, xinetd.d, syslog.conf
~/.rhosts
crontab
There is.

The /proc file system has a variety of information about processes and system states.

The nmap is used for system or network scanning.

728x90
반응형

'리눅스와 웹개발' 카테고리의 다른 글

PHP 소개  (4) 2024.01.15
시스템 보안 VIII  (194) 2024.01.14
시스템 보안 VI  (48) 2024.01.11
시스템 보안 V  (50) 2024.01.09
시스템 보안 IV  (39) 2024.01.08

loading