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

Hack The Box-Editorial

端口扫描

web

先打开网页,没啥内容,扫个后台。
 


about没啥东西,主要应该是upload页面。
 


文件上传功能,上传本地文件,会被重命名,后缀名会被删除并且文件名重命名,若尝试打开链接,会直接下载刚刚上传的文件

SSRF

抓包尝试包含本地的url
 


扫描端口:
发现5000的长度和其他的不一样,url加上端口继续包含
 


get将得到的路径传进去得到信息,里面应该是存在用户信息
 

{"messages":[{"promotions":{"description":"Retrieve a list of all the promotions in our library.","endpoint":"/api/latest/metadata/messages/promos","methods":"GET"}},{"coupons":{"description":"Retrieve the list of coupons to use in our library.","endpoint":"/api/latest/metadata/messages/coupons","methods":"GET"}},{"new_authors":{"description":"Retrieve the welcome message sended to our new authors.","endpoint":"/api/latest/metadata/messages/authors","methods":"GET"}},{"platform_use":{"description":"Retrieve examples of how to use the platform.","endpoint":"/api/latest/metadata/messages/how_to_use_platform","methods":"GET"}}],"version":[{"changelog":{"description":"Retrieve a list of all the versions and updates of the api.","endpoint":"/api/latest/metadata/changelog","methods":"GET"}},{"latest":{"description":"Retrieve the last version of api.","endpoint":"/api/latest/metadata","methods":"GET"}}]}

敏感信息泄露

再次传进去得到一个用户密码

{"template_mail_message":"Welcome to the team! We are thrilled to have you on board and can't wait to see the incredible content you'll bring to the table.\n\nYour login credentials for our internal forum and authors site are:\nUsername: dev\nPassword: dev080217_devAPI!@\nPlease be sure to change your password as soon as possible for security purposes.\n\nDon't hesitate to reach out if you have any questions or ideas - we're always here to support you.\n\nBest regards, Editorial Tiempo Arriba Team."}

ssh登陆进去

dev@editorial:~$ ls -la
total 48
drwxr-x--- 7 dev  dev  4096 Jun 30 02:33 .
drwxr-xr-x 4 root root 4096 Jun  5 14:36 ..
drwxrwxr-x 3 dev  dev  4096 Jun 30 01:09 .1
drwxrwxr-x 5 dev  dev  4096 Jun 30 00:52 apps
lrwxrwxrwx 1 root root    9 Feb  6  2023 .bash_history -> /dev/null
-rw-r--r-- 1 dev  dev   220 Jan  6  2022 .bash_logout
-rw-r--r-- 1 dev  dev  3771 Jan  6  2022 .bashrc
drwx------ 2 dev  dev  4096 Jun  5 14:36 .cache
drwx------ 3 dev  dev  4096 Jun 30 00:52 .config
drwx------ 4 dev  dev  4096 Jun 30 01:03 .gnupg
-rw------- 1 dev  dev    20 Jun 30 02:33 .lesshst
-rw-r--r-- 1 dev  dev   807 Jan  6  2022 .profile
-rw-r----- 1 root dev    33 Jun 29 12:13 user.txt
dev@editorial:~$ cd apps
dev@editorial:~/apps$ ls
app_api  app_editorial
dev@editorial:~/apps$ ls -la
total 20
drwxrwxr-x 5 dev dev 4096 Jun 30 00:52 .
drwxr-x--- 7 dev dev 4096 Jun 30 02:33 ..
drwxrwxr-x 2 dev dev 4096 Jun 30 00:52 app_api
drwxrwxr-x 4 dev dev 4096 Jun 30 00:52 app_editorial
drwxr-xr-x 8 dev dev 4096 Jun 30 00:52 .git
dev@editorial:~/apps$ cd .git
dev@editorial:~/apps/.git$ ls -la
total 56
drwxr-xr-x  8 dev dev 4096 Jun 30 00:52 .
drwxrwxr-x  5 dev dev 4096 Jun 30 00:52 ..
drwxr-xr-x  2 dev dev 4096 Jun  5 14:36 branches
-rw-r--r--  1 dev dev  253 Jun  4 11:30 COMMIT_EDITMSG
-rw-r--r--  1 dev dev  177 Jun  4 11:30 config
-rw-r--r--  1 dev dev   73 Jun  4 11:30 description
-rw-r--r--  1 dev dev   23 Jun  4 11:30 HEAD
drwxr-xr-x  2 dev dev 4096 Jun  5 14:36 hooks
-rw-rw-r--  1 dev dev 6163 Jun 30 00:52 index
drwxr-xr-x  2 dev dev 4096 Jun  5 14:36 info
drwxr-xr-x  3 dev dev 4096 Jun  5 14:36 logs
drwxr-xr-x 70 dev dev 4096 Jun  5 14:36 objects
drwxr-xr-x  4 dev dev 4096 Jun  5 14:36 refs
dev@editorial:~/apps/.git$ cd logs
dev@editorial:~/apps/.git/logs$ ls -la
total 16
drwxr-xr-x 3 dev dev 4096 Jun  5 14:36 .
drwxr-xr-x 8 dev dev 4096 Jun 30 00:52 ..
-rw-r--r-- 1 dev dev 1033 Jun  4 11:30 HEAD
drwxr-xr-x 3 dev dev 4096 Jun  5 14:36 refs
dev@editorial:~/apps/.git/logs$ cat HEAD 
0000000000000000000000000000000000000000 3251ec9e8ffdd9b938e83e3b9fbf5fd1efa9bbb8 dev-carlos.valderrama <dev-carlos.valderrama@tiempoarriba.htb> 1682905723 -0500        commit (initial): feat: create editorial app
3251ec9e8ffdd9b938e83e3b9fbf5fd1efa9bbb8 1e84a036b2f33c59e2390730699a488c65643d28 dev-carlos.valderrama <dev-carlos.valderrama@tiempoarriba.htb> 1682905870 -0500        commit: feat: create api to editorial info
1e84a036b2f33c59e2390730699a488c65643d28 b73481bb823d2dfb49c44f4c1e6a7e11912ed8ae dev-carlos.valderrama <dev-carlos.valderrama@tiempoarriba.htb> 1682906108 -0500        commit: change(api): downgrading prod to dev
b73481bb823d2dfb49c44f4c1e6a7e11912ed8ae dfef9f20e57d730b7d71967582035925d57ad883 dev-carlos.valderrama <dev-carlos.valderrama@tiempoarriba.htb> 1682906471 -0500        commit: change: remove debug and update api port
dfef9f20e57d730b7d71967582035925d57ad883 8ad0f3187e2bda88bba85074635ea942974587e8 dev-carlos.valderrama <dev-carlos.valderrama@tiempoarriba.htb> 1682906661 -0500        commit: fix: bugfix in api port endpoint
git show 1e84a036b2f33c59e2390730699a488c65643d28

