网络安全人员一定要知道的Metasploit渗透框架!

简介

Metasploit是一款开源安全漏洞检测工具,附带数百个已知的软件漏洞,并保持频繁更新。被安全社区冠以“可以黑掉整个宇宙”之名的强大渗透测试框架。

Metasploit官网:www.metasploit.com/

MetasploitGithub仓库地址:github.com/rapid7/meta…

框架和相关术语简介:

Vulnerability:允许攻击者入侵或危害系统安全性的弱点称为漏洞,漏洞可能存在于操作系统,应用软件甚至网络协议中。

Exploit:攻击代码或程序,它允许攻击者利用易受攻击的系统并危害其安全性。每个漏洞都有对应的漏洞利用程序。Metasploit有超过 1700 个漏洞利用程序。

Payload:攻击载荷。它主要用于建立攻击者和受害者机器直接的连接,Metasploit有超过 500个有效攻击载荷。

Module:模块是一个完整的构件,每个模块执行特定的任务,并通过几个模块组成一个单元运行。这种架构的好处是可以很容易的将自己写的利用程序和工具集成到框架中。

使用方法

在MSF里面msfconsole可以说是最流行的一个接口程序。很多人一开始碰到msfconsole的时候就害怕了。那么多复杂的命令语句需要学习,但是msfconsole真的是一个强大的接口程序。Msfconsole提供了一个一体化的集中控制台。通过msfconsole,你可以访问和使用所有的metasploit的插件,payload,利用模块,post模块等等。Msfconsole还有第三方程序的接口,比如nmap,sqlmap等,可以直接在msfconsole里面使用。

image-20210731121233931

大家可以直接在命令行窗口输入msfconsole,然后回车。这样就打开了msfconsole。Msfconsole的系统文件和用户文件位于/usr/share/metasploit-framework/目录下。

image-20210731123822325

msf5 > help
Core Commands
=============Command       Description-------       -----------?             Help menubanner        Display an awesome metasploit bannercd            Change the current working directorycolor         Toggle colorconnect       Communicate with a hostexit          Exit the consoleget           Gets the value of a context-specific variablegetg          Gets the value of a global variablegrep          Grep the output of another commandhelp          Help menuhistory       Show command historyload          Load a framework pluginquit          Exit the consolerepeat        Repeat a list of commandsroute         Route traffic through a sessionsave          Saves the active datastoressessions      Dump session listings and display information about sessionsset           Sets a context-specific variable to a valuesetg          Sets a global variable to a valuesleep         Do nothing for the specified number of secondsspool         Write console output into a file as well the screenthreads       View and manipulate background threadstips          Show a list of useful productivity tipsunload        Unload a framework pluginunset         Unsets one or more context-specific variablesunsetg        Unsets one or more global variablesversion       Show the framework and console library version numbersModule Commands
===============Command       Description-------       -----------advanced      Displays advanced options for one or more modulesback          Move back from the current contextclearm        Clear the module stackinfo          Displays information about one or more moduleslistm         List the module stackloadpath      Searches for and loads modules from a pathoptions       Displays global options or for one or more modulespopm          Pops the latest module off the stack and makes it activeprevious      Sets the previously loaded module as the current modulepushm         Pushes the active or list of modules onto the module stackreload_all    Reloads all modules from all defined module pathssearch        Searches module names and descriptionsshow          Displays modules of a given type, or all modulesuse           Interact with a module by name or search term/indexJob Commands
============Command       Description-------       -----------handler       Start a payload handler as jobjobs          Displays and manages jobskill          Kill a jobrename_job    Rename a jobDatabase Backend Commands
=========================Command           Description-------           -----------analyze           Analyze database information about a specific address or address rangedb_connect        Connect to an existing data servicedb_disconnect     Disconnect from the current data servicedb_export         Export a file containing the contents of the databasedb_import         Import a scan result file (filetype will be auto-detected)db_nmap           Executes nmap and records the output automaticallydb_rebuild_cache  Rebuilds the database-stored module cache (deprecated)db_remove         Remove the saved data service entrydb_save           Save the current data service connection as the default to reconnect on startupdb_status         Show the current data service statushosts             List all hosts in the databaseloot              List all loot in the databasenotes             List all notes in the databaseservices          List all services in the databasevulns             List all vulnerabilities in the databaseworkspace         Switch between database workspaces

search参数

你使用msfconsole的时候,你会用到各种漏洞模块、各种插件等等。所以search命令就很重要。

先查看search的帮助信息

