리눅스 보안관련 문서 #11 - 포트 스캔 및 열린 포트 관리하는 법

포트 스켄(Port Scan)은 어떻게 보면 양날의 검과 같습니다.
서버 관리자에게의 포트 스켄은 보안의 역할을 하기 좋지만, 해커나 크래커들에게는 불법 침입에 반드시 필요한
도구 입니다.
 
기본적으로 포트스켄 툴을 사용하면, 현재 자신의 서버의 포트에 대한 정보를 알 수 있습니다.
포트스켄이 없는 경우 다음과 같이 입력하시면 자신의 서버의 포트를 체크할 수 있습니다.
 
netstat -an
 
위의 명령어를 입력하면 포트 번호, 접속상태, 접속자 ID를 얻을 수 있습니다.
여기에서 접속 상태는 다음과 같습니다.
Listening : 현재 열린 포트로써, 누군가의 접속을 기다리는 포트
Established : 정상적으로 연결이 된 포트
Time_wait : 접속 후 다른 명령이나 신호를 기다리는 상태
 
그중 열린 포트 번호를 적으시고 아래 표를 참조하여 필요하지 않은 서비스 데몬이 실행중이면 닫아주시면 됩니다.
이런 데몬 실행 상태는 /etc/inetd.conf 파일을 열어보시면 됩니다.
해당하는 서비스를 실행하지않고 싶을 경우 # 주석문으로 처리하면 됩니다.
 
리부팅했을 때 적용하고 싶은 경우에는 아래 KIDC 서버 보안책에 나온 방법을 참조하시기 바랍니다.
listen,Established,Time_wait 이라고 나와 있지 않으면 실행이 되고 있지 않으므로 걱정안하셔도 됩니다.



























































































































































데몬


기능, 실행확인, 중지방법


권장여부


Amd

Automount데몬, 해당서버의 파일접근시 자동으로 마운트

# rpcinfo -p localhost => 실행 확인

# /etc/rc.d/init.d/amd stop => 실행 중지

# chmod a-x /etc/init.d/amd => 다음 boot시에 실행중지

아니요


Boot

paramd 구형 Sun 워크스테이션 boot시 필요한 데몬

# rpcinfo -p localhost

# /etc/rc.d/init.d/bootparamd stop

# chmod a-x /etc/rc.d/init.d/bootparamd

아니요


Gated

OSPF 라우팅 데몬, 현재 한양대학교 시스템은 라우팅 필요없음

# netstat -a => UDP 포트 520 번이 열려있는지 확인

# /etc/rc.d/init.d/gated stop

# chmod a-x /etc/rc.d/init.d/gated

아니요


Httpd

WWW 서비스 데몬

# netstat -a => TCP 포트 80 번이 열려있는지 확인

# /etc/rc.d/init.d/httpd stop

# chmod a-x /etc/rc.d/init.d/httpd

웹서비스필수


Ircd

인터넷 채팅 데몬(Internet Relay Chat)

# netstat -a => TCP 포트 4400,6667,6668,7000

UDP 포트 7007 이 열려있는지 확인

# /etc/rc.d/init.d/ircd stop

# chmod a-x /etc/rc.d/init.d/ircd

사용시에만


Lpd

프린터 데몬, lpr 명령어 사용시 사용되어짐

# netstat -a => TCP 포트 515번이 열려있는지 확인

# /etc/rc.d/init.d/lpd stop

# chmod a-x /etc/rc.d/init.d/lpd

프린터없으면

불필요


mcserv

MC(Midnight Commander)의 서버, 외부에서 MC를 이용해 접속가능

# netstat -a => TCP포트 3,1024 번이 열려있는지 확인

# /etc/rc.d/init.d/mcserv stop

# chmod a-x /etc/rc.d/init.d/mcserv

아니요


named

DNS 서비스 데몬(도메인 이름을 IP로 바꾸는 서비스)

# netstat -a => TCP,UDP 포트 53번이 열려있는지 확인

