LINUX SECURITY 10292020 Computer Network Lab 1 q
LINUX SECURITY - 메일 보안 - 네트워크 실험실 김 윤 수 10/29/2020 Computer Network Lab. # 1
q목 차 v SMTP 서버와 클라이언트 v Sendmail보안 기초 v Qmail설치 v 요약 10/29/2020 Computer Network Lab. # 2
q 전자메일의 구조 10/29/2020 Computer Network Lab. # 4
q 전자메일 헤더 From hskim@daelimrnd. co. kr Thu Jun 29 08: 42: 27 2000 Received: from magpie. daelimrnd. co. kr (magpie. daelimrnd. co. kr [202. 30. 60. 10]) by bomun. kaist. ac. kr (8. 10. 2/8. 10. 2) with ESMTP id e 5 SNg. QL 21721 for <yskim@bomun. kaist. ac. kr>; Thu, 29 Jun 2000 08: 42: 26 +0900 (KST) Received: from hskim. daelimrnd. co. kr (dt 002. daelimrnd. co. kr [202. 30. 60. 16]) by magpie. daelimrnd. co. kr (8. 9. 3/8. 9. 3) with SMTP id JAA 27737; Thu, 29 Jun 2000 09: 04: 11 +0900 (KST) Message-ID: <000801 bfe 15 a$56 e 94 e 60$103 c 1 eca@daelimrnd. co. kr> 10/29/2020 Computer Network Lab. # 5
q SMTP 명령어 (2) 10/29/2020 Computer Network Lab. # 7
q sendmail 보안기초 (1) v sendmail의 version 10/29/2020 Computer Network Lab. # 9
q sendmail 서비스 보호 (1) v /etc/mail/access 10/29/2020 Computer Network Lab. # 15
q sendmail 서비스 보호 (2) 10/29/2020 Computer Network Lab. # 16
q sendmail 서비스 보호 (3) 10/29/2020 Computer Network Lab. # 17
q 실시간 블랙 리스트 관리 (2) 10/29/2020 Computer Network Lab. # 19
q 실시간 블랙 리스트 관리 (3) 10/29/2020 Computer Network Lab. # 20
q 실시간 블랙 리스트 관리 (4) 10/29/2020 Computer Network Lab. # 21
q 실시간 블랙 리스트 관리 (5) q RBL 서비스의 활용 /etc/sendmail. mc파일에 다음을 추가한다. - Sendmail Version 8. 9 Use FEATURE(rbl) - sendmail 8. 10 and above FEATURE(dnsbl) Then, reconfigure and restart the daemon. 10/29/2020 Computer Network Lab. # 22
q EXPN과 VRFY기능억제 (1) v SMTP명령어중 EXPN(expand)와 VRFY(verify)는 사용자의 정보를 외부로 유출할수 있다. 10/29/2020 Computer Network Lab. # 23
q EXPN과 VRFY기능억제 (2) v EXPN(expand)와 VRFY(verify)의 억제 v sendmail. cf 의 다음 부분을 추가하여 기능억제 # privacy flags O Privacy. Option=authwarnings, noexpn, novrfy And Then sendmail Restart!! 10/29/2020 Computer Network Lab. # 24
q TCP wrapper와 SMTP (1) v Daemon프로세서로 수행하지 않고 inetd의 일부로 사용(단, traffic이 많지 않을 경우) 1. Sendmail 초기화 스크립트 삭제 /etc/rc. d/rc 3. d/S 80 sendmail or /etc/rc. d/rc 5. d/S 80 sendmail 2. /etc/inetd. conf에 sendmail메일에 대한 항목 추가 smtp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/sendmail –b. D 3. inetd설정파일 다시 읽도록 한다. 4. Tcp wrapper제어 파일인 /etc/hosts. allow, /etc/hosts. deny 파일설정 10/29/2020 Computer Network Lab. # 25
q TCP wrapper와 SMTP (2) TCP wrapper설정예 (1) games. com, toys. com, weapons. com의 요구만 수용 - /etc/hosts. deny: deny - /etc/hosts. allow ALL: LOCAL, games. com, toys. com, weapons. com v TCP wrapper설정예 (2) badpeople. com과 evilspam. com에서 오는 요구를 제외하고 는 누구나 연결 가능 - /etc/hosts. deny ALL: badpeople. com, evilspam. com - /etc/hosts. allow ALL: ALL v 10/29/2020 Computer Network Lab. # 26
q Qmail의 설치 (2) 1. 2. 3. 4. source Down. Load qmail-1. 03. tar. gz tar zxvf qmail-1. 03. tar. gz 몇 개의 사용자 계정과 그룹 생성 cd qmail-1. 03 # groupadd nofiles # useradd -g nofiles -d /var/qmail/alias -s /bin/false alias # useradd -g nofiles -d /var/qmail -s /bin/false qmaild # useradd -g nofiles -d /var/qmail -s /bin/false qmaill # useradd -g nofiles -d /var/qmail -s /bin/false qmailp # groupadd qmail # useradd -g qmail -d /var/qmail -s /bin/false qmailq # useradd -g qmail -d /var/qmail -s /bin/false qmailr # useradd -g qmail -d /var/qmail -s /bin/false qmails 5. Make setup check 10/29/2020 Computer Network Lab. # 28
q Qmail의 설치 (3) 6. 7. 8. 9. [root@yskim qmail-1. 03]#. /config [root@yskim qmail-1. 03]# (cd ~alias; touch. qmail-postmaster. qmail-mailer-daemon. qmail -root) [root@yskim qmail-1. 03]# chmod 644 ~alias/. qmail* Sendmail 삭제 # mv /usr/lib/sendmail. old # mv /usr/sbin/sendmail. old # ln -s /var/qmail/bin/sendmail /usr/lib/sendmail # ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail # killall – 9 sendmail 10/29/2020 Computer Network Lab. # 29
q Qmail의 설치 (4) 10. /etc/inetd. conf 추가 stmp stream tcp nowait qmaild /var/qmail/bin/tcp-env /var/qmail/bin/qmail-smtpd [root@yskim qmail-1. 03]# cp /var/qmail/boot/proc /var/qmail/rc 12. [root@yskim qmail-1. 03]# csh –cf ‘/var/qmail/rc &’ 13. 자동스크립트에 추가 11. 10/29/2020 Computer Network Lab. # 30
q Qmail의 설치 (5) 10/29/2020 Computer Network Lab. # 31
q Qmail의 설치 (6) 10/29/2020 Computer Network Lab. # 32
q Qmail 관련문서들 v http: //www. qmail. org/ v http: //kldp. org/qmail/ v Michael Samuel의Qmail문서화 프로젝트 http: //qmail-docs. surfdirect. com. au v David Sill의 LWQ(Life with Qmail) http: //Web. Info. Ave. Net/~dsill/lwq. html v Qmail에서 RBL을 지원하도록 하기 위한 페이지 http: //www. qmail. org/rbl/ 10/29/2020 Computer Network Lab. # 33
- Slides: 34