the-eye
Descrição do Desafio:
Autor: aplet123 Categoria: rev Descrição:
I believe we’ve reached the end of our journey. All that remains is to collapse the innumerable possibilities before us.
Arquivos
Dockerfile
Docker.
solve.py
Script.
the-eye
Executável.
📥 Download: Arquivos
Passo a Passo da Solução
1. Análise do executável
Analisando o executável, vemos que é um código sem muito segredo. Ele possuí 3 funções principais:
main()
: chama função que lê a flag, chama uma função que embaralha a flag 22 vezes, e por fim imprime o resultado.read_msg()
: é função responsável por ler a flag, na verdade ela lê o conteúdo do arquivomsg.txt
.shuffle()
: com base em um valor aleatório, troca a posição de todos os caracteres da flag, indo do último índice até o ínicio.
2. Solução
A solução é bem simples, devemos refazer o shuffle utilizando os índices no lugar dos caracteres, aí no final teremos uma lista que nos diz em qual é posição original do caractere.
Porém devemos nos atentar à alguns pontos:
Aleatorização: o código usa uma seed específica para realizar o shuffle, e sem essa seed é impossível refazer o shuffle. Porém, a seed utilizada é
time(NULL)
, assim quando abrirmos o executável na solução já setamos a seed junto. Perceba que quando o executável é aberto remotamente, há alguns atrasos de conexão, então a seed viratime(NULL) - (algum valor)
.Na função shuffle, o segundo valor do módulo (originalmente o tamanho da mensagem), é modificado a cada iteração para ser ele mesmo menos 1.
Output
Outer Wilds is an action-adventure video game set in a small planetary system in which the player character, an unnamed space explorer referred to as the Hatchling, explores and investigates its mysteries in a self-directed manner. Whenever the Hatchling dies, the game resets to the beginning; this happens regardless after 22 minutes of gameplay due to the sun going supernova. The player uses these repeated time loops to discover the secrets of the Nomai, an alien species that has left ruins scattered throughout the planetary system, including why the sun is exploding. A downloadable content expansion, Echoes of the Eye, adds additional locations and mysteries to the game. lactf{are_you_ready_to_learn_what_comes_next?}
Flag
lactf{are_you_ready_to_learn_what_comes_next?}
Autores da WriteUp
Membro de Exploitation - HenriUz Membro de Exploitation - CaioMendesRRosa
Atualizado