HTB WP -Appointment

task1:

1
2
What does the acronym SQL stand for?
SQL 这个缩写代表什么意思?

回答:

1
Structured Query Language

task2:

1
2
What is one of the most common type of SQL vulnerabilities?
最常见的 SQL 漏洞类型之一是什么?

回答:

1
SQL Injection,就是SQL注入,攻击者通过在输入框中恶意输入 SQL 代码,来骗过数据库服务器,从而窃取、篡改数据,甚至直接控制整个系统。

task3:

1
2
What is the 2021 OWASP Top 10 classification for this vulnerability?
这种漏洞在 2021 版 OWASP Top 10 中的分类是什么?

回答:

1
A03:2021-Injection

task4:

1
2
What does Nmap report as the service and version that are running on port 80 of the target?
Nmap 报告的目标主机 80 端口上运行的服务和版本是什么?

回答:

那就nmap扫一下吧

1
nmap -sV 10.129.92.25

服务和版本在version里。

1
Apache httpd 2.4.38 ((Debian))

当然他都告诉你是80端口了,你可以指定端口看服务和版本

1
nmap -p 80 -sV 10.129.92.25

会比刚才快一点。

反正都做到这了,来个nmap大汇总。

1
nmap -sV IP

这是最常见的。

1
2
-s 代表 Scan
V:代表 Version(版本)

这种命令只是去探测这个容器开放了哪些端口。

而nmap其实有探测漏洞的能力(已知的公开的漏洞poc识别的)

1
nmap -sCV -p <端口> <目标IP>

这个需要指定特定端口:

1
2
3
4
5
-p 80:指定只扫描 80 端口。(-p后可指定多个端口,端口之间用逗号连接,也可指定端口范围,如-p 1-1000)
-sCV:等同于 -sC -sV
-sV:探测服务的精确版本
-sC:调用默认的安全脚本探测常见漏洞和敏感信息。使用默认脚本集执行脚本扫描。相当于 --script=default 。此类别中的某些脚本被认为具有侵入性,未经允许不应在目标网络上运行。
-p-:扫描全端口

对了-T4参数可以加快扫描速度。

后面还会有总结。

task5:

1
What is the standard port used for the HTTPS protocol?HTTPS 协议使用的标准端口是什么?

回答:

1
443

task6:

1
2
What is a folder called in web-application terminology?
在 Web 应用程序术语中,文件夹被称为什么?

回答:

1
(Directory)-目录

task7:

1
2
What is the HTTP response code that is returned for Not Found errors?
对于“未找到(Not Found)”错误,返回的 HTTP 状态码是什么?

回答:

1
404

task8:

1
2
Gobuster is one tool used to brute force directories on a webserver. What switch do we use with Gobuster to specify we're looking to discover directories, and not subdomains?
Gobuster 是用于对 Web 服务器上的目录进行暴力破解的工具之一。我们在使用 Gobuster 时应该使用哪个参数(开关)来指定我们要寻找的是目录,而不是子域名?

回答:

1
2
dir
命令格式:gobuster dir -u http://目标网址 -w 字典路径.txt

task9:

1
2
What single character can be used to comment out the rest of a line in MySQL?
在 MySQL 中,可以使用哪单个字符来注释掉某行的其余部分?

回答:

1
2
3
4
5
6
#

MySQL 其实支持三种注释方式:
#(单行注释,符合你这道题“单个字符”的要求)
-- (双减号+空格,也是单行注释,注意后面必须有一个空格或控制字符)
/* 注释内容 */(多行/内联注释)

task10:

1
2
If user input is not handled carefully, it could be interpreted as a comment. Use a comment to login as admin without knowing the password. What is the first word on the webpage returned?
如果用户输入没有被小心处理,它可能会被解释为注释。利用注释在不知道密码的情况下以管理员(admin)身份登录。返回的网页上的第一个单词是什么?

回答:

1
Congratulations

这个怎么得到的呢?通过拿到靶机的flag回显的:

题目已经提示了是SQl注入了。

对应的SQl语句是:

1
SELECT * FROM users WHERE username = 'admin'#' AND password = '123'

#把AND后面的语句注释掉了。

拿到flag.

1
保护免受 SQL 注入的技术有很多,其中一些是:输入验证、参数化查询、存储过程,以及在服务器网络边界部署 WAF(Web 应用程序防火墙)。