5

【Root-Me】 CRLF

 2 years ago
source link: https://exp-blog.com/safe/ctf/rootme/web-server/crlf/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

【Root-Me】 CRLF



题目有2个提示:

  • 注入异常数据到日志(Inject false data in the journalisation log)

打开挑战页面后,发现三行初始日志,稍微分析下:

# Authentication log
admin failed to authenticate.    # admin 认证失败
admin authenticated.                # admin 认证成功
guest failed to authenticate.     # guest 认证成功

在登录框随便输入一些内容,日志会刷新一行: ${username} failed to authenticate.,而 password 的内容不会打印到日志,亦即我们可以控制的输入位置为 ${username}

01.png

到此可以基本推断出:我们需要在 username 的输入框中进行注入某个 payloads,使得日志中打印一行 guest authenticated. 进行欺骗。

注入方式是题目已提示是 CRLF,即回车换行,对应的 URL 编码是 %0d%0a (注意空格的 URL 编码是 %20)。

使用 Burp Suite -> Repeater 打开页面,在 HTTP 请求参数设置 payloads :

?username=guest%20authenticated.%0d%0aexp&password=none

提交后成功欺骗,获得密码,完成挑战。

02.png

flag 下载后的 flagzip 的文件需要手动更改后缀为 *.zip,然后解压即可(为了避免直接刷答案)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK