当前位置:网站首页>HackTheBox-baby CachedView
HackTheBox-baby CachedView
2022-06-28 18:11:00 【galaxy3000】
List of articles
summary
HackTheBox Website CTF shooting range Web Related topics baby CachedView, Title address https://app.hackthebox.com/challenges/baby-cachedview, The main investigation is IP Bypass ideas of address restrictions .

subject
Title Overview
The title provides attachment download , After decompression, as shown in the figure 
The main idea of the title prompt is that after experiencing a security accident, the service of the website is based on IP Address restrictions .
After opening the program instance , Prompt to visit 138.68.142.134:31643, visit http://138.68.142.134:31643, See the following Web Interface 
see requirements.txt, Found as Flask application
Flask
selenium
Source code
routes.py
from flask import Blueprint, request, render_template, abort, send_file
from application.util import cache_web, is_from_localhost
web = Blueprint('web', __name__)
api = Blueprint('api', __name__)
@web.route('/')
def index():
return render_template('index.html')
@api.route('/cache', methods=['POST'])
def cache():
if not request.is_json or 'url' not in request.json:
return abort(400)
return cache_web(request.json['url'])
@web.route('/flag')
@is_from_localhost
def flag():
return send_file('flag.png')
You can see in the route /flag route , This route has two decorators , Which USES util.py
util.py
Source code analysis
The source code submitted on the front page of the target , from /cache Respond to , after cache_web Function returns the result after processing , stay cache_web In function IP Address restrictions , It's mainly about 127 Network segment 、172.16 Network segment 、192.168 Such as the restriction of Intranet segment .
And if you visit /flag route , Will be in the decorator check_ip Handle , If it's not a local address (127.0.0.1) Will be banned .
Practical verification , First, enter... In the input box http://138.68.142.134:31643/flag, Triggered check_ip The inspection of 
If you enter... In the input box http://127.0.0.1:31643/flag, Triggered cache_web The inspection of , Tips IP not allowed
Their thinking
Deploy on the cloud server Web service , The input address in the input box is the ECS address , adopt cache_web The inspection of , And on the server Web Content for local access flag
Question answer
Deploy on the cloud server index.html, The content is
<meta http-equiv="refresh" content="0; URL=http://127.0.0.1:31643/flag" />
Enter the ECS address in the input box 
obtain flag
边栏推荐
- Ding! Techo day Tencent technology open day arrived as scheduled!
- Small program graduation design based on wechat real estate intermediary house viewing appointment small program graduation design opening report function reference
- dataworks SQL脚本支持语句块的if else 判断吗
- Ten MySQL locks, one article will give you full analysis
- EasyExcel 学习笔记
- The fourth largest operator cannot be a "catfish"
- [tcapulusdb knowledge base] modify business modify cluster
- 11 effective ways to enhance WordPress
- nuc980心跳灯
- 想请教股票开户找人办比较方便么?网上开户安全么?
猜你喜欢

Database mysql statement final review CTGU

Ten MySQL locks, one article will give you full analysis

Redis持久化(少年一貫快馬揚帆,道阻且長不轉彎)
![The most complete 360 software test case template without dead corners in the whole network [recommended collection]](/img/57/99ae60b140da52e94ef88891772729.jpg)
The most complete 360 software test case template without dead corners in the whole network [recommended collection]

Flutter 小技巧之 MediaQuery 和 build 优化你不知道的秘密

The fourth largest operator cannot be a "catfish"

第四个专栏,Kubernetes云原生实战,它来了~

Small program graduation design based on wechat driving school examination small program graduation design opening report function reference

Kubernetes visual interface dashboard

为什么 insert 配置 'SELECT LAST_INSERT_ID()' 返回个0呢?
随机推荐
2022 recurrent training question bank and online simulation examination for main principals of hazardous chemicals business units
为什么 insert 配置 'SELECT LAST_INSERT_ID()' 返回个0呢?
2022 chemical automation control instrument test simulation 100 questions simulation test platform operation
Panorama of enterprise power in China SSD industry
2022A特种设备相关管理(电梯)特种作业证考试题库及在线模拟考试
终于辞职了,全职ue了
Matlb| visual learning (plot and bar)
全网最全360无死角编写软件测试用例模板【建议收藏】
How to configure the Oracle CDC service name without Sid?
The MySQL installed in Alibaba cloud server is version 8. Is it because the MySQL driver version of dataworks does not support it? Now mention
Squid proxy server application (I came from afar to make an appointment with you)
问下 flink sql cdc. 能同步多张表然后sink到一份表中么 同步的表通过 joi
数据源只能连阿里云的云数据库吗?阿里云服务器里装的数据库连不上嘛?
Database mysql statement final review CTGU
Finally quit, full-time UE
Can data sources only be connected to Alibaba cloud cloud databases? Can't you connect the databases installed in Alibaba cloud servers?
Does the dataworks SQL script support if else judgment of statement blocks
2022年7月计划(全力unreal)
[algorithm] I brushed two big factory interview questions and learned array again with tears in my eyes“
2022危险化学品生产单位安全生产管理人员复习题及答案