# /etc/rc.d/init.d/named stop

# chmod a-x /etc/rc.d/init.d/named

멀티도메인경우


nfs

nfs(Network File System) 데몬을 띄우는 스크립트

rpc.nfsd, rpc.mountd 데몬이 수행, nfs 서버로 운영되는 경우만 사용

# rpcinfo -p localhost => mountd와 nfs가 등록되었는지 확인

# /etc/rc.d/init.d/nfs stop

# chmod a-x /etc/rc.d/init.d/nfs

아니요


portmap

RPC 서비스 연결을 제어하는 역할을 수행

# netstat -a => TCP,UDP 111번이 열려 있는지 확인

# /etc/rc.d/init.d/portmap stop

# chmod a-x /etc/rc.d/init.d/portmap

꼭 닫을것


routed

RIP 라우팅 프로토콜 데몬

# netstat -a => UDP 포트 520번이 열려있음

# /etc/rc.d/init.d/routed stop

# chmod a-x /etc/rc.d/init.d/routed

아니요


sendmail

e-mail을 주고 받는 데몬

메일서버로 사용하지 않은 경우 필요 없음

# netstat -a => TCP 포트 25번이 열려져 있는지 확인

# /etc/rc.d/init.d/sendmail stop

# chmod a-x /etc/rc.d/init.d/sendmail

필요에따라


smb

Samba 서비스(리눅스와 윈도우의 파일이나 프린터자원 공유) 제공,

smbd, nmbd 데몬을 수행

# netstat -a => TCP 포트 139, UDP 포트 137,138 확인

# /etc/rc.d/init.d/smb stop

# chmod a-x /etc/rc.d/init.d/smb

아니요


snmpd

네트워크 상황을 모니터링할 때 사용되는 데몬

# netstat -a => UDP 포트 161번 확인

# /etc/rc.d/init.d/snmpd stop

# chmod a-x /etc/rc.d/init.d/snmpd

아니요


squid

HTTP,Gopher,Ftp등의 캐싱을 담당하는 프락시 데몬

# netstat -a => TCP 포트 3128, UDP 포트 3130 확인

# /etc/rc.d/init.d/squid stop

# chmod a-x /etc/rc.d/init.d/squid

아니요


syslog

시스템에서 일어나는 여러가지 상황을 기록해주는 데몬

다음의 명령어는 syslog를 작동하지 못하게 하는 것임

정상 작동중이라면 아래의 중지 및 변경 명령어를 수행하지 말 것

# netstat -a => UDP 포트 514 번 확인

# /etc/rc.d/init.d/syslog stop

# chmod a-x /etc/rc.d/init.d/syslog

사용필수


xntpd

현재시간을 세계유명 time 관련 사이트에 주기적으로 비교하여

시간을 맞추어주는 NTP(Network Time Protocol) 데몬

# netstat -a => UDP 포트 123 번 확인

# /etc/rc.d/init.d/xntpd stop

# chmod a-x /etc/rc.d/init.d/xntpd

아니요


inet

인터넷 관련 데몬(telnetd, ftpd, fingerd, rlogind 둥)을 실행 시킬수 있게 하는 데몬,

일반적으로 수행하고 해당 서비스 데몬을 수행하지 못하도록 inetd.conf 파일을 수정함

# /etc/rd.d/init.d/inet stop

# chmod a-x /etc/rc.d/init/inet

사용안하는게좋음


ftp

inetd.conf를 수정하여 각종 서비스의 수행을 제한

# netstat -a => TCP 포트 21번 확인

# vi /etc/inetd.conf (ftp로 시작하는 라인을 #으로 막음)

# killall -HUP inetd => 대소문자 구별을 정확히 할 것

필요에 의하여


telnet

ftp와 동일한 방법, TCP 포트 23번 확인 telnet으로 시작하는 라인을 #으로 막음
필요에의하여


gopher

ftp와 동일한 방법, TCP 포트 70번 확인 gopher로 시작하는 라인을 #으로 막음
필요시만


shell

원격지에서 접근하는 rsh의 수행을 제한

/etc/hosts.equiv를 /dev/null로 링크 시킬 것 ftp와 동일한 방법

TCP 포트 514번 확인, shell로 시작하는 라인을 #으로 막음

절대 아니요


login

원격지에서 접근하는 rlogin의 수행을 제한

/etc/hosts.equiv를 /dev/null로 링크 시킬 것 ftp와 동일한 방법,

TCP 포트 513번 확인 login로 시작하는 라인을 #으로 막음

절대아니요


pop-2, pop3

외부에서 e-mail을 받아가서 확인할 때 사용되는 서비스 ftp와 동일한 방법,

TCP 포트 109, 110번 확인 pop-2,pop-3로 시작하는 라인을 #으로 막음

불필요시


talk& ntalk

UDP 포트 517, 518번 확인, ftp막는법과 같음
사용안하는게좋음


imap

TCP 포트 143 번 확인, ftp막는법과 같음
사용안하는게좋음


finger

TCP 포트 79번 확인, ftp막는법과 같음
사용안하는게좋음


time

TCP 포트 37번 확인, ftp막는법과 같음
사용안하는게좋음


auth

TCP 포트 113번 확인, ftp막는법과 같음
사용안하는게좋음


 
# /etc/rd.d/init.d/inet restart
서버 관련 보안방법과 연계해서 보시면 도움이 됩니다.

 


 


출처< http://neosight.net/neosight_board/server02/files/1_%BA%B8%BE%C8.html>

