XP -> CentOS -> internet
 
facebook, inven 차단
 
www.facebook.com 와이어샤크 패킷 쿼리
|09|star-mini|04|c10r|08|facebook|03|com|
|01|m|08|facebook|03|com|00|
 
[root@localhost Desktop]# iptables -I FACEBOOK -p udp --dport 53 -s 10.0.0.0/24 -m state --state NEW,ESTABLISHED -m limit --limit-burst 3 --limit 10/m -j LOG --log-prefix "[FACEBOOK]"
 
[root@localhost Desktop]# iptables -A FACEBOOK -p udp --dport 53 -s 10.0.0.0/24 -m string --algo kmp --hex-string "|01|m|08|facebook|03|com|00|" -j DROP
 
[root@localhost Desktop]# iptables -A FACEBOOK -p udp --dport 53 -s 10.0.0.0/24 -m string --algo kmp --hex-string "|09|star-mini|04|c10r|08|facebook|03|com|00|" -j DROP
 
[root@localhost Desktop]# iptables -I FORWARD -j FACEBOOK
 
[root@localhost Desktop]# cat /var/log/messages | grep FACEBOOK

www.inven.co.kr 와이어샤크 패킷 쿼리
|03|www|05|inven|02|co|02|kr|00|
|05|inven|02|co|02|kr|00|
 
[root@localhost Desktop]# iptables -A INVEN -p udp --dport 53 -s 10.0.0.0/24 -m state --state NEW,ESTABLISHED -m limit --limit-burst 3 --limit 10/m -j LOG --log-prefix "[INVEN]"
 
[root@localhost Desktop]# iptables -A INVEN -p udp --dport 53 -s 10.0.0.0/24 -m string --algo kmp --hex-string "|03|www|05|inven|03|com|00|" -j DROP
 
[root@localhost Desktop]# iptables -A INVEN -p udp --dport 53 -s 10.0.0.0/24 -m string --algo kmp --hex-string "|05|inven|02|co|02|kr|00|" -j DROP
 
[root@localhost Desktop]# cat /var/log/messages | grep INVEN

Untrusted Site 정책
DMZWEB서버 접근을 제외한 모든 통신 차단
 
CentOS 설정
[root@localhost Desktop]# iptables -A DMZ_WEB -p tcp -m multiport --dport 80,443 -d 172.16.0.100 -m state --state NEW,ESTABLISHED -j ACCEPT
[root@localhost Desktop]# iptables -A DMZ_WEB -p tcp -m multiport --sport 80,443 -s 172.16.0.100 -m state --state ESTABLISHED -j ACCEPT
[root@localhost Desktop]# iptables -A FORWARD -j DMZ_WEB
 
BT에서 확인

Untrusted에서 관리 목적으로 접근하는 관리자의 SSH접속 허용 : 관리자의 IP(Desktop PC사용 : 192.168.73.xx)
admin -> CentOS -> WEBserver

CentOS 설정
[root@localhost Desktop]# iptables -N ADMIN_SSH
[root@localhost Desktop]# iptables -A ADMIN_SSH -p tcp --dport 22 -s 192.168.53.7 -d 172.16.0.100 -j ACCEPT
[root@localhost Desktop]# iptables -A ADMIN_SSH -p tcp --sport 22 -d 192.168.53.7 -s 172.16.0.100 -j ACCEPT
[root@localhost Desktop]# iptables -A FORWARD -j ADMIN_SSH
 
기존DNAT을 지우고 22번 포트를 추가해준다.
[root@localhost Desktop]# iptables -t nat -I PREROUTING -p tcp -m multiport --dport 22,80,443 -i eth2 -d 192.168.53.224 -j DNAT --to 172.16.0.100

WEBserver설정

호스트 putty SSH 연결

WEBserver 연결 확인

Netcat(NC)으로 추가 확인

호스트

WEBserver

문자열도 잘 전달 되는 것을 알 수 있다.

'정보보안 > System' 카테고리의 다른 글

Sophos UTM 설치 및 환경구성  (342) 2020.08.04
스캐닝,DOS,fragments,Smurf,Source Routing,icmp redirect,IP spoofing 차단  (383) 2020.08.03
DNAT,DNS,LOG정책 설정  (356) 2020.08.03
FTP 정책 및 실습(1)  (353) 2020.08.03
SNAT, HTTP 정책 설정  (369) 2020.08.03

+ Recent posts