인터넷보안전문가 실기문제 요약

1. 일반 계정 root권한 얻기
cat /etc/passwd 결과에 icqa:x:0:0::/home/icqa:/bin/bash가 있다면, icqa 계정이 root 권한을 가지고 있는 것이다.

2. 4000~5000번 사이 LISTEN 포트 탐색
netstat -ant | grep LISTEN으로 확인 후, lsof -i :포트번호 또는 ps -ef | grep 포트사용프로세스로 분석한다.

3. /var/log/secure 로그 분석
cat /var/log/secure | more → "Failed password for root from 111.222.333.444" 로그 확인. 공격 IP는 111.222.333.444.

4. FTP Anonymous 접근 제한
nano /etc/vsftpd/vsftpd.conf → anonymous_enable=YES를 NO로 변경.

4.ssh 포트번호 변경
nano /etc/ssh/sshd_config → #Port 22를 Port 222로 변경 후, systemctl restart sshd

4.sendmail 접근 차단
nano /etc/mail/access → 192.168.212 RELAY 삭제 → makemap hash access < access 실행 후 재시작.

4.ICMP echo 무시
sysctl -w net.ipv4.icmp_echo_ignore_all=1 → sysctl -a | grep icmp로 적용 확인.

4.SUID/SGID 파일 검사
find / -type f -perm +6000 -ls → 결과에서 -rwsr-xr-x, -rwxr-sr-x 형식 3개 파일 확인. 예: /usr/bin/passwd, /bin/su, /usr/bin/sudo

4.httpd.conf 변경 내용 확인
diff /etc/httpd.conf /etc/httpd.conf.old → 변경된 줄 번호와 내용을 확인하고 기술.

4.FTP 접근 실패 차단
nano /etc/ftpaccess → loginfails 5를 loginfails 3으로 변경.

4.root 자동 로그아웃 50초 설정
nano /etc/profile → 마지막 줄에 TMOUT=50 추가 후 저장.

4.TCP Wrapper 설정
/etc/hosts.deny: ALL:ALL
/etc/hosts.allow: in.sshd:ALL

4.ICMP 차단 (iptables)
iptables -A INPUT -p icmp -j DROP → iptables -L로 설정 확인.

패스워드 정책 설정
vi /etc/login.defs
→ PASS_MAX_DAYS 30
→ PASS_MIN_LEN 8

4.TFTP 포트 확인
cat /etc/services | grep tftp → 비정상 포트 등록 확인 (예: 1069 등).

4.kerberos 포트 도용 확인
cat /etc/services | grep krb524 → krb524가 4444번 이외의 포트(예: 5555)에 등록되어 있으면 백도어 가능성.

4.백도어 서비스 존재 확인
/etc/xinetd.d/venus, /etc/xinetd.d/black 파일에서 venus(12345), black(23456) 같은 포트 확인. UNLISTED 타입일 경우 백도어 가능성.

4.su 명령 root 권한 제한

4./etc/pam.d/su 파일에서 auth required pam_wheel.so use_uid 주석 해제

usermod -G wheel secu10

grep wheel /etc/group → wheel:x:10:root,secu10

4.로그인 메시지 설정
vi /etc/motd → 원하는 메시지 작성.

4.커널 버전 확인
uname -r → 예: 2.6.8-1.521

Apache 특정 IP 허용
vi /etc/httpd/conf/httpd.conf에 다음 추가:

apache
복사
편집
→ systemctl restart httpd