Skip to content

조회 수 10368 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

kernel 버전: linux-2.6.18.4

OS 버전: CentOS 4.4

 

- geoip설치 시 필요한 파일 목록 입니다.

 

tar xvfj linux-2.6.16.27.tar.bz2

tar xvfj iptables-1.3.5.tar.bz2

tar xvfz iproute2-2.6.16-060323.tar.gz

tar xvfj patch-o-matic-ng-20060626.tar.bz2

tar xvfj patch-o-matic-ng-20060511.tar.bz2

tar xvfz esfq-2.6.15.1.tar.gz

tar xvfz netfilter-layer7-v2.2.tar.gz

 

-  linux커널소스 및 iptable 소스를 /usr/src에 압축을 풀로 linux 및 iptables로 각각 심볼릭링크를 걸어줍니다.

 

[root@localhost ~]# ln -s /usr/src/linux-2.6.16.27 /usr/src/linux

[root@localhost ~]# ln -s /usr/src/iptables-1.3.5 /usr/src/iptables

 

- iptables소스 및 커널소스를 geoip설치 시 제대로 적용할 수 있도록 패치를 합니다.

[root@localhost ~]# patch -p1 < ../netfilter-layer7-v2.2/kernel-2.6.13-2.6.16-layer7-2.2.patch

 

[root@localhost ~]# cd /usr/src/iptables

[root@localhost ~]# patch -p1 < ../netfilter-layer7-v2.2/iptables-layer7-2.2.patch

[root@localhost ~]# chmod +x extensions/.layer7-test

 

[root@localhost ~]# cd /usr/src/iproute2-2.6.16-060323

[root@localhost ~]# patch -p1 < ../esfq-2.6.15.1/esfq-iproute2.patch

 

[root@localhost ~]# cd /usr/src/linux

[root@localhost ~]# patch -p1 < ../esfq-2.6.15.1/esfq-kernel.patch

 

[root@localhost ~]# cd /usr/src/patch-o-matic-ng-20060511

[root@localhost ~]# patch -p1 < ../patch-geoip.patch

 

[root@localhost ~]# cd /usr/src/patch-o-matic-ng-20060626

[root@localhost ~]# patch -p1 < ../patch-connlimit.patch

 

[root@localhost ~]# /usr/src/patch-o-matic-ng-20060511

[root@localhost ~]# ./runme geoip nth

 

[root@localhost ~]# cd /usr/src/patch-o-matic-ng-20060626

[root@localhost ~]# ./runme time u32 connlimit ipp2p IPMARK ROUTE TARPIT

 

[root@localhost ~]# ./runme extra

 

만일 실행 중 아래와 같이 메시지가 발생하였을 경우

Do you want to apply this patch [N/y/t/f/a/r/b/w/q/?] y

unable to find ladd slot in src /tmp/pom-8915/net/ipv4/netfilter/Makefile (./patchlets/geoip/linux-2.6/./net/ipv4/netfilter/Makefile.ladd)

 

patch-o-matic-ng 의 Makefile내용을 kernel netfilter Makefile에 추가시켜 줍니다.

[root@localhost ~]# cat /usr/src/patch-o-matic-ng-20060511/patchlets/geoip/linux-2.6/net/ipv4/netfilter/Makefile.ladd >> /usr/src/linux/net/ipv4/netfilter/Makefile

 

[root@localhost ~]# cd /usr/src/linux

[root@localhost ~]# make menuconfig

 

Networking --->

[*] Networking support

Networking options --->

[*] Network packet filtering (replaces ipchains) --->

V t?chto podsekc?ch za?krt?me, co se d?:

Core Netfilter Configuration --->

IP: Netfilter Configuration --->

(M)geoip match support

 

iptables 및 kenel 및 iproute 소스를 컴파일 합니다.

 

[root@localhost ~]# cd /usr/src/iproute2-2.6.16-060323

[root@localhost ~]# make

[root@localhost ~]# make install

 

[root@localhost ~]# cd /usr/src/iptables

[root@localhost ~]# make

[root@localhost ~]# make install

 

[root@localhost ~]# cd /usr/src/linux

[root@localhost ~]# make bzImage

[root@localhost ~]# make modules

[root@localhost ~]# make modules_install

[root@localhost ~]# make install

 