2005/12/30 14:23 2005/12/30 14:23
Trackback address :: http://4ellene.net/tt/trackback/675
  1. play free casino games

    Tracked from casinos free slots 2009/03/30 15:00  삭제

    top 30 casinos online

  2. free viagra

    Tracked from buy viagra online 2009/04/03 17:52  삭제

    buying viagra online

  3. Tracked from forced sex vids 2009/04/13 02:22  삭제

    forced sex videos

  4. Tracked from forced sex tube 2009/04/13 12:15  삭제

    forced sex trailers

  5. rape incest

    Tracked from rape incest porn 2009/04/14 16:15  삭제

    rape in the movies

  6. nude girl forced

    Tracked from pictures forced feminization 2009/04/14 17:48  삭제

    men forced to womanhood

  7. free bondage pics

    Tracked from free bondage pictures 2009/04/15 01:08  삭제

    free bondage movies

  8. brutal rape porn

    Tracked from brutal sex 2009/06/29 08:00  삭제

    young rape victims

  9. rape porn sites

    Tracked from rape seed 2009/06/29 08:20  삭제

    nurse rape

  10. asian rape porn

    Tracked from rape club 2009/06/29 18:39  삭제

    amsterdam porn rape

  11. cop rape

    Tracked from extreme cumshots 2009/06/29 21:55  삭제

    rape games

  12. true rape stories

    Tracked from young rape victims 2009/06/29 23:42  삭제

    comic rape

  13. forced asian sex

    Tracked from rape and abortion 2009/06/30 08:45  삭제

    forced sex reporter

  14. forced to fuck sex videos

    Tracked from wife rape 2009/06/30 08:57  삭제

    forced sex photos

  15. anime rape

    Tracked from brutal comics 2009/06/30 19:22  삭제

    rape in a van porn

  16. real rape pictures

    Tracked from forced sex comics 2009/06/30 22:10  삭제

    young ape anal rape

  17. forced to suck cock

    Tracked from rape photos 2009/07/01 01:25  삭제

    forced sex with animals

  18. anal rape porn

    Tracked from movie rape scenes 2009/07/01 01:54  삭제

    nurse rape

  19. girl forced sex

    Tracked from rape gang young 2009/07/01 02:24  삭제

    forced incest

  20. rape torture

    Tracked from little girl rape 2009/07/01 10:52  삭제

    rape pictures stories

  21. rape games

    Tracked from gary roberts rape 2009/07/01 12:54  삭제

    forced sex trailers

  22. illegal girl rapes

    Tracked from rape flicks 2009/07/01 16:30  삭제

    wife rape

  23. fetish forced sex

    Tracked from incest rape stories 2009/07/01 16:40  삭제

    rape sex stories

  24. hardcore rape porn

    Tracked from extreme board rape 2009/07/01 22:55  삭제

    rape pics

  25. public rape

    Tracked from rape mpg 2009/07/02 01:20  삭제

    male rape porn

  26. reality porn rape

    Tracked from mature rape 2009/07/03 09:26  삭제

    rape films

  27. forced lesbian sex

    Tracked from rape young 2009/07/04 14:01  삭제

    crime rape

  28. violent fucking

    Tracked from rape fetish 2009/07/05 11:08  삭제

    amsterdam porn rape

  29. underground rape porn

    Tracked from forced lesbian sex 2009/07/06 19:45  삭제

    forced sex fantasy

  30. public rape

    Tracked from rape anal 2009/07/06 20:29  삭제

    men forced to womanhood

  31. rape trailers

    Tracked from sister rape 2009/07/09 17:00  삭제

    war women rape

  32. casino betting

    Tracked from casinos 2009/07/10 06:22  삭제

    no bonus online casinos

  33. free online casino games

    Tracked from free online casino slots 2009/07/10 14:37  삭제

    no download casino

  34. online casinos with freeroll slot tournaments

    Tracked from casino gambling online 2009/07/11 18:44  삭제

    poker games online

  35. casinos online

    Tracked from reliable online casinos 2009/07/12 09:27  삭제

    u s online casinos

  36. online casino game

    Tracked from casino web sites 2009/07/13 09:38  삭제

    casino tour

  37. online casino australia

    Tracked from no deposit online casino 2009/07/14 03:33  삭제

    internet casino

  38. canadian online casinos

    Tracked from international online casinos 2009/07/14 17:52  삭제

    online casino guide

  39. free money online casinos

    Tracked from casino deposit bonus 2009/07/14 23:17  삭제

    online casinos for american players

  40. casino http

    Tracked from online internet casino 2009/07/15 08:01  삭제

    online casino reviews bonuses

  41. online casino guide

    Tracked from casino open usa 2009/07/15 16:59  삭제

    us online casino

  42. no download online casinos

    Tracked from casino http 2009/07/15 23:41  삭제

    no deposit online usa casion

  43. new no deposit online casinos

    Tracked from online casinos for american players 2009/07/16 04:19  삭제

    international online casinos

  44. united states online casino

    Tracked from online casino games 2009/07/16 08:48  삭제

    online casino guide

  45. casino guide http

    Tracked from online internet casino 2009/07/17 01:08  삭제

    american casinos online play

  46. free casino

    Tracked from online casinos with freeroll slot tournaments 2009/07/17 03:00  삭제

    casino http

  47. new online casino

    Tracked from free online casino games 2009/07/17 22:08  삭제

    reliable online casinos

  48. united states online casino

    Tracked from play casino games online 2009/07/18 02:17  삭제

    online usa casinos

  49. free online casino chip

    Tracked from free online casino games 2009/07/18 03:18  삭제

    online casinos in the united states

  50. casino supplies

    Tracked from reputable online casino 2009/07/18 06:33  삭제

    java internet casino

  51. casino sites

    Tracked from web casino 2009/07/18 21:51  삭제

    online casino reviews

  52. singapore transexuals

    Tracked from transexual escort london 2009/07/20 05:11  삭제

    japanese ladyboy

  53. shemale girl

    Tracked from transvestite pictures 2009/07/20 13:52  삭제

    shemale escorts

  54. amateur transvestite

    Tracked from perfect ladyboy 2009/07/20 21:36  삭제

    chinese ladyboy

  55. ladyboy dicks

    Tracked from ladyboy pussy 2009/07/21 00:54  삭제

    japanese ladyboys

  56. ladyboys in brazil

    Tracked from ladyboy amy 2009/07/21 05:52  삭제

    shemale gangbang

  57. post-op transexual

    Tracked from transvestite lingerie 2009/07/21 11:24  삭제

    tranny bondage

  58. perfect ladyboys

    Tracked from hot trannys 2009/07/21 19:05  삭제

    futanari links

  59. transgender fiction

    Tracked from tranny ass 2009/07/21 22:56  삭제

    futanari galleries

  60. transvestite slut

    Tracked from ladyboy riding 2009/07/22 15:35  삭제

    post op transsexuals

  61. transvestite

    Tracked from tranny clips 2009/07/22 16:05  삭제

    japanese ladyboy

  62. transvestite services

    Tracked from shemale cocktail 2009/07/22 23:47  삭제

    nancy ladyboy

  63. shemale galleries

    Tracked from ladyboy pics 2009/07/23 00:42  삭제

    tranny fucks girl

  64. ladyboy tube videos

    Tracked from transexual chat 2009/07/23 01:44  삭제

    tranny seduction

  65. black transsexuals

    Tracked from post op ladyboy 2009/07/23 09:37  삭제

    young tranny

  66. naruto futanari

    Tracked from las vegas transvestites 2009/07/23 10:55  삭제

    transgender sex

  67. tranny cumshots

    Tracked from transexual gallery 2009/07/23 11:48  삭제

    ladyboy

  68. chinese ladyboys

    Tracked from young ladyboys 2009/07/24 02:40  삭제

    tranny clips

  69. huge tranny

    Tracked from transvestite chat 2009/07/24 04:20  삭제

    ladyboy thumbs

  70. mom strips for son

    Tracked from mom son sex 2009/09/06 04:19  삭제

    moms fucking sons

  71. Fucked Her Son

    Tracked from incest lesbian stories 2009/09/06 07:10  삭제

    Moms Fucking Sons

  72. Daughter Incest Incest

    Tracked from Incest Porn 2009/09/06 10:03  삭제

    Cartoon Incest

  73. Family Sex Stories

    Tracked from Family Sex Clips 2009/09/06 12:33  삭제

    family naturist

  74. Daughter Incest Incest

    Tracked from Incest Porn 2009/09/07 00:24  삭제

    Cartoon Incest

  75. Free Incest Sex Stories

    Tracked from family incest 2009/09/07 21:00  삭제

    free incest

  76. incest art

    Tracked from incest cartoons 2009/09/08 08:22  삭제

    lesbian incest

  77. free incest porn

    Tracked from amateur incest family porn 2009/09/08 14:12  삭제

    free incest porn stories

  78. family nudist galleries

    Tracked from family nude 2009/09/08 23:30  삭제

    family orgy

  79. sister nude

    Tracked from brother sister incest 2009/09/09 09:15  삭제

    sister fucking brother

  80. Family Incest Galleries

    Tracked from Taboo Family Sex 2009/09/09 09:55  삭제

    Amateur Incest Family Porn

  81. amateur incest family porn

    Tracked from incest porn 2009/09/09 10:12  삭제

    free incest porn

  82. mom and son sex

    Tracked from mom son sex 2009/09/10 01:03  삭제

    Free Mom And Son Sex

  83. bdsm sex movies

    Tracked from bdsm sex 2009/09/11 01:37  삭제

    bdsm slave

  84. sex bondage

    Tracked from self bondage stories 2009/09/11 03:33  삭제

    sex punishment

  85. sex punishment from daddy

    Tracked from sex punishment 2009/09/12 06:29  삭제

    sex slave

  86. bdsm couples

    Tracked from bdsm comix 2009/09/12 07:07  삭제

    bdsm for all

  87. bdsm art

    Tracked from bdsm anal 2009/09/12 09:47  삭제

    bdsm artwork

  88. bondage fix

    Tracked from bondage fairies 2009/09/12 20:57  삭제

    bondage fuck

  89. worst tortures

    Tracked from world domination 2009/09/12 21:16  삭제

    xxx bondage

  90. bondage

    Tracked from bedroom bondage 2009/09/13 00:15  삭제

    bondage and discipline

  91. bdsm comix

    Tracked from bdsm comics 2009/09/13 05:43  삭제

    bdsm couples

  92. bdsm slave

    Tracked from bdsm sites 2009/09/14 11:10  삭제

    bdsm stories

  93. bondage clips

    Tracked from bondage cafe 2009/09/14 11:43  삭제

    bondage comics

  94. female torture

    Tracked from female domination stories 2009/09/16 06:04  삭제

    femdom bondage

  95. teen bdsm

    Tracked from suspension bondage 2009/09/16 06:39  삭제

    teen bondage

  96. rope bondage

    Tracked from real torture 2009/09/16 13:29  삭제

    russian torture technique

  97. feminine domination

    Tracked from femdom bondage 2009/09/17 17:54  삭제

    gay bondage

  98. father daughter porn

    Tracked from father fucks daughter 2009/09/27 12:01  삭제

    incest porn

  99. Moms Fucking Sons

    Tracked from Fucked Her Son 2009/09/27 12:36  삭제

    Mom And Son Sex Galleries

  100. dad fucks daughter

    Tracked from daughter incest incest 2009/09/27 15:27  삭제

    dad fucking daughter

  101. incest mother and daughter

    Tracked from mother daughter lesbian sex 2009/09/28 11:13  삭제

    incest stories

  102. young incest

    Tracked from twin sisters fucking 2009/09/28 13:57  삭제

    twin sisters naked

  103. free incest

    Tracked from Free Incest Sex Stories 2009/10/01 17:15  삭제

    incest pics

  104. daddy and little girl fantasy

    Tracked from daddies and sons gay 2009/10/02 08:32  삭제

    daddies fucking daughters

  105. dad fucking daughter

    Tracked from hentai incest 2009/10/02 21:57  삭제

    dad fucks daughter

  106. Family Porn

    Tracked from family incest 2009/10/03 07:41  삭제

    nude family

  107. twin sisters naked

    Tracked from twin sisters fucking 2009/10/03 08:25  삭제

    young incest

  108. mom daughter sex

    Tracked from free incest porn videos 2009/10/03 09:13  삭제

    incest porn gallery

  109. dad daughter nude sex

    Tracked from dad and daughter sex 2009/10/04 07:26  삭제

    daughter incest incest

  110. daughter sex

    Tracked from daughter incest incest 2009/10/04 10:40  삭제

    daughter nude

  111. bdsm personals

    Tracked from bdsm pics 2009/10/20 09:08  삭제

    bdsm pictures

  112. self bondage stories

    Tracked from sex bondage 2009/10/20 09:09  삭제

    sexy bondage

  113. bdsm fiction

    Tracked from bdsm for all 2009/10/20 09:16  삭제

    bdsm free

  114. lesbian bdsm

    Tracked from male bdsm 2009/10/21 16:24  삭제

    public bdsm

  115. free bondage pictures

    Tracked from free bondage porn 2009/10/21 18:43  삭제

    free bondage stories

  116. bondage anal

    Tracked from bondage and discipline 2009/10/22 09:26  삭제

    bondage anime

  117. black bdsm

    Tracked from ebony bdsm 2009/10/22 10:34  삭제

    ero bdsm

  118. bondage girls

    Tracked from bondage hentai 2009/10/23 17:08  삭제

    bondage movies

  119. bdsm cartoons

    Tracked from bdsm clips 2009/10/23 18:42  삭제

    bdsm comics

Comments List

  1. circumcised females 2008/05/23 06:59

  2. lossless legs 2008/05/23 07:52

Write a comment.

[로그인][오픈아이디란?]