Centos安装msf与配置

2021/5/7 7:29:53

本文主要是介绍Centos安装msf与配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

通过msf的安装脚本,

curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
  chmod 755 msfinstall && \
  ./msfinstall

可以方便的安装msf测试版本,之后我们需要对centos下的数据库进行配置。
查看Postgresql 当前版本

psql -V

没装的话需要使用安装postgresql,这个sql的程序名为psql,默认用户为postgres,通过susu postgres进入数据库后台管理,获取管理员权限可以通过psql -U postgres获取su,更改密码可以使用ALTER USER postgres WITH PASSWORD 'xxxxxx';或者password postgres

sudo yum install -y postgresql-server postgresql
postgresql-setup initdb
sudo systemctl start postgresql
sudo systemctl enable postgresql

对数据库进行设置

su                             #切换到root用户
su postgres                    #切换到数据库用户
createuser msf -P -S -R -D     #创建用户 会提示输入密码
createdb -O msf msf            #创建数据库

删除数据库drop database msf;,删除用户drop role msf;查看数据库列表\l,查看用户列表\du,切换数据库\c DatabaseName查看表\d
新建数据库配置文件database.yml,一般我们将它放在.msf/database.yml

production:  
   adapter: postgresql  
   database: msf  
   username: msf  
   password: msf               #上一步创建用户的时候  设置的密码
   host: 127.0.0.1  
   port: 5432  
   pool: 75  
   timeout: 5

参考文献:
postgresql数据库基本用法
PostgreSQL新手入门
Deepin Linux下的Metasploit安装及优化
Centos下安装msf



这篇关于Centos安装msf与配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程