【无标题】

CTFhub-Web-Web前置技能-http协议

题目信息

HTTP 请求方法, HTTP/1.1协议中共定义了八种方法(也叫动作)来以不同方式操作指定的资源。

HTTP Method is GET
Use CTF**B Method, I will give you flag.
Hint: If you got 「HTTP Method Not Allowed」 Error, you should request index.php.

分析

目前的方式是GET,提示用“CTF**B”方式进行链接跳转,因此,采用curl工具来使用特定http方法访问某个url。
题目实例如上:
已知测试环境:

http://challenge-dc2c8b83bb9a1e30.sandbox.ctfhub.com:10800/index.php

则采用如下语法:

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

操作过程

在这里插入图片描述

* Trying 47.98.148.7...
* TCP_NODELAY set
* Connected to challenge-dc2c8b83bb9a1e30.sandbox.ctfhub.com (47.98.148.7) port 10800 (#0)
> CTFHUB /index.php HTTP/1.1
> Host: challenge-dc2c8b83bb9a1e30.sandbox.ctfhub.com:10800
> User-Agent: curl/7.55.1
> Accept: /
>
< HTTP/1.1 200 OK
< Server: openresty/1.19.3.2
< < Date: Sun, 17 Dec 2023 09:22:10 GMT
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: PHP/5.6.40
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: X-Requested-With
< Access-Control-Allow-Methods: *
<
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>CTFHub HTTP Method
</head>
<body>
good job! ctfhub{xxxxxxxxxxx}
</body>
</html>
* Connection #0 to host challenge-beb8bdebb0d332be.sandbox.ctfhub.com left intact

延申知识

  • curl 命令利用 url 在命令行下工作的传输工具,它支持包括 file、ftp、ftps、http、https、imap、imaps、ldap、ldaps、mqtt、pop、pop3s、rtmp、rtmps、rtsp、scp、sftp、smb、smbs、smtp、smtps、telnet 和 tftp 等协议。
  • 使用方式;
curl 的选项以一或两个破折号开头,即 - 或 --,许多选项后面都需要附加值。

-d, --data <data>
主要是针对 http 协议的 post 请求指定要在消息体中发送的数据。
-i, --include
显示包含 http 消息头返回的信息输出。
-I, --header
只获取 http 协议的消息头信息,若是作用在 FTP 协议时,只获取文件大小和最后一次修改时间信息。
-H, --header <header>
主要是针对 http 协议的消息头进行设置,常用的有 -H "Content-Type:application/json"。
-o, --output <file>
将服务器的响应保存成文件,等同于 wget 命令。
-X, --request <command>
指定 http 协议的请求方式,默认为 GET 请求。
-v 参数可以显示一次 http 通信的整个过程,包括端口连接和 http request 头信息

相关推荐

  1. 标题

    2023-12-17 19:58:06       72 阅读
  2. 标题

    2023-12-17 19:58:06       69 阅读
  3. 标题

    2023-12-17 19:58:06       67 阅读
  4. 标题

    2023-12-17 19:58:06       77 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2023-12-17 19:58:06       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2023-12-17 19:58:06       106 阅读
  3. 在Django里面运行非项目文件

    2023-12-17 19:58:06       87 阅读
  4. Python语言-面向对象

    2023-12-17 19:58:06       96 阅读

热门阅读

  1. Spring Boot 自动装配的原理

    2023-12-17 19:58:06       57 阅读
  2. Angular13无法在浏览器debug

    2023-12-17 19:58:06       53 阅读
  3. UI卡顿问题

    2023-12-17 19:58:06       60 阅读
  4. centos7安装和卸载MySQL8.0

    2023-12-17 19:58:06       59 阅读
  5. linux ioctl

    2023-12-17 19:58:06       41 阅读
  6. Logcat日志记录的使用

    2023-12-17 19:58:06       57 阅读
  7. 数据结构之链表篇 单链表 循环链表 双向链表

    2023-12-17 19:58:06       68 阅读
  8. ISCTF(a)

    ISCTF(a)

    2023-12-17 19:58:06      53 阅读
  9. setState 函数的接收的参数

    2023-12-17 19:58:06       56 阅读
  10. 【Vue原理解析】之模版编译

    2023-12-17 19:58:06       62 阅读