2022-11-10 16:00:20928浏览
msf工具是一款大杀器,如果你的msf打不开了,你先不用着急重装kali,可以按我整理的方法来恢复msf。
这个问题不是很常见,但是一旦存在msfconsole命令无法启动msf ,就可以参照这个锦囊解决这个问题。
一、前言
1、这里我提几点可能会导致无法启动msf的问题。
1、长时间没有使用msf
框架
2、kali的系统环境变量没有加入 msfconsole
或者是环境变量遭到破坏
3、msf的配置文件出现问题
2、一般会有以下报错提示
1、报错1
:
# msfconsole
/usr/share/metasploit-framework/lib/msf/core/payload/android.rb:87:in `not_after=': bignum too big to convert into `long' (RangeError)
from /usr/share/metasploit-framework/lib/msf/core/payload/android.rb:87:in `sign_jar'
from /usr/share/metasploit-framework/lib/msf/core/payload/android.rb:118:in `generate_jar'
from /usr/share/metasploit-framework/modules/payloads/singles/android/meterpreter_reverse_tcp.rb:44:in `generate_jar'
from /usr/share/metasploit-framework/lib/msf/core/payload/android.rb:38:in `generate'
from /usr/share/metasploit-framework/lib/msf/core/payload.rb:204:in `size'
from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:91:in `block in recalculate'
from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:78:in `each_pair'
from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:78:in `recalculate'
from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:251:in `block in load_modules'
from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:248:in `each'
from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:248:in `load_modules'
from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:119:in `block in load_modules'
from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:117:in `each'
from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:117:in `load_modules'
from /usr/share/metasploit-framework/lib/msf/core/module_manager/module_paths.rb:41:in `block in add_module_path'
from /usr/share/metasploit-framework/lib/msf/core/module_manager/module_paths.rb:40:in `each'
from /usr/share/metasploit-framework/lib/msf/core/module_manager/module_paths.rb:40:in `add_module_path'
from /usr/share/metasploit-framework/lib/msf/base/simple/framework/module_paths.rb:50:in `block in init_module_paths'
from /usr/share/metasploit-framework/lib/msf/base/simple/framework/module_paths.rb:49:in `each'
from /usr/share/metasploit-framework/lib/msf/base/simple/framework/module_paths.rb:49:in `init_module_paths'
from /usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:219:in `initialize'
from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in `new'
from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in `driver'
from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
from /usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
from /usr/bin/msfconsole:48:in `<main>'
2、报错2:
# msfconsole
msf 报错Module database cache not built yet, using slow search
二、解决方法
这里我总结了最简单简便的解决方法。
1、针对报错1
的解决方法:
这种报错是因为 metasploit-framework
出了问题,所以我们只需要卸载之前的框架,然后重新安装 metasploit-framework
框架就可以成功解决。
依次执行以下5
条命令,就可以成功解决。
# apt-get autoremove metasploit-framework 卸载metasploit-framework
# apt-get update 更新本地索引并读取软件列表
# apt-get install metasploit-framework 安装metasploit-framework
# service postgresql start 启动postgresSQL服务器
# msfconsole 启动msf
2、针对报错2
的解决方法:
报错2
的提示为数据库缓存还没有建立,这时我们给它初始化一下就解决了。这次只需要一行命令就可以成功解决。
# msfd init 初始化数据库
3、没有列出来的其他报错都可以使用 针对报错1
的解决方法去解决 也就是卸载metasploit-framework框架再重新安装就可以解决。
问题反馈