分享好友 系统运维首页 频道列表

centos 7 下metasploit安装以及配置数据库

Centos  2023-02-09 22:510

网上的文章都很老了,很多方法都失效了,这里记录下我在Centos 7 下安装metasploit的过程
安装metasploit
使用脚本进行安装,具体命令如下

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

网络没问题的话会自动安装,会安装在/opt/metasploit-framework/目录下
配置Postgresql 数据库
由于postgresql 12还在测试中,所以这里选择了11的版本。
第一步:下载并安装yum源

wget https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-redhat11-11-2.noarch.rpm
rpm -ivh pgdg-redhat11-11-2.noarch.rpm

第二步:安装数据库并创建用户
安装数据库以及相关服务

yum install postgresql11 postgresql11-server postgresql11-devel

初始化数据库

/usr/pgsql-11/bin/postgresql-11-setup initdb

启动数据库并配置为开机自启

systemctl start postgresql-11
systemctl enable postgresql-11

切换到postgres用户做数据库的配置

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

启动控制台

centos 7 下metasploit安装以及配置数据库

亲测有效,有问题可以评论下提问。

 

转自:https://blog.njcit.me/index.php/archives/5/

查看更多关于【Centos】的文章

展开全文
相关推荐
反对 0
举报 0
评论 0
图文资讯
热门推荐
优选好物
更多热点专题
更多推荐文章
centos6下同时安装python2和python3
#build-essential compile packagesyum groupinstall "Development Tools"yum install openssl-develyum install zlib-develyum install make gcc gcc-c++ kernel-develhttp://unix.stackexchange.com/questions/291737/zipimport-zipimporterror-cant-decomp

0评论2023-02-10677

CentOS下查看文件和文件夹大小 linux查看文件夹大小
当磁盘大小超过标准时会有报警提示,这时如果掌握df和du命令是非常明智的选择。  df可以查看一级文件夹大小、使用比例、档案系统及其挂入点,但对文件却无能为力。当磁盘大小超过标准时会有报警提示,这时如果掌握df和du命令是非常明智的选择。  df可以查

0评论2023-02-10731

centos7 rc.local脚本执行不成功
腾讯云 centos7   配置文件/etc/rc.local的内容如下:#!/bin/sh#secu_agent init monitor, install at Thu Aug 3 11:19:41 CST 2017/usr/local/sa/agent/init_check.sh/dev/null 21/usr/sbin/ntpdate ntpupdate.tencentyun.com /dev/null 21 /usr/local/qclo

0评论2023-02-10442

如何在centos7启动时自动挂载硬盘
在/etc/rc.local中加入如下的语句,这样就不用每次重启后手动挂载了(后面挂载的目录根据自己的需求而定):mount  /dev/sdb1 /usr/sharedfiles/sdbmount  /dev/sdc1 /usr/sharedfiles/sdcmount  /dev/sdb1 /root/sdbmount  /dev/sdc1 /root/sdc注意:可以

0评论2023-02-10535

centos7.2 开启防火墙
开启防火墙当我们修改了某些配置之后(尤其是配置文件的修改),firewall并不会立即生效。可以通过两种方式来激活最新配置 systemctl restart firewalld 和 firewall-cmd --reload 两种方式,前一种是重启firewalld服务,建议使用后一种“重载配置文件”

0评论2023-02-10997

CentOS7 安装 Python3.8后 pip 安装报错
[root@localhost Python-3.8.0]# pip install bs4Collecting bs4Using cached https://files.pythonhosted.org/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gzERROR: Command errored out with exit status

0评论2023-02-10961

[转]How to install PHP 5.3 on CentOS
在DIAHosting买了一个VPS,自带PHP5.1.6.我想安装wordpress,但是由于版本比较新,要求PHP也要是5.2以上的,于是我就安装了PHP5.3.20--------------------------------------------------------------------------------------------------------------------

0评论2023-02-10997

外部访问docker内部容器centos的http服务
1.创建容器docker run -d -it -h dd -p 5000 --name bbbbb centosdd 是用户名 --name 后面是容器名字2.在我们开始安装Nginx及其他所需软件之前先安装一些前提软yum install python-setuptools yum -y install epel-release yum install python-pip pip instal

0评论2023-02-10480

Centos7安装yum命令 centos8如何安装yum
步骤如下http://mirrors.163.com/centos/7/os/x86_64/Packages/到上面这个网站去下载如下RPM包(为版本号,根据最新的自己替换即可)python-iniparse-.noarch.rpmyum-metadata-parser-.x86_64.rpmyum-.centos.noarch.rpmyum-plugin-fastestmirror-*.noarch.rp

0评论2023-02-10760

CentOS 7 - 安装Python 3
Enable Software Collections (SCL)Software Collections, also known as SCL is a community project that allows you to build, install, and use multiple versions of software on the same system, without affecting system default packages. By enabl

0评论2023-02-10592

centos清除历史命令
1、rm -f /root/.bash_profile  历史命令记录在此文件2、history -c   清除缓存会话退出后重新连接输入history可以看到历史命令清空了。两条命令的顺序不能乱

0评论2023-02-09473

更多推荐