CTF学习记录005-web一个简单的重定向

文章讲述了如何通过Burp工具抓包分析,识别出302重定向的网页题目中的flag。方法一是观察NotModified响应并点击链接抓取;方法二是分析GET请求和响应,推测URL结构,直接构造GET请求获取flag。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

题目:302重定向,打开页面显示如下

这个题目有2个方法可以拿到flag。

首先都是用Burp抓包。

1、用Burp抓取打开题目页面的报文,回应报文显示

304 Not Modified,既然知道是重定向的题目,点击 Give me Flag 链接,再次抓包,得到回应报文

拿到flag。

2、观察刚打开题目页面的请求报文。

GET 值里面 没有具体的URL,看回应报文里面 server:openresty 可知服务器使用了PHP环境,猜测可能由index.html 重定向到 index.php。还有注意观察Give me Flag链接地址也是index.php。构造GET  /index.php HTTP/1.1 直接发包。

同样可以拿到flag 。

### CTF Web Challenge Bypass Redirection Techniques In the context of Capture The Flag (CTF) competitions, web challenges often involve intricate mechanisms to test participants' skills in identifying and exploiting vulnerabilities within web applications. One common technique involves bypassing redirections that are intended to prevent access or further exploitation. Redirection can be implemented on both client-side using JavaScript or server-side through HTTP status codes like `301` Moved Permanently or `302` Found. For client-side redirections, manipulating the DOM directly via browser developer tools might allow one to skip unwanted navigation actions[^1]. For server-side redirections, several methods exist: - **HTTP Parameter Pollution (HPP)**: By injecting additional parameters into URLs, it is sometimes possible to interfere with how servers process requests leading up to a redirect. - **URL Encoding**: Some systems improperly handle encoded characters which could lead them to misinterpret parts of URL causing unexpected behavior during redirects[^2]. - **Custom Headers Manipulation**: Adding specific headers such as `X-Original-URL`, `Referer`, etc., may influence where an application sends users after processing their request. An example demonstrating manipulation of custom headers follows below: ```python import requests headers = { 'Host': 'example.com', 'X-Original-URL': '/target_page' } response = requests.get('http://vulnerable-site.com/redirect', headers=headers) print(response.url) ``` This script attempts to alter the destination path by setting non-standard header fields before making a GET request towards what would normally result in being redirected away from `/target_page`.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值