Java Script Kiddie
Last updated
Last updated
The image link appears broken... https://2019shell1.picoctf.com/problem/57738 or http://2019shell1.picoctf.com:57738
Webpage source code:
Run $.get("bytes", function(resp) {bytes = Array.from(resp.split(" "), x => Number(x));});
from the source code in developer console to get list of bytes:
The website takes the above list of bytes and shifts them based on the key the user enters. For each character in the key, the script shifts every 16th byte starting with byte i
, where i
is the index of the character in the key. In this way, the first 16 bytes of the image correspond to the 16 digits in the user-specified key.
A PNG file consists of a PNG signature followed by a series of chunks. The first eight bytes of a PNG file always contain the following (decimal) values: 137 80 78 71 13 10 26 10
. Each chunk header has a well-known structure: 4 bytes of length and 4 bytes of chunk type. The first chunk is called IHDR
and has the length of 0xD
, so we know that the next 8 bytes are 00 00 00 0D 49 48 44 52
.
Run script.py. For each character of the key, this script will try all digits until one is found that places the expected value in the current location.
Output:
Enter key into website and save image:
Use zbar
(sudo apt install zbar-tools
): zbarimg index.png
and get the flag:
picoCTF{905765bf9ae368ad98261c10914d894e}