[工具使用] Linux安装Metasploit与简单介绍

543 0
Honkers 2026-5-22 11:59:19 来自手机 | 显示全部楼层 |阅读模式

1 CentOS安装metasploit

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

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

执行命令的结果

  1. [root@localhost ~]# cd /opt
  2. [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
  3. % Total % Received % Xferd Average Speed Time Time Time Current
  4. Dload Upload Total Spent Left Speed
  5. 100 6034 100 6034 0 0 1428 0 0:00:04 0:00:04 --:--:-- 1429
  6. Checking for and installing update..
  7. Adding metasploit-framework to your repository list..Loaded plugins: fastestmirror, langpacks
  8. base | 3.6 kB 00:00:00
  9. extras | 2.9 kB 00:00:00
  10. metasploit | 3.0 kB 00:00:00
  11. updates | 2.9 kB 00:00:00
  12. (1/2): metasploit/primary_db | 12 kB 00:00:01
  13. (2/2): updates/7/x86_64/primary_db | 16 MB 00:00:03
  14. Loading mirror speeds from cached hostfile
  15. * base: mirrors.aliyun.com
  16. * extras: mirrors.aliyun.com
  17. * updates: mirrors.aliyun.com
  18. Resolving Dependencies
  19. --> Running transaction check
  20. ---> Package metasploit-framework.x86_64 0:6.2.9+20220728102816~1rapid7-1.el6 will be installed
  21. --> Finished Dependency Resolution
  22. Dependencies Resolved
  23. =================================================================================================================
  24. Package Arch Version Repository Size
  25. =================================================================================================================
  26. Installing:
  27. metasploit-framework x86_64 6.2.9+20220728102816~1rapid7-1.el6 metasploit 269 M
  28. Transaction Summary
  29. =================================================================================================================
  30. Install 1 Package
  31. Total download size: 269 M
  32. Installed size: 635 M
  33. Downloading packages:
  34. 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
  35. Public key for metasploit-framework-6.2.9+20220728102816~1rapid7-1.el6.x86_64.rpm is not installed
  36. metasploit-framework-6.2.9+20220728102816~1rapid7-1.el6.x86_64.rpm | 269 MB 00:00:19
  37. Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Metasploit
  38. Importing GPG key 0x2007B954:
  39. Userid : "Metasploit <metasploit@rapid7.com>"
  40. Fingerprint: 09e5 5faf 4f78 62cd 6d55 8997 cdfb 5fa5 2007 b954
  41. From : /etc/pki/rpm-gpg/RPM-GPG-KEY-Metasploit
  42. Running transaction check
  43. Running transaction test
  44. Transaction test succeeded
  45. Running transaction
  46. Installing : metasploit-framework-6.2.9+20220728102816~1rapid7-1.el6.x86_64 1/1
  47. Run msfconsole to get started
  48. Verifying : metasploit-framework-6.2.9+20220728102816~1rapid7-1.el6.x86_64 1/1
  49. Installed:
  50. metasploit-framework.x86_64 0:6.2.9+20220728102816~1rapid7-1.el6
  51. Complete!
复制代码

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

  1. [root@localhost opt]# ls
  2. metasploit-framework msfinstall rh
  3. [root@localhost opt]# ls ./metasploit-framework
  4. bin embedded LICENSE LICENSES version-manifest.json version-manifest.txt
  5. [root@localhost opt]# ls metasploit-framework
  6. bin embedded LICENSE LICENSES version-manifest.json version-manifest.txt
复制代码

启动控制台

  1. [root@localhost opt]# msfconsole
  2. ______________________________________________________________________________
  3. | |
  4. | METASPLOIT CYBER MISSILE COMMAND V5 |
  5. |______________________________________________________________________________|
  6. \ / /
  7. \ . / / x
  8. \ / /
  9. \ / + /
  10. \ + / /
  11. * / /
  12. / . /
  13. X / / X
  14. / ###
  15. / # % #
  16. / ###
  17. . /
  18. . / . * .
  19. /
  20. *
  21. + *
  22. ^
  23. #### __ __ __ ####### __ __ __ ####
  24. #### / \ / \ / \ ########### / \ / \ / \ ####
  25. ################################################################################
  26. ################################################################################
  27. # WAVE 5 ######## SCORE 31337 ################################## HIGH FFFFFFFF #
  28. ################################################################################
  29. https://metasploit.com
  30. =[ metasploit v6.2.9-dev- ]
  31. + -- --=[ 2230 exploits - 1177 auxiliary - 398 post ]
  32. + -- --=[ 864 payloads - 45 encoders - 11 nops ]
  33. + -- --=[ 9 evasion ]
  34. Metasploit tip: View a module's description using
  35. info, or the enhanced version in your browser with
  36. info -d
  37. msf6 > Interrupt: use the 'exit' command to quit
  38. 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

  1. apt-get update
  2. # 使用apt安装docker
  3. apt-get install -y docker.io
  4. # 设置开机自启动
  5. systemctl start docker
  6. # 检测docker状态
  7. docker version
复制代码

安装docker-compose

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

安装启动Viper

  1. # 设置Viper安装目录
  2. export VIPER_DIR=/root/VIPER
  3. # 生成安装目录 并进入目录
  4. mkdir -p $VIPER_DIR && cd $VIPER_DIR
  5. # 执行如下命令生成docker-compose.yml
  6. tee docker-compose.yml <<-'EOF'
  7. version: "3"
  8. services:
  9. viper:
  10. image: registry.cn-shenzhen.aliyuncs.com/toys/viper:latest
  11. container_name: viper-c
  12. network_mode: "host"
  13. restart: always
  14. volumes:
  15. - ${PWD}/loot:/root/.msf4/loot
  16. - ${PWD}/db:/root/viper/Docker/db
  17. - ${PWD}/module:/root/viper/Docker/module
  18. - ${PWD}/log:/root/viper/Docker/log
  19. - ${PWD}/nginxconfig:/root/viper/Docker/nginxconfig
  20. command: ["VIPER_PASSWORD"]
  21. EOF
复制代码

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

  1. export VIPER_PASSWORD=123456
复制代码

写入密码到docker-compose.yml

  1. sed -i "s/VIPER_PASSWORD/$VIPER_PASSWORD/g" docker-compose.yml
复制代码

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

  1. cat docker-compose.yml
复制代码


启动Viper

  1. # 进入viper的目录($VIPER_DIR=/root/VIPER),第一次访问比较慢,需要下载一个G的文件
  2. cd $VIPER_DIR
  3. docker-compose up -d
  4. # 启动viper
  5. 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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2026 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行