CTFHub —— HTTP 协议

警告
本文最后更新于 2023-02-08,文中内容可能已过时。

根据 HTTP 标准,HTTP 请求可以使用多种请求方法。

HTTP1.0 定义了三种请求方法: GET、POST 和 HEAD 方法。

HTTP1.1 新增了六种请求方法:OPTIONS、PUT、PATCH、DELETE、TRACE 和 CONNECT 方法。

序号 方法 描述
1 GET 请求指定的页面信息,并返回实体主体。
2 HEAD 类似于 GET 请求,只不过返回的响应中没有具体的内容,用于获取报头
3 POST 向指定资源提交数据进行处理请求(例如提交表单或者上传文件)。数据被包含在请求体中。POST 请求可能会导致新的资源的建立和/或已有资源的修改。
4 PUT 从客户端向服务器传送的数据取代指定的文档的内容。
5 DELETE 请求服务器删除指定的页面。
6 CONNECT HTTP/1.1 协议中预留给能够将连接改为管道方式的代理服务器。
7 OPTIONS 允许客户端查看服务器的性能。
8 TRACE 回显服务器收到的请求,主要用于测试或诊断。
9 PATCH 是对 PUT 方法的补充,用来对已知资源进行局部更新 。

—— 菜鸟教程

1
curl -v -X CTFHUB http://challenge-c8dfe8679a8f7a71.sandbox.ctfhub.com:10800/index.php

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422162836555.png

更改请求方式并点击Forward放包

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/XpfP5QS7Z3WvV8H.png

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422162916895.png

检查页面发现index.php302重定向到index.html

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422162935948.png

1
curl -v http://challenge-18d0cac3b48eaf9a.sandbox.ctfhub.com:10800/index.php

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422162957405.png

Ctrl + R快捷Send to Repeater,在Repeater模块点击Send重发请求

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422163008827.png

修改admin=0admin=1,重发请求

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422163017948.png

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422163036714.png

随意输入账号密码,查看响应报文,猜测账号为 admin

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422163050854.png

Ctrl + I将报文Send to Intruder,点击Add §Authorization: Basic后的 base64 字符串添加为 payload position

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422163110400.png

进行如下设置,其中的密码字典由题目附件提供,点击Start attack开始爆破

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422163120513.png

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422163134374.png

点击Status将状态码排序,状态码为 200 即爆破成功,点击该记录,查看Response可得 flag

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422163146613.png

查看源代码即可

https://f005.backblazeb2.com/file/img-buckets-oqh/2023/04/image-20230422163146613.png