반응형

메타스플로잇은 가장 널리 사용되는 모의 해킹과 개발 프레임워크로, 취약점과 익스플로잇을 찾아내서 개발하는데 가장 널리 쓰이는 도구

메타스플로잇 프레임워크의 유용한 기능 중 하나는 프레임워크에 포함된 모듈과 도구를 커맨드라인에서 실행이 가능하다.


익스플로잇 정의 ??

익스플로잇(Exploit)이란 소프트웨어, 하드웨어 및 전자제품들의 버그 혹은 제조, 프로그래밍 과정에서 발생한 취약한 부분을 이용하여 정상 동작이 아닌 공격자가 의도한 동작이나 명령을 실행하도록 만든 명령어를 지칭하거나, 그러한 공격행위를 가리킵니다.


익스플로잇은 소프트웨어나 하드웨어 등의 버그나 취약점을 이용한 공격인 만큼, 비교적 대규모로 이루어 지며, 특정 타겟 뿐만 아니라 불특정 다수에게도 무차별적으로 공격을 가합니다. 보편적인 예로, 불특정 다수에게 익스플로잇 코드가 담긴 첨부파일(그림,문서 등)과 함께 흥미를 끌만한 제목으로 메일을 보냅니다. 만약 취약점이 패치가 되지 않은 OS나 SW를 사용하는 사용자가 그 메일에 담긴 첨부파일을 클릭하면, 첨부파일 안에 있던 명령 코드가 작동하면서 사용자의 컴퓨터를 공격하게 됩니다.


또한 알려지지 않은 취약점 또는 취약점이 새로 발견되었으나 아직 해당 취약점에 대한 패치가 이뤄지지 않은 제로데이 상황에서 익스플로잇 공격이 발생하는 경우가 종종 발생하는데, 이때는 공격대상이 되는 프로그램 제공업체가 배포한 임시패치를 설치하거나 익스플로잇 공격대상이 되는 서비스나 SW의 사용을 최대한 자제하는 것이 안전합니다.


익스플로잇 공격은 소프트웨어나 하드웨어 자체의 취약점을 이용한 공격이기 때문에 소프트웨어나 하드웨어 취약점이 이미 업데이트(패치)가 되어있는 사용자는 아무런 피해를 입지 않습니다. 또한 컴퓨터에 백신프로그램이 설치 되어 있다 해도, 프로그램에 관한 업데이트를 하지 않았더라면, 익스플로잇 공격을 100%막기에 한계가 있습니다. 

출처 : https://www.estsecurity.com/securityCenter/commonSense/view/41 (알약)

 

메타익스플로잇은 다음과 같이 실행하게 됩니다. msfconsle을 입력하면 아래와 같이 msf 데몬에 접속 하게 됩니다.


root@choi:/# msfconsole



                                   .,,.                  .

                                .\$$$$$L..,,==aaccaacc%#s$b.       d8,    d8P

                     d8P        #$$$$$$$$$$$$$$$$$$$$$$$$$$$b.    `BP  d888888p

                  d888888P      '7$$$$\""""''^^`` .7$$$|D*"'```         ?88'

  d8bd8b.d8p d8888b ?88' d888b8b            _.os#$|8*"`   d8P       ?8b  88P

  88P`?P'?P d8b_,dP 88P d8P' ?88       .oaS###S*"`       d8P d8888b $whi?88b 88b

 d88  d8 ?8 88b     88b 88b  ,88b .osS$$$$*" ?88,.d88b, d88 d8P' ?88 88P `?8b

d88' d88b 8b`?8888P'`?8b`?88P'.aS$$$$Q*"`    `?88'  ?88 ?88 88b  d88 d88

                          .a#$$$$$$"`          88b  d8P  88b`?8888P'

                       ,s$$$$$$$"`             888888P'   88n      _.,,,ass;:

                    .a$$$$$$$P`               d88P'    .,.ass%#S$$$$$$$$$$$$$$'

                 .a$###$$$P`           _.,,-aqsc#SS$$$$$$$$$$$$$$$$$$$$$$$$$$'

              ,a$$###$$P`  _.,-ass#S$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$####SSSS'

           .a$$$$$$$$$$SSS$$$$$$$$$$$$$$$$$$$$$$$$$$$$SS##==--""''^^/$$$$$$'

