Linux - Install Metasploit on Arch

Platform: Arch Linux
Author: Nixawk
=========================================================
0. git clone https://github.com/rapid7/metasploit-framework

1. sudo pacman -S  git ruby gcc patch curl zlib readline autoconf automake diffutils make libtool bison libpcap

2. wget -O rvm.sh https://get.rvm.io
   bash rvm.sh stable --autolibs=enabled --ruby=1.9.3
   bundle install

3. metasploit database configuration
   sudo pacman -S postgresql
   sudo systemctl start postgresql
   sudo -u postgres initdb --locale en_US.UTF-8 -E UTF8 -D '/var/lib/postgres/data'
   sudo -u postgres createuser msfuser -P -S -R -D
   sudo -u postgres createdb -O msfuser msfdb
   cat /path/to/metasploit-framework/config/database.yml

   ---------------------database.yml----------------------
   # Please only use postgresql bound to a TCP port.
   # Only postgresql is supportable for metasploit-framework
   # these days. (No SQLite, no MySQL).
   #
   # To set up a metasploit database, follow the directions hosted at:
   # https://fedoraproject.org/wiki/Metasploit_Postgres_Setup (Works on
   # essentially any Linux distro, not just Fedora)
   production: &pgsql
     adapter: postgresql
     database: msfdb
     username: msfuser
     password: msfpass
     host: localhost
     port: 5432
     pool: 5
     timeout: 5

4. start msfconsole
[*] Starting the Metasploit Framework console...\
     ,           ,
    /             \
   ((__---,,,---__))
      (_) O O (_)_________
         \ _ /            |\
          o_o \   M S F   | \
               \   _____  |  *
                |||   WW|||
                |||     |||


       =[ metasploit v4.11.0-dev [core:4.11.0.pre.dev api:1.0.0]]
+ -- --=[ 1390 exploits - 789 auxiliary - 226 post        ]
+ -- --=[ 356 payloads - 37 encoders - 8 nops             ]
+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]

msf > 

=========================================================
References:

http://www.dinotools.de/2014/04/04/install-metasploit-from-git-on-arch/
https://github.com/rapid7/metasploit-framework/wiki
http://blog.youkuaiyun.com/nixawk/article/details/44724755 

### 安装和配置 Metasploit 框架 #### 验证现有安装 在Kali Linux 2020.x版本中,Metasploit框架通常已经预装。可以通过命令`dpkg -l | grep metasploit`来验证是否已存在该软件包[^1]。 #### 更新系统 为了确保所有组件是最新的,在继续之前应该更新整个操作系统。这一步骤对于保持系统的安全性和稳定性至关重要。 ```bash sudo apt update && sudo apt upgrade -y ``` #### 安装依赖项 如果需要手动安装或重新安装Metasploit,则首先要满足其所需的依赖关系。这些依赖项包括但不限于Ruby环境和其他必要的库文件。 ```bash sudo apt install curl git ruby-dev libpcap-dev postgresql postgresql-contrib nmap build-essential zlib1g-dev libreadline-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev -y ``` #### 获取并设置最新版Metasploit 通过官方GitHub仓库获取最新的源码,并按照说明编译安装。不过更简便的方法是从Rapid7提供的deb包直接安装: ```bash wget https://downloads.metasploit.com/data/releases/metasploit-latest-linux-x64-installer.run chmod +x ./metasploit-latest-linux-x64-installer.run ./metasploit-latest-linux-x64-installer.run ``` 完成上述操作后,根据提示输入许可证密钥(如果有),接受协议条款即可成功安装Metasploit框架。 #### 启动服务 首次启动前需初始化PostgreSQL数据库用于存储会话数据等信息。执行如下指令以创建默认的数据库实例和服务端口监听。 ```bash sudo systemctl start postgresql sudo -u postgres createuser msf -P sudo -u postgres createdb msf_database msfdb init ``` 之后就可以正常启动msfconsole客户端程序了。 ```bash msfconsole ``` #### 测试安装 进入控制台界面后可尝试加载模块、搜索漏洞以及查看帮助文档等功能来进行简单的功能测试,确认一切工作正常。 ```plaintext msf> help msf> search exploit msf> use ... ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值