커널컴파일을 완료된 후 컴파일한 버전의 커널로 부팅하면 이제 iptables의 geoip를 사용할

준비가 되었습니다.

사용가능한 옵션은 --src-cc와 --dst-cc이 있는데,각각 뒤에 국가코드명이 들어가면 됩니다. 예를 들면,

# 일본과 미국에서의 웹 접속을 차단하고 다른 곳에서의 접속은 허용하고자 할 때

[root@localhost ~]# iptables -A INPUT -p tcp --dport 80 -m geoip --src-cc JP,US -j DROP

[root@localhost ~]# iptables -A INPUT -p tcp --dport 80 -j ACCEPT

# 한국에서의 ftp만 허용하고 나머지 국가에서의 접속은 차단하고자 할 때

[root@localhost ~]# iptables -A INPUT -p tcp --dport 21 -m geoip --src-cc KR -j ACCEPT

[root@localhost ~]# iptables -A INPUT -p tcp --dport 21 -j DROP

[root@localhost ~]# iptables -A INPUT -p tcp --dport 21 -m geoip --src-cc KR -j ACCEPT

# 중국에서의 웹 접속을 차단하고 다른 곳에서의 접속은 허용하고자 할 때

root@localhost ~]# iptables -A INPUT -p tcp --dport 80 -m geoip --src-cc CN -j DROP

[root@localhost ~]# iptables -A INPUT -p tcp --dport 80 -j ACCEPT

 

** 국가별 코드 **

 

대한민국        KR

네덜란드        NL

싱가포르        SG

포르투칼        PT

중국              CN

미국              US

일본               JP

독일              DE

호주              AU


  1. 국가별로 접속 차단설정(geoip 설치)

    Date2009.05.10 ByADMINPLAY Views10368
    Read More
  2. iptables-connlimit & geoip 설치설정

    Date2009.05.28 ByADMINPLAY Views10345
    Read More
  3. 보안서버로 redirection 설정 하기

    Date2008.12.14 ByADMIN Views10275
    Read More
  4. iptables 리눅스? NETFILTER관련

    Date2010.03.08 Byl2zeo Views10130
    Read More
  5. apache 웹방화벽 모듈 modsecurity용 웹설정 툴, Remo

    Date2009.03.17 ByADMINPLAY Views10037
    Read More
  6. 해킹이 의심될 때 사용되는 명령어들

    Date2010.03.08 Byl2zeo Views9868
    Read More
  7. 해킹툴이 사용하는 포트번호

    Date2009.05.22 ByADMINPLAY Views9818
    Read More
  8. 실전 테스트!! 스니퍼 공격

    Date2009.11.30 ByADMINPLAY Views9774
    Read More
  9. Linux Security

    Date2009.07.18 ByADMINPLAY Views9755
    Read More
  10. 64bit 시스템에 ssl 설치 후 실행 시 X509_free 오류

    Date2009.07.19 ByADMINPLAY Views9705
    Read More
  11. 리눅스 - iptables NAT rule

    Date2010.03.24 ByADMINPLAY Views9672
    Read More
  12. find 명령어 활용(보안관련)

    Date2009.08.08 ByADMINPLAY Views9602
    Read More
  13. 스위칭 허브 상에서의 sniffing 툴

    Date2009.09.08 ByADMINPLAY Views9583
    Read More
  14. DOS Attack을 막기 위한 간단한 방법

    Date2009.05.22 ByADMINPLAY Views9572
    Read More
  15. SSL 인증서문제

    Date2009.07.19 ByADMINPLAY Views9480
    Read More
  16. apache 웹방화벽 modsecurity용 웹설정 툴, Remo

    Date2009.09.09 ByADMINPLAY Views9452
    Read More
  17. rootkit 검색 프로그램 rkhunter-1.3.4.tar.gz

    Date2009.09.22 ByADMINPLAY Views9449
    Read More
  18. mod_evasive를 이용한 웹Dos 공격을 막자

    Date2009.05.07 ByADMINPLAY Views9429
    Read More
  19. mod_security 설치 2.X

    Date2009.06.04 ByADMINPLAY Views9413
    Read More
  20. 보안서버 SSL 구동시 비밀번호 자동 입력 및 부팅시 자동 ...

    Date2009.03.23 ByADMINPLAY Views9318
    Read More
Board Pagination Prev 1 2 3 4 5 Next
/ 5

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234