mac安装msf的问题

参考国光大佬的博客《macOS 下优雅的使用 Metasploit》https://www.sqlsec.com/2019/11/macmsf.html

问题一:安装msf后无法初始化数据库失败

Creating database at /Users/lmc/.msf4/db
Starting database at /Users/lmc/.msf4/db...failed
Creating database users

搜索了网上了其他文章后尝试进行初始化数据库和重新初始化数据库的操作

msf初始化数据库:msfdb init
如果出错使用:msfdb reinit

依然失败

[?] Would you like to init the webservice? (Not Required) [no]: yes
[?] Would you like to delete your existing data and configurations? []: yes
====================================================================
Running the 'init' command for the database:
Existing database found, attempting to start it
Starting database at /Users/lmc/.msf4/db...failed
====================================================================

====================================================================
Running the 'init' command for the webservice:
[?] Initial MSF web service account username? [lmc]: msf
[?] Initial MSF web service account password? (Leave blank for random password):
Generating SSL key and certificate for MSF web service
Attempting to start MSF web service...failed
[!] MSF web service failed and returned the following message:
No message returned.
Please see /Users/lmc/.msf4/logs/msf-ws.log for additional webservice details.
====================================================================

解决办法:端口被占用,重启

问题二:没有安装go或者go没有加入全局变量

没有安装go或者go没有加入全局变量时,启动ms能正常启动但有如下报错:

[!] The following modules could not be loaded!..\
[!] 	/opt/metasploit-framework/embedded/framework/modules/auxiliary/scanner/msmail/onprem_enum.go
[!] 	/opt/metasploit-framework/embedded/framework/modules/auxiliary/scanner/msmail/host_id.go
[!] 	/opt/metasploit-framework/embedded/framework/modules/auxiliary/scanner/msmail/exchange_enum.go
[!] Please see /Users/lmc/.msf4/logs/framework.log for details.

根据提示查看/Users/lmc/.msf4/logs/framework.log,发现报错信息:

package metasploit/module is not in GOROOT (/usr/local/Cellar/go/1.16.6/libexec/src/metasploit/module)

安装go:

brew install go

加入全局变量:

export PATH=$PATH:/usr/local/bin/go

依然报错,输入:

go mod init
go env -w GO111MODULE=off

成功解决

参考文章:https://stackoverflow.com/questions/61845013/package-xxx-is-not-in-goroot-when-building-a-go-project?rq=1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值