msf5 > search -h
Usage: search [<options>] [<keywords>:<value>]
​
Prepending a value with '-' will exclude any matching results.
If no options or keywords are provided, cached results are displayed.
​
OPTIONS:-h                Show this help information-o <file>         Send output to a file in csv format-S <string>       Regex pattern used to filter search results-u                Use module if there is one result
​
Keywords:aka         :  Modules with a matching AKA (also-known-as) nameauthor      :  Modules written by this authorarch        :  Modules affecting this architecturebid         :  Modules with a matching Bugtraq IDcve         :  Modules with a matching CVE IDedb         :  Modules with a matching Exploit-DB IDcheck       :  Modules that support the 'check' methoddate        :  Modules with a matching disclosure datedescription :  Modules with a matching descriptionfullname    :  Modules with a matching full namemod_time    :  Modules with a matching modification datename        :  Modules with a matching descriptive namepath        :  Modules with a matching pathplatform    :  Modules affecting this platformport        :  Modules with a matching portrank        :  Modules with a matching rank (Can be descriptive (ex: 'good') or numeric with comparison operators (ex: 'gte400'))ref         :  Modules with a matching refreference   :  Modules with a matching referencetarget      :  Modules affecting this targettype        :  Modules of a specific type (exploit, payload, auxiliary, encoder, evasion, post, or nop)
​
Examples:search cve:2009 type:exploitsearch cve:2009 type:exploit platform:-linux
​

通过名称查找

查找名称含有mysql的漏洞

msf5 > search name:sql 

image-20210731125308481

通过模块查找

Metasploit上只有三中模块可以利用:

  • 第一种是exploit模块,也就是利用模块,包含主流的漏洞利用脚本,通常是对某些可能存在漏洞的目标进行漏洞利用。命名规则:操作系统/各种应用协议分类

  • 第二种是auxiliary模块,辅助模块,辅助渗透(端口扫描、登录密码爆破、漏洞验证等)。

  • 第三种是post模块,后渗透阶段模块,漏洞利用成功获得meterpreter之后,向目标发送的一些功能性指令,如:提权等。

search name:mysql type:exploit

image-20210731125436544

使用一个模块

通过search查找到模块之后,就可以使用use去使用这个模块

image-20210731130503792

info查看模块的信息

image-20210731135505930

使用完一个模块之后,可以使用set设置模块参数

rhosts是设置攻击目标,threads是设置线程数

image-20210731131257223

再次使用info查看信息

image-20210731135213725

使用show options也可以查看我们设置的参数

image-20210731132956700

run执行模块

image-20210731131637436

run -j可以让进程后台运行

image-20210731141649232

jobs查看后台进程 ,根据提供的编号配合kill杀死进程

image-20210731141836027

setg这个和set有些类似,但是不同的是这个是一个全局变量设置。设置一次后再保存,那么以后,这个漏洞模块你就不用重复设置。

image-20210731140120139

unset取消设置的参数 unsetg取消设置的全局参数

image-20210731135937409

back取消选择的模块

image-20210731132750096

connect参数主要用于远程连接主机。一般用于内网渗透。参数一般为IP地址加上端口号。

image-20210731133606982

edit使用vim去编辑当前的模块

image-20210731134736794

exit是退出msfconsole的命令。可以完全退出msfconsole,并且回到linux终端界面。

image-20210731134849932

msfconsole中依旧可以执行shell命令

image-20210731141121018

CSDN大礼包:《黑客&网络安全入门&进阶学习资源包》免费分享🎁

😝朋友们如果有需要全套《黑客&网络安全入门&进阶学习资源包》,可以扫描下方二维码免费领取

1️⃣零基础入门

① 学习路线

对于从来没有接触过网络安全的同学,我们帮你准备了详细的学习成长路线图。可以说是最科学最系统的学习路线,大家跟着这个大的方向学习准没问题。

img

② 路线对应学习视频

同时每个成长路线对应的板块都有配套的视频提供:

img

因篇幅有限,仅展示部分资料

2️⃣视频配套资料&国内外网安书籍、文档

① 文档和书籍资料

img

② 黑客技术

img

因篇幅有限,仅展示部分资料

3️⃣网络安全源码合集+工具包

img

4️⃣网络安全面试题

面试题
上述所有资料 ⚡️ ,朋友们如果有需要全套 📦《网络安全入门+进阶学习资源包》,可以扫描下方二维码免费领取 🆓

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/424252.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

教师转行适合做什么工作

当教师转型成为社会话题时&#xff0c;无数同仁都开始思考&#xff1a;我要转行吗&#xff1f;转到哪里去呢&#xff1f;作为一位曾经的教师&#xff0c;我想说&#xff0c;转行不是盲目地跳出教育界&#xff0c;而是基于自身优势和兴趣的理性选择。 作为教师&#xff0c;我们…

Ubutu下的Shell操作

