hack the box tier1 Appointment
HTB WP -Appointment
task1:
1 | What does the acronym SQL stand for? |
回答:
1 | Structured Query Language |
task2:
1 | What is one of the most common type of SQL vulnerabilities? |
回答:
1 | SQL Injection,就是SQL注入,攻击者通过在输入框中恶意输入 SQL 代码,来骗过数据库服务器,从而窃取、篡改数据,甚至直接控制整个系统。 |
task3:
1 | What is the 2021 OWASP Top 10 classification for this vulnerability? |
回答:
1 | A03:2021-Injection |
task4:
1 | What does Nmap report as the service and version that are running on port 80 of the target? |
回答:
那就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 | -s 代表 Scan |
这种命令只是去探测这个容器开放了哪些端口。
而nmap其实有探测漏洞的能力(已知的公开的漏洞poc识别的)
1 | nmap -sCV -p <端口> <目标IP> |
这个需要指定特定端口:
1 | -p 80:指定只扫描 80 端口。(-p后可指定多个端口,端口之间用逗号连接,也可指定端口范围,如-p 1-1000) |
对了-T4参数可以加快扫描速度。
后面还会有总结。
task5:
1 | What is the standard port used for the HTTPS protocol?HTTPS 协议使用的标准端口是什么? |
回答:
1 | 443 |
task6:
1 | What is a folder called in web-application terminology? |
回答:
1 | (Directory)-目录 |
task7:
1 | What is the HTTP response code that is returned for Not Found errors? |
回答:
1 | 404 |
task8:
1 | 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? |
回答:
1 | dir |
task9:
1 | What single character can be used to comment out the rest of a line in MySQL? |
回答:
1 | # |
task10:
1 | 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? |
回答:
1 | Congratulations |
这个怎么得到的呢?通过拿到靶机的flag回显的:
题目已经提示了是SQl注入了。
对应的SQl语句是:
1 | SELECT * FROM users WHERE username = 'admin'#' AND password = '123' |
#把AND后面的语句注释掉了。
拿到flag.
1 | 保护免受 SQL 注入的技术有很多,其中一些是:输入验证、参数化查询、存储过程,以及在服务器网络边界部署 WAF(Web 应用程序防火墙)。 |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 joke的小世界!
评论
