centos 7 下metasploit安装以及配置数据库
??安装metasploit??
#使用脚本进行安装,具体命令如下
yum install -y wget curl
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall
chmod +x msfinstall
./msfinstall
然后会安装在/opt/metasploit-framework/目录下
??安装PostgreSQL??
wget https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
rpm -ivh pgdg-redhat-repo-latest.noarch.rpm
yum install -y postgresql11 postgresql11-server postgresql11-devel
#初始化数据库:
/usr/pgsql-11/bin/postgresql-11-setup initdb
#启动并设为开机自启
systemctl start postgresql-11
systemctl enable postgresql-11
#切换用户并进入数据库
sudo -u postgres psql
#创建用户和数据库
create user msf_test with password 'youpass' nocreatedb;
create database msf1 with owner ='msf_test';
\q
#修改数据库配置
vim /var/lib/pgsql/11/data/pg_hba.conf
#修改为
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
#重启数据库使配置生效
systemctl restart postgresql-11
#创建metasploit数据配置信息
vim /opt/metasploit-framework/database.yml
#写入以下内容:
production:
adapter: postgresql
database: msf1
username: msf_test
password: youpass
host: 127.0.0.1
port: 5432
pool: 75
timeout: 5
#使配置生效
echo export MSF_DATABASE_CONFIG=/opt/metasploit-framework/database.yml >> /etc/bashrc
source ~/.bashrc
#启动
msfconsolehttp://cdn.u1.huluxia.com/g4/M01/9D/43/rBAAdmCr2ZaAZrWuAALfHFKc0Q0356.jpg
前排,哇咔咔 占位编辑
页:
[1]