前言 在学习Ubuntu系统时&#xff0c;Shell操作是必不可少的知识。本篇文章是记录我学习Linux系统时&#xff0c;Ubutu下的Shell操作&#xff0c;希望我的分享对大家有所帮助&#xff01; 目录 前言 一、什么时是Shell 二、Shell的基本操作 三、常用的Shell命令 1、目录信…

PWM调光 降压恒流LED芯片FP7127:为照明系统注入新能量(台灯、GBR、调光电源、汽车大灯)

目录 一、降压恒流LED芯片FP7127 二、降压恒流LED芯片FP7127具有以下特点&#xff1a; 三、降压恒流LED芯片FP7127应用领域&#xff1a; LED照明和调光的新纪元随着LED照明技术的不断发展&#xff0c;人们对于照明调光的需求也越来越高。PWM调光技术作为一种常用的调光方法&…

【网络】传输层TCP协议

目录 一、概述 2.1 运输层的作用引出 2.2 传输控制协议TCP 简介 2.3 TCP最主要的特点 2.4 TCP连接 二、TCP报文段的首部格式 三、TCP的运输连接管理 3.1 TCP的连接建立(三次握手) 3.2 为什么是三次握手&#xff1f; 3.3 为何两次握手不可以呢&#xff1f; 3.4 TCP的…

操作系统-进程的概念,组成,特征(PCB 程序如何运行)

文章目录 总览进程的概念进程的组成-PCBPCB中存放的内容程序是如何运行的进程的组成-程序段&#xff0c;数据段进程的特征小结 总览 进程的概念 任务管理器&#xff1a;显示运行的进程 打开qq前后 打开三个qq&#xff0c;有三个进程 进程的组成-PCB PCB包含进程的很多信息 …

使用pysimplegui+opencv编写一个摄像头的播放器

需求 使用pysimplegui和opencv实现一个播放器&#xff0c;播放 摄像头的画面。 代码实现 import cv2 import time from typing import Iterable, NamedTuple, Optionalimport PySimpleGUI as sgclass CameraSpec(NamedTuple):name: strindex: intwidth: intheight: intfps: i…

Flink中的时间和窗口(时间语义,水位线,窗口,迟到数据的处理)

目录 Flink中的时间和窗口 1时间语义 1.1Flink中的时间语义 1.1.1处理时间 1.1.2事件时间 1.2那种时间语义更重要 2 水位线 2.1 事件时间和窗口 2.2 什么是水位线 2.3 如何生成水位线 2.3.1使用WatermarkGenerator 2.3.2使用SourceFunction 2.4 水位线的传递 2.5 水位…

数据结构之最优二叉树

数据结构之最优二叉树 1、最优二叉树2、哈夫曼编码 数据结构是程序设计的重要基础&#xff0c;它所讨论的内容和技术对从事软件项目的开发有重要作用。学习数据结构要达到的目标是学会从问题出发&#xff0c;分析和研究计算机加工的数据的特性&#xff0c;以便为应用所涉及的数…

个人云服务器docker搭建部署前后端应用-myos

var code "87c5235c-b551-45bb-a5e4-9593cb104663" mysql、redis、nginx、java应用、前端应用部署 本文以单台云服务器为例&#xff1a; 1. 使用腾讯云服务器 阿里或其他云服务器皆可&#xff0c;类似 安装系统&#xff0c;现在服务器系统都集成安装了docker镜像&a…

GPTs Store 推荐的学术类应用,效果怎么样?

&#xff08;注&#xff1a;本文为小报童精选文章&#xff0c;已订阅小报童或加入知识星球「玉树芝兰」用户请勿重复付费&#xff09; 哪些 GPTs &#xff0c;会令我们眼前一亮&#xff1f; 最近 GPTs Store 已经正式发布&#xff0c;提供了推荐应用和各分类板块目前的热门趋势…

网络通信(15)-C#TCP客户端掉线重连实例

本文上接前面的文章使用Socket在C#语言环境下完成TCP客户端的掉线重连实例。 掉线重连需要使用心跳包发送测试网络的状态,进而进入重连循环线程。 前面实例完成的功能: 客户端与服务器连接,实现实时刷新状态。 客户端接收服务器的数据。 客户端发送给服务器的数据。 客…

初识Vue.js开发

一、Vue在前端重要性 1.认识vue Vue (读音 /vjuː/&#xff0c;类似于 view) 是一套用于构建用户界面的渐进式 JavaScript框架。 全称是Vue.js或者Vuejs&#xff1b;它基于标准 HTML、CSS 和 JavaScript 构建&#xff0c;并提供了一套声明式的、组件化的编程模型&#xff1b…