HTB WP -Sequel

task1:

1
2
During our scan, which port do we find serving MySQL?
在我们的扫描中,我们发现哪个端口正在运行 MySQL 服务?

回答:

那就nmap扫一下端口:

只有这一个,看它的service:tcpwrapped。

1
2
服务:tcpwrapped(通常这个端口默认对应的服务是 MySQL,虽然在 Nmap 扫描中它的服务标识显示为 tcpwrapped,说明连接在建立后被立即关闭或受到了某种保护/限制,但 3306 确实是经典的 MySQL 默认服务端口)
所以答案是3306

task2:

1
2
What community-developed MySQL version is the target running?
目标运行的是哪个社区开发的 MySQL 版本?

回答:

1
你需要直接尝试连接该数据库。由于这是一个新手关卡(Starting Point),它默认允许空密码无密登录。这个版本用nmap探测不到

用 mysql连接:

1
2
3
mysql -h IP -P 端口 -u 用户名 -p 密码
mysql -h 10.129.95.232 -P 3306 -u root
(连接数据库有点慢。请耐心等待)

参数:

1
2
3
4
-h(Host / 主机) 指定你要连接的数据库服务器的 IP 地址 或 域名。
-P (Port / 端口)注意是大写的。指定数据库服务监听的 端口号。
-u (User / 用户名) 指定登录数据库所使用的 账户名称。
-p(Password / 密码)告知客户端需要输入 密码。

可以看到社区:

1
MariaDB

task3:

1
2
When using the MySQL command line client, what switch do we need to use in order to specify a login username?
在使用 MySQL 命令行客户端时,我们需要使用哪个参数(开关)来指定登录用户名?

回答:

1
2
-u
前面提到了

task4:

1
2
Which username allows us to log into this MariaDB instance without providing a password?
哪个用户名允许我们在不提供密码的情况下登录这个 MariaDB 实例?

回答:

1
root

task5:

1
2
In SQL, what symbol can we use to specify within the query that we want to display everything inside a table?
在 SQL 中,我们可以使用什么符号在查询中指定我们想要显示表中的所有内容?

回答:

1
*(select *选择所有列(段))

task6:

1
2
In SQL, what symbol do we need to end each query with?
在 SQL 中,我们需要用什么符号来结束每一个查询?

回答:

1
;(数据库基础知识)

task7:

1
2
There are three databases in this MySQL instance that are common across all MySQL instances. What is the name of the fourth that's unique to this host?
在这个 MySQL 实例中,有三个数据库是在所有 MySQL 实例中都常见的。那么独属于这台主机的第四个数据库的名字是什么?

回答:

这需要我们进数据库看看了,不然怎么知道。

之前进去过数据库了,命令就不贴了。

进入数据库,看所有表,需要知道一些数据库指令:

1
show databases;

其中,mysql,information_schema,performance_schema都是比较常见的,htb是靶机专属的,所以答案就是:

1
htb

task8:

1
2
What is the command in MySQL to select a database to interact with?
在 MySQL 中,用于选择并切换到要交互的数据库的命令是什么?

回答:

1
use 数据库名;

task9:

1
2
What is the command in MySQL to show the different columns for a given table?
在 MySQL 中,用于显示指定表的所有列(字段)的命令是什么?

回答:

1
2
describe 表名;
或者 show columns from 表名;

task10:

1
2
Which table has a column named "flag"?
哪张表包含一个名为 "flag" 的列(字段)?

回答:

这个一个一个进。连接数据库系统:

1
mysql -h 10.129.95.232 -P 3306 -u root

看有什么数据库:

1
show databases;

选择htb数据库并进入(htb是独有的,更有可能有flag):

1
use htb;

看看有哪些表:

1
show tables;

先选择查看config的所有列:

1
select * from config;

看到flag了,就在config表下。

所以答案是:

1
config

task11是交flag:

1
7b4bec00d1a39e3dd4e021ec3d915da8