0%

HTB-Sequel靶机渗透

Task1

During our scan, which port do we find serving MySQL?

问Mysql的端口,通过fscan扫描得

image-20260304145920061

开放了一个端口,3306

Task2

What community-developed MySQL version is the target running?

问MySQL的版本是哪个社区开发的,常识问题

MariaDB

Task3

When using the MySQL command line client, what switch do we need to use in order to specify a login username?

问使用MySQL时使用什么开关指定用户名

-u

Task4

Which username allows us to log into this MariaDB instance without providing a password?

什么用户可以不通过密码直接登录数据库?看第一个问题的扫描结果是

root

Task5

In SQL, what symbol can we use to specify within the query that we want to display everything inside a table?

在SQL中,我们可以使用什么符号来在查询中指定我们想要显示表内的所有内容?

所有内容,用通配符*

Task6

In SQL, what symbol do we need to end each query with?

在SQL中,用什么语句结束查询?用;代表结束

Task7

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远程连接登上去

image-20260304162457466

1
mysql -uroot -h IP -ssl=0

这里本来没有加上-ssl=0,但是出现了报错

image-20260304162648989

然后去网上搜看到在命令后面加上-ssl=0或者-ssl-ssl就行

答案:htb

flag

要提交root的flag,先进入到htb数据库里,然后看到一个config数据表,进去select就能看到flag

image-20260304163131981

总结

MySQL进行远程连接有时会出现SSL加密,可以选择性更改SSL的值或者跳过SSL检测来连接,同时连接进数据库后要多注意敏感的SQL表和列