SSH 보안관련 질문입니다.

jjaiwook79의 이미지

사용하고 있는 시스템은 Redhat9.0 입니다. 가끔 /var/log/messages, secure 등을 보면

Dec 3 01:22:38 ultra sshd[7392]: Failed password for root from 210.109.171.5 port 53730 ssh2
Dec 3 01:22:41 ultra sshd[7394]: Failed password for root from 210.109.171.5 port 54197 ssh2
Dec 3 01:22:43 ultra sshd[7396]: Failed password for root from 210.109.171.5 port 54649 ssh2

이런류의 로그를 보게 됩니다. 스크립트를 통해서 접속을하려고 하는 것인지 아니면 윈도우상의 윔인지 알수는 없지만 상당히 거슬립니다. 그래서 질문드립니다.

SSH설정중에 일정시간 동안 반복되는 로그인실패를 하는 사용자의 IP를 차단하는 그러한 설정은 없나요? 아니면 script를 만들어 사용하고 계신분이 있다면 공유해 주셨으면 합니다.

이은태의 이미지

안녕하십니까? 오늘과내일의 홍석범입니다.

최근 포트스캔의 양상과 관련하여 특이한 사항이 있어 메일을 드립니다.

일반적으로 새로운 취약성과 더불어 공격코드가 공개되면 해당 포트로의 스캔이
증가하는 현상이 있는데, 이러한 것과는 별개로 즉, 취약성이 없는데도
단지 취약한 암호를 사용하는 응용프로그램에 대한 스캔의 증가가 그것입니다.


* ssh 의 포트스캔

최근 다양한 ip 에서 광범위하게 ssh(22/tcp) 서비스에 대한 스캔이
발견되었습니다. 로그는 아래와 같이 보이게 되는데,
test, guest, admin, root 유저에 대해 암호가 없거나 암호가 단순한
계정에 대한 brute 접속시도를 하는 것입니다.

21:51:43 services sshd[695]: Illegal user test from xxx.228.156.19
21:51:44 services sshd[697]: Illegal user guest from xxx.228.156.19
21:51:46 services sshd[699]: Illegal user admin from xxx.228.156.19
21:51:47 services sshd[701]: Illegal user admin from xxx.228.156.19
21:51:48 services sshd[703]: Illegal user user from xxx.228.156.19

아래는 위의 스캔과 관련하여 최근에 발견된 공격코드중 일부인데, 별도의 사전파일을 사용
하지 않고
소스에 직접 2,000여개의 암호가 포함되어 있는 것은 흔하지 않은 사례인것 같습니다.

checkauth("test","test",buff);
checkauth("guest","guest",buff);
checkauth("admin","admins",buff);
checkauth("admin","admin",buff);
checkauth("user","user",buff);
checkauth("root","password",buff);
checkauth("root","root",buff);
checkauth("root","123456",buff);
checkauth("test","123456",buff);
checkauth("test","12345",buff);
checkauth("test","1234",buff);
checkauth("test","123",buff);
checkauth("root","!@#$%",buff);
checkauth("root","!@#$%^",buff);
checkauth("root","!@#$%^&",buff);
checkauth("root","!@#$%^&*",buff);
checkauth("root","*",buff);
checkauth("root","000000",buff);
........


이번 기회에 John the ripper 등을 이용하여 시스템내 취약한 암호는 없는지 여부를
체크해 보시는 것이 좋을것 같습니다.
http://www.openwall.com/john/

또한 ssh.com 이나 openssh 에서 자체적으로 제공하는 접근통제 설정을 통해
사전에 허용된 ip 에서만 접근할 수 있도록 하는 방법도 좋겠습니다.


* radmin(4899/tcp) 의 포트스캔

아래와 같이 언제부턴가 4899/tcp 의 포트스캔이 자주 확인되고 있습니다.

Aug 22 04:56:32 211.50.55.61:51896 -> 211.47.xx.32:4899 SYN ******S*
Aug 22 04:56:32 211.50.55.61:41682 -> 211.47.xx.41:4899 SYN ******S*
Aug 22 04:56:33 211.50.55.61:36376 -> 211.47.xx.103:4899 SYN ******S*
Aug 22 04:56:36 211.50.55.61:51695 -> 211.47.xx.141:4899 SYN ******S*
Aug 22 04:56:34 211.50.55.61:44132 -> 211.47.xx.150:4899 SYN ******S*
Aug 22 04:56:34 211.50.55.61:36238 -> 211.47.xx.160:4899 SYN ******S*
Aug 22 04:56:34 211.50.55.61:15927 -> 211.47.xx.213:4899 SYN ******S*

4899/tcp 는 PC Anywhere 와 같이 radmin 이라는 Windows 기반의 원격관리
프로그램이 사용하는 포트인데,
(http://www.radmin.com/ 또는 http://www.radmin.co.kr/)
현재까지 radmin 이라는 프로그램의 취약성이 발견된 바는 없는 것으로 보아
설치할 때 기본적으로 암호 설정 없이 설치되는 취약성을 이용하는 것으로 보입니다.
혹, radmin 을 이용하여 원격 관리하시는 분이 있다면 자체에서 제공하는
암호 변경 및 IP Filter 기능을 이용하여 접근 제어를 하시면 됩니다.

위의 대표적인 두 포트스캔의 경우 irc bot 과 밀접하게 관련이 있는 것으로 보이며
(1) bot 에 감염된 서버가 적지 않고, (2) 일부 해킹된 시스템에서는 DDoS와 관련된
각종 툴이 발견되는 것으로 보아 여러 부작용이 발생할 가능성도 있다고 봅니다.

악성 bot 이란?
http://www.krcert.or.kr/event/bot/bot.htm


참고하시기 바랍니다.

sshd는 리눅스 서버이용상 반드시 사용해야 하는 것이며 사전공격에 등재된 로깅아이디에 대한 패스워드 설정을 강화하셔야 합니다.
AllowUsers,DenyUsers,ListenAddress등도 적절히 설정해보아요

:-)

Necromancer의 이미지

포트를 바꿔서 돌리세요.

포트 바꾸는 것만으로도 봇으로 공격하는거는 99% 막을 수 있습니다.
물론 맘먹고 들어올려고 한다면 알아낼 수는 있죠. 이때문에
암호나 보안업데이트도 물론 해줘야 하죠.

Written By the Black Knight of Destruction

opt의 이미지

radmin 의 경우 zone-h.org 사이트의 exploit 게시판에 공격 도구 관련 정보가 올라와 있습니다.

http://forum.zone-h.org/viewtopic.php?t=1251

radmin 의 password 를 설정하지 않은 문제를 공격하는 도구 맞습니다.

----
LUX ET VERITAS | Just for Fun!

realcns의 이미지

왠만한 프로그램들에는 다..
백도어가 있네요.!!

모든 OS를 사용해보자~!!
-놀고먹는백수가 되고 싶은 사람-

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.