[b01lers2020]Welcome to Earth
Posted mech
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[b01lers2020]Welcome to Earth相关的知识,希望对你有一定的参考价值。
一直自动跳转/die/
页面,只能抓包看
看到有个/chase/
,进去看一下
去/leftt/
中看一眼
后面就一路找,但是没找到什么有用的信息
看了wp才知道,关键点在js文件中
/static/js/door.js
最后来到static/js/fight.js
// Run to scramble original flag
//console.log(scramble(flag, action));
function scramble(flag, key) {
for (var i = 0; i < key.length; i++) {
let n = key.charCodeAt(i) % flag.length;
let temp = flag[i];
flag[i] = flag[n];
flag[n] = temp;
}
return flag;
}
function check_action() {
var action = document.getElementById("action").value;
var flag = ["{hey", "_boy", "aaaa", "s_im", "ck!}", "_baa", "aaaa", "pctf"];
// TODO: unscramble function
}
看起来flag顺序被打乱了,排列组合一下就行
#coding:utf-8
from itertools import permutations
flag = ["{hey", "_boy", "aaaa", "s_im", "ck!}", "_baa", "aaaa", "pctf"]
item = permutations(flag)
for i in item:
k = ‘‘.join(list(i))
if k.startswith(‘pctf{hey_boys‘) and k[-1] == ‘}‘:
print(k)
最后flagpctf{hey_boys_im_baaaaaaaaaack!}
参考
https://www.yuque.com/u390550/kdmol2/ul9gfw
以上是关于[b01lers2020]Welcome to Earth的主要内容,如果未能解决你的问题,请参考以下文章
[b01lers2020]safety_in_numbers
BUUCTF-[b01lers2020]Life on Mars
BUUCTF-[b01lers2020]Life on Mars