git log 命令查看提交历史记录,或使用 git show HEAD

命令查看最新提交的详细信息
 


发现另一个用户密码。

Username: prod
Password: 080217_Producti0n_2023!@

ssh上去,看看sudo -l
可以以root用户的身份执行一个脚本文件。

pip3 list



发现RCE漏洞

反弹shell

相关文章:

  • C++ 和C#的差别
  • 手写一个类似@RequestParam的注解(用来接收请求体的参数)
  • FlinkCDC 数据同步优化及常见问题排查
  • GIT 基于master分支创建hotfix分支的操作
  • if __name__ == “__main__“
  • 五款免费可视化利器分享,助力打造数字孪生新体验!
  • redis未授权访问漏洞复现
  • K8S中的某个容器突然出现内存和CPU占用过高的情况解决办法
  • 76. 最小覆盖子串(困难)
  • 在线教育平台,easyexcel使用案例
  • WebSocket 心跳机制如何实现
  • 昇思25天学习打卡营第6天|数据变换 Transforms
  • Redis分布式锁的应用场景有哪些
  • 【多维动态规划】Leetcode 221. 最大正方形【中等】
  • AI 会淘汰程序员吗?
  • JS 中的深拷贝与浅拷贝
  • 【跃迁之路】【477天】刻意练习系列236(2018.05.28)
  • 【跃迁之路】【699天】程序员高效学习方法论探索系列(实验阶段456-2019.1.19)...
  • 5分钟即可掌握的前端高效利器:JavaScript 策略模式
  • CODING 缺陷管理功能正式开始公测
  • ComponentOne 2017 V2版本正式发布
  • CSS相对定位
  • Dubbo 整合 Pinpoint 做分布式服务请求跟踪
  • interface和setter,getter
  • Java|序列化异常StreamCorruptedException的解决方法
  • Javascript 原型链
  • Java读取Properties文件的六种方法
  • Linux快速复制或删除大量小文件
  • MySQL-事务管理(基础)
  • Nginx 通过 Lua + Redis 实现动态封禁 IP
  • php面试题 汇集2
  • Promise初体验
  • Python进阶细节
  • ReactNativeweexDeviceOne对比
  • Three.js 再探 - 写一个跳一跳极简版游戏
  • vue2.0项目引入element-ui
  • 从零搭建Koa2 Server
  • 读懂package.json -- 依赖管理
  • 分布式任务队列Celery
  • 缓存与缓冲
  • 前端攻城师
  • 世界上最简单的无等待算法(getAndIncrement)
  • 通信类
  • 问题之ssh中Host key verification failed的解决
  • k8s使用glusterfs实现动态持久化存储
  • 如何正确理解,内页权重高于首页?
  • 通过调用文摘列表API获取文摘
  • ​ 轻量应用服务器:亚马逊云科技打造全球领先的云计算解决方案
  • #NOIP 2014#Day.2 T3 解方程
  • #单片机(TB6600驱动42步进电机)
  • #经典论文 异质山坡的物理模型 2 有效导水率
  • (1/2)敏捷实践指南 Agile Practice Guide ([美] Project Management institute 著)
  • (8)STL算法之替换
  • (C#)if (this == null)?你在逗我,this 怎么可能为 null!用 IL 编译和反编译看穿一切
  • (C#)一个最简单的链表类