For a security need, we are put metasploit-framework on the remote machine.
OS Details:
[[email protected] centos]$ uname -aLinux localhost.localdomain 2.6.32-042stab104.1 #1 SMP Thu Jan 29 12:58:41 MSK 2015 i686 i686 i386 GNU/Linux[[email protected] centos]$ cat /etc/issueCentOS release 6.6 (Final)Kernel \r on an \m
We'll show you the install Metasploit-framework step by step.
- ADD a MSF user with normal privileges
- Clone Metasploit-framework
- Libraries Requirements
- Ruby env
- Database Setup
- Start Metasploit-framework
ADD a MSF user with normal privileges
Add a normal user for Metasploit called CentOS by Root.
# useradd -b /home/ -c ‘normal user‘ -m -u 1000 centos
Clone metasploit-framework
Let's get a lastest Metasploit copy from GitHub.
# cd /opt# git clone git://github.com:rapid7/metasploit-framework.git
Libraries Requirements
# yum update# yum upgrade# yum install -y patch libyaml-devel glibc-headers autoconf gcc-c++ glibc-devel patch readline-devel libffi-devel automake libtool bison sqlite-devel postgresql-devel libpcap-devel
Ruby env
Database Setup
# service postgresql initdb# service postgresql start# su postgres$ createuser msfuser -P # set password: [msfpass]$ createdb -O msfuser msfdb$ exit$ cd /opt/metasploit-framework$ sudo mv config/database.yml.example config/database.yml$ cat config/database.ymlproduction: &pgsql adapter: postgresql database: msfdb username: msfuser password: msfpass host: localhost port: 5432 pool: 5 timeout: 5
When we start Metasploit, it does an error.
$ ./msfconsole[*] Starting the Metasploit Framework console...[-] Failed to connect to the database: FATAL: Ident authentication failed for user "msfuser"
What we need are to modify /var/lib/pgsql/data/pg_hba.conf file as follow:
local all all trusthost all all 127.0.0.1/32 trusthost all all ::1/128 trust
Start Metasploit-framework
$ cd /opt/metasploit-framework$ ./msfconsole
References
- Https://github.com/rapid7/metasploit-framework/wiki
- Install Metasploit on Arch
Linux-install Metasploit on CentOS