close
  • 홈
  • :
  • 위치로그
  • :
  • 태그
  • :
  • 방명록
  • :
  • 관리자
  • :
  • 새글쓰기
블로그 이미지

이슬나라 [isulnara.com]
프로그램 관련 문의...
전체 (184)
자작 프로그램 (23)
EzIP (3)
IEPageSetup (3)
iSysInfoX (2)
메신저 알림이 (1)
ezSVC (1)
WebFTP (2)
iDebugX (1)
기타 (9)
버그 신고 (1)
이것저것.. (55)
WebFTP 게시판 (0)
팁 모음 (72)
linux (17)
프로그래밍 (35)
윈도우 (5)
네크워크 (7)
기타 (7)
윈도우 숨은.. (4)
터미널 서비스.. (1)
공개 웹하드 (1)
관리자 (0)
PC 원격제어.. (1)
NAS (25)
«   2010/09   »
일 월 화 수 목 금 토
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
아파치 arm usbcopy 로딩 splash MACAddress hosts.deny emulator 콘솔프로그램 rsync xbmc proxy surveillance open_basedir SQL Server android expect 메신저 텍스트큐브 SimpleSMS SQLSERVER bash jndi dspack JDBC 아이피설정 VMWare 아이피변경 MAC Address 지그비
[NAS] Synology DS101...
[안드로이드] 스플래...
[android] android_wi...
이전 달의 파일을 특...
Synology FileStation...
저도 지금 테스트해보니...
isul / 09/08
IE8에 플래시 사용한 웹...
isul / 09/08
안녕하세요.. zbs-100은...
isul / 09/08
안드로이드에서도 시리얼...
isul / 09/08
안드로이드 기반에서 시...
소바 / 09/08
일반 어플리케이션을 서...
ㅇㅇ/ / 2009
사이코웨어 : nProtect,...
√ MIRiyA's AstraLog / 2008
웹페이지에서 인쇄시 머...
醉生夢死™ / 2006
웹페이지에서 MAC Addres...
날자~!! 날어~!! / 2005
 최근글 목록
 2010/09 [1]
 2010/08 [4]
 2010/07 [1]
 2010/06 [2]
 2010/05 [1]
넷하드
무료 원격제어 프로그램
바이러스제로
솔라리스 테크넷
스티브 맥코넬
파워해커
하얀나무's Story
Total of
331578 visitors
Today 190
Yesterday 270
 
글검색결과[DenyHosts] : 1
2008/12/01  DenyHosts로 sshd brute-force attack 막기 (2)
     
 NAS 
DenyHosts로 sshd brute-force attack 막기
Posted on 2008/12/01 21:33
 
 
 
 

What is DenyHosts?

"DenyHosts is a script intended to be run by Linux system administrators to help thwart SSH server attacks (also known as dictionary based attacks and brute force attacks).

If you've ever looked at your ssh log (/var/log/secure on Redhat, /var/log/auth.log on Mandrake, etc...) you may be alarmed to see how many hackers attempted to gain access to your server. Hopefully, none of them were successful (but then again, how would you know?). Wouldn't it be better to automatically prevent that attacker from continuing to gain entry into your system?

DenyHosts attempts to address the above.."

http://denyhosts.sourceforge.net/

사용된 버전: DenyHosts-2.6


1. python 설치(설치 안되어 있을 경우)
fs> ipkg install python24


2. DenyHosts-2.6.tar.gz 다운로드
:
http://downloads.sourceforge.net/denyhosts/DenyHosts-2.6.tar.gz?modtime=1165494115&big_mirror=0


3. DenyHosts-2.6 설치

fs> tar xvzf DenyHosts-2.6.tar.gz
fs> cd DenyHosts-2.6
fs> python setup.py install
fs> cp -R DenyHosts /usr/share/denyhosts
fs> ln -s /usr/share/denyhosts/DenyHosts /usr/bin/DenyHosts
fs> cd /usr/share/denyhosts
fs> cp denyhosts.cfg-dist denyhosts.cfg
fs> cp daemon-control-dist daemon-control
fs> chown root daemon-control
fs> chmod 700 daemon-control


4. /usr/share/denyhosts/denyhosts.cfg 수정
# Debian:
SECURE_LOG = /var/log/messages

# Another possibility (also see the next option):
HOSTS_DENY = /etc/hosts.evil

# http://denyhosts.sourceforge.net/faq.html#aux
BLOCK_SERVICE =   

# Debian
LOCK_FILE = /var/run/denyhosts.pid

# To enable synchronization, you must uncomment the following line:
SYNC_SERVER = http://xmlrpc.denyhosts.net:9911

# The default is SYNC_UPLOAD = yes
#
SYNC_UPLOAD = no

# The default is SYNC_DOWNLOAD = yes
#
#SYNC_DOWNLOAD = no
SYNC_DOWNLOAD = yes


5. /usr/share/denyhosts/daemon-control 수정
DENYHOSTS_LOCK = "/var/run/denyhosts.pid"


6. /etc/hosts.deny 설정

ALL: /etc/hosts.evil


7. 차단할 IP 주소를 기록할 파일 생성
fs> touch /etc/hosts.evil


8. 자동 실행 설정: /etc/rc.local 수정
# denyhosts
/usr/share/denyhosts/daemon-control start


9. DenyHosts 실행(최초 1회)
fs> /usr/share/denyhosts/daemon-control start


10. /etc/hosts.evil 확인: 아래와 같은 형식으로 공격자의 IP 주소가 기록됨
62.193.233.132
80.24.4.23
210.15.200.92
81.138.41.99
193.231.3.97
201.0.145.106
168.167.229.166
24.232.77.40
213.251.154.165



*. 참고사항
/usr/share/denyhosts/daemon-control start 실행 시 다음과 같은 에러가 발생할 경우
starting DenyHosts:    /usr/bin/env python /usr/bin/denyhosts.py --daemon --config=/usr/share/denyhosts/denyhosts.cfg
Traceback (most recent call last):
  File "/usr/bin/denyhosts.py", line 5, in ?
    import DenyHosts.python_version
  File "/usr/bin/DenyHosts.py", line 5, in ?
    import DenyHosts.python_version
ImportError: No module named python_version
에는 다음과 같이 처리하면 됩니다.
fs> cp -R DenyHosts /usr/share/denyhosts
fs> ln -s /usr/share/denyhosts/DenyHosts /usr/bin/DenyHosts


설치 과정은 다음 사이트를 참고하였습니다.
http://www.howtoforge.com/preventing_ssh_dictionary_attacks_with_denyhosts
Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
이올린에 북마크하기(0) 이올린에 추천하기(0)
brute-force attack, DenyHosts, SSH
Trackback [0] : Comment [2]
TrackbackAddress
http://isulnara.com/tt/trackback/178
OLVR 수정/삭제 답변하기
2010/04/17 05:10
user> python setup.py install
-ash: python: not found

라면서 진행이 안되는데, 분명히 ipkg install python24 해서 설치가 된 것 같거든요? 혹시 무슨 문제인지 알고 계실까요? 제가 워낙 초보라;;
BlogIcon isul 수정/삭제
2010/04/18 20:33
python이 제대로 설치가 안된 거 같습니다.
ll /opt/bin/python
명령을 내려보세요..
전 위 명령을 내리니
/opt/bin/python -> python2.5
이렇게 되어 있네요.. 이 글을 작성한 후 업데이트 되어서 2.5로 나온 것 같습니다.
혹시 /opt/bin/python이 없다면
ln -s /opt/bin/python2.4 /opt/bin/python
명령으로 링크를 걸어주세요.
SecretComment
  1