_______________________________________________________________   ,&$$$$$$'_____

                                                                 ll&&$$$$'

                                                              .;;lll&&&&'

                                                            ...;;lllll&'

                                                          ......;;;llll;;;....

                                                           ` ......;;;;... .  .



       =[ metasploit v4.16.59-dev                         ]

+ -- --=[ 1769 exploits - 1008 auxiliary - 307 post       ]

+ -- --=[ 537 payloads - 41 encoders - 10 nops            ]

+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]


msf >


메타스플로잇은 사용자가 지정하는 실행모드에 따라 다양한 방식으로 실행된다. 실행 모드에 따라 모듈에 관한 다양한 정보를 얻을 수 있다. 실행모드에 따라 모듈에 관한 정보를 얻을 수 있다.


root@choi:/usr/share# msfconsole -x "use exploit/windows/smb/ms08_067_netapi;show info"

       Name: MS08-067 Microsoft Server Service Relative Path Stack Corruption

     Module: exploit/windows/smb/ms08_067_netapi

   Platform: Windows

       Arch:

 Privileged: Yes

    License: Metasploit Framework License (BSD)

       Rank: Great

  Disclosed: 2008-10-28


Provided by:

  hdm <x@hdm.io>

  Brett Moore <brett.moore@insomniasec.com>

  frank2 <frank2@dc949.org>

  jduck <jduck@metasploit.com>


Available targets:

  Id  Name

  --  ----

  0   Automatic Targeting

  1   Windows 2000 Universal

  2   Windows XP SP0/SP1 Universal

  3   Windows 2003 SP0 Universal

  4   Windows XP SP2 English (AlwaysOn NX)

  5   Windows XP SP2 English (NX)

  6   Windows XP SP3 English (AlwaysOn NX)

  7   Windows XP SP3 English (NX)

  8   Windows XP SP2 Arabic (NX)

  9   Windows XP SP2 Chinese - Traditional / Taiwan (NX)

  10  Windows XP SP2 Chinese - Simplified (NX)

  11  Windows XP SP2 Chinese - Traditional (NX)

  12  Windows XP SP2 Czech (NX)

  13  Windows XP SP2 Danish (NX)

  14  Windows XP SP2 German (NX)

  15  Windows XP SP2 Greek (NX)

  16  Windows XP SP2 Spanish (NX)

  17  Windows XP SP2 Finnish (NX)

  18  Windows XP SP2 French (NX)

  19  Windows XP SP2 Hebrew (NX)

  20  Windows XP SP2 Hungarian (NX)

  21  Windows XP SP2 Italian (NX)

  22  Windows XP SP2 Japanese (NX)

  23  Windows XP SP2 Korean (NX)

  24  Windows XP SP2 Dutch (NX)

  25  Windows XP SP2 Norwegian (NX)

  26  Windows XP SP2 Polish (NX)

  27  Windows XP SP2 Portuguese - Brazilian (NX)

  28  Windows XP SP2 Portuguese (NX)

  29  Windows XP SP2 Russian (NX)

  30  Windows XP SP2 Swedish (NX)

  31  Windows XP SP2 Turkish (NX)

  32  Windows XP SP3 Arabic (NX)

  33  Windows XP SP3 Chinese - Traditional / Taiwan (NX)

  34  Windows XP SP3 Chinese - Simplified (NX)

  35  Windows XP SP3 Chinese - Traditional (NX)

  36  Windows XP SP3 Czech (NX)

  37  Windows XP SP3 Danish (NX)

  38  Windows XP SP3 German (NX)

  39  Windows XP SP3 Greek (NX)

  40  Windows XP SP3 Spanish (NX)

  41  Windows XP SP3 Finnish (NX)

  42  Windows XP SP3 French (NX)

  43  Windows XP SP3 Hebrew (NX)

  44  Windows XP SP3 Hungarian (NX)

  45  Windows XP SP3 Italian (NX)

  46  Windows XP SP3 Japanese (NX)

  47  Windows XP SP3 Korean (NX)

  48  Windows XP SP3 Dutch (NX)

  49  Windows XP SP3 Norwegian (NX)

  50  Windows XP SP3 Polish (NX)

  51  Windows XP SP3 Portuguese - Brazilian (NX)

  52  Windows XP SP3 Portuguese (NX)

  53  Windows XP SP3 Russian (NX)

  54  Windows XP SP3 Swedish (NX)

  55  Windows XP SP3 Turkish (NX)

  56  Windows 2003 SP1 English (NO NX)

  57  Windows 2003 SP1 English (NX)

  58  Windows 2003 SP1 Japanese (NO NX)

  59  Windows 2003 SP1 Spanish (NO NX)

  60  Windows 2003 SP1 Spanish (NX)

  61  Windows 2003 SP1 French (NO NX)

  62  Windows 2003 SP1 French (NX)

  63  Windows 2003 SP2 English (NO NX)

  64  Windows 2003 SP2 English (NX)

  65  Windows 2003 SP2 German (NO NX)

  66  Windows 2003 SP2 German (NX)

  67  Windows 2003 SP2 Portuguese - Brazilian (NX)

  68  Windows 2003 SP2 Spanish (NO NX)

  69  Windows 2003 SP2 Spanish (NX)

  70  Windows 2003 SP2 Japanese (NO NX)

  71  Windows 2003 SP2 French (NO NX)

  72  Windows 2003 SP2 French (NX)


Basic options:

  Name     Current Setting  Required  Description

  ----     ---------------  --------  -----------

  RHOST                     yes       The target address

  RPORT    445              yes       The SMB service port (TCP)

  SMBPIPE  BROWSER          yes       The pipe name to use (BROWSER, SRVSVC)


Payload information:

  Space: 408

  Avoid: 8 characters


Description:

  This module exploits a parsing flaw in the path canonicalization

  code of NetAPI32.dll through the Server Service. This module is

  capable of bypassing NX on some operating systems and service packs.

  The correct target must be used to prevent the Server Service (along

  with a dozen others in the same process) from crashing. Windows XP

  targets seem to handle multiple successful exploitation events, but

  2003 targets will often crash or hang on subsequent attempts. This

  is just the first version of this module, full support for NX bypass

  on 2003, along with other platforms, is still in development.


References:

  https://cvedetails.com/cve/CVE-2008-4250/

  OSVDB (49243)

  https://technet.microsoft.com/en-us/library/security/MS08-067

  http://www.rapid7.com/vulndb/lookup/dcerpc-ms-netapi-netpathcanonicalize-dos 


반응형

+ Recent posts