This is from the BlueHensCTF 2021.
Challenge Author: ProfNinja
My son and I tackled this one together.
For this challenge, we are given the following information and links:
Here is the mc86 Intro:
Here is the mc86 InitCode:
/give @p minecraft:written_book{title:"Init CPU",author:"UD Cyberscholars",generation:0,pages:[
"{\"text\":\"Click Here First\\n\",\"color\":\"dark_green\",\"bold\":true,\"underlined\":true,\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Creating RAM\"},\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/setblock ~1 ~ ~ minecraft:lime_shulker_box\"},
\"extra\":[
{\"text\":\"Click Here Second\\n\",\"color\":\"dark_green\",\"bold\":true,\"underlined\":true,\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Start Timing Belt\"},\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/setblock ~2 ~1 ~ minecraft:command_block[facing=up]{powered:0b,Command:\\\"setblock ~ ~-1 ~ air\\\"}\"}},
{\"text\":\"Click Here Third\\n\",\"color\":\"dark_green\",\"bold\":true,\"underlined\":true,\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Finishing Timing Belt\"},\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/setblock ~2 ~2 ~ minecraft:chain_command_block[facing=up]{powered:0b,auto:1b,conditionMet:0b,Command:\\\"execute if data block ~-1 ~-2 ~ Items[0].tag.pages[0] run setblock ~ ~-2 ~ redstone_block\\\"}\"}},
{\"text\":\"Click Here Fourth\\n\",\"color\":\"dark_green\",\"bold\":true,\"underlined\":true,\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Start CPU\"},\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/setblock ~3 ~ ~ minecraft:command_block[facing=east]{powered:0b,Command:\\\"data modify block ~2 ~ ~ Command set from block ~-2 ~ ~ Items[0].tag.pages[0]\\\"}\"}},
{\"text\":\"Click Here Fifth\\n\",\"color\":\"dark_green\",\"bold\":true,\"underlined\":true,\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Finishing CPU\"},\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/setblock ~4 ~ ~ minecraft:chain_command_block[facing=east]{powered:0b,auto:1b,conditionMet:0b,Command:\\\"data remove block ~-3 ~ ~ Items[0].tag.pages[0]\\\"}\"}},
{\"text\":\"Click Here Sixth\\n\",\"color\":\"dark_green\",\"bold\":true,\"underlined\":true,\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Placing ALU\"},\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/setblock ~5 ~ ~ minecraft:chain_command_block[facing=east]{powered:0b,auto:1b,conditionMet:0b}\"}}]}"]} 1
Finally, here is the challenge source code:
/give @p writable_book{pages:["/say please write the flag into a book (one character per page) and make that book your selected item when you run this program","scoreboard objectives add arith dummy","/kill @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}]","summon armor_stand ~ ~10 ~-20 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"A\"]}}],CustomName:\"\\\"A\\\"\",Tags:[\"ASCII\",\"A\"],\"HurtByTimestamp\":65b}","summon armor_stand ~ ~10 ~-19 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"B\"]}}],CustomName:\"\\\"B\\\"\",Tags:[\"ASCII\",\"B\"],\"HurtByTimestamp\":66b}","summon armor_stand ~ ~10 ~-18 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"C\"]}}],CustomName:\"\\\"C\\\"\",Tags:[\"ASCII\",\"C\"],\"HurtByTimestamp\":67b}","summon armor_stand ~ ~10 ~-17 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"D\"]}}],CustomName:\"\\\"D\\\"\",Tags:[\"ASCII\",\"D\"],\"HurtByTimestamp\":68b}","summon armor_stand ~ ~10 ~-16 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"E\"]}}],CustomName:\"\\\"E\\\"\",Tags:[\"ASCII\",\"E\"],\"HurtByTimestamp\":69b}","summon armor_stand ~ ~10 ~-15 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"F\"]}}],CustomName:\"\\\"F\\\"\",Tags:[\"ASCII\",\"F\"],\"HurtByTimestamp\":70b}","summon armor_stand ~ ~10 ~-14 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"G\"]}}],CustomName:\"\\\"G\\\"\",Tags:[\"ASCII\",\"G\"],\"HurtByTimestamp\":71b}","summon armor_stand ~ ~10 ~-13 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"H\"]}}],CustomName:\"\\\"H\\\"\",Tags:[\"ASCII\",\"H\"],\"HurtByTimestamp\":72b}","summon armor_stand ~ ~10 ~-12 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"I\"]}}],CustomName:\"\\\"I\\\"\",Tags:[\"ASCII\",\"I\"],\"HurtByTimestamp\":73b}","summon armor_stand ~ ~10 ~-11 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"J\"]}}],CustomName:\"\\\"J\\\"\",Tags:[\"ASCII\",\"J\"],\"HurtByTimestamp\":74b}","summon armor_stand ~ ~10 ~-10 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"K\"]}}],CustomName:\"\\\"K\\\"\",Tags:[\"ASCII\",\"K\"],\"HurtByTimestamp\":75b}","summon armor_stand ~ ~10 ~-9 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"L\"]}}],CustomName:\"\\\"L\\\"\",Tags:[\"ASCII\",\"L\"],\"HurtByTimestamp\":76b}","summon armor_stand ~ ~10 ~-8 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"M\"]}}],CustomName:\"\\\"M\\\"\",Tags:[\"ASCII\",\"M\"],\"HurtByTimestamp\":77b}","summon armor_stand ~ ~10 ~-7 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"N\"]}}],CustomName:\"\\\"N\\\"\",Tags:[\"ASCII\",\"N\"],\"HurtByTimestamp\":78b}","summon armor_stand ~ ~10 ~-6 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"O\"]}}],CustomName:\"\\\"O\\\"\",Tags:[\"ASCII\",\"O\"],\"HurtByTimestamp\":79b}","summon armor_stand ~ ~10 ~-5 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"P\"]}}],CustomName:\"\\\"P\\\"\",Tags:[\"ASCII\",\"P\"],\"HurtByTimestamp\":80b}","summon armor_stand ~ ~10 ~-4 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"Q\"]}}],CustomName:\"\\\"Q\\\"\",Tags:[\"ASCII\",\"Q\"],\"HurtByTimestamp\":81b}","summon armor_stand ~ ~10 ~-3 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"R\"]}}],CustomName:\"\\\"R\\\"\",Tags:[\"ASCII\",\"R\"],\"HurtByTimestamp\":82b}","summon armor_stand ~ ~10 ~-2 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"S\"]}}],CustomName:\"\\\"S\\\"\",Tags:[\"ASCII\",\"S\"],\"HurtByTimestamp\":83b}","summon armor_stand ~ ~10 ~-1 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"T\"]}}],CustomName:\"\\\"T\\\"\",Tags:[\"ASCII\",\"T\"],\"HurtByTimestamp\":84b}","summon armor_stand ~ ~10 ~0 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"U\"]}}],CustomName:\"\\\"U\\\"\",Tags:[\"ASCII\",\"U\"],\"HurtByTimestamp\":85b}","summon armor_stand ~ ~10 ~1 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"V\"]}}],CustomName:\"\\\"V\\\"\",Tags:[\"ASCII\",\"V\"],\"HurtByTimestamp\":86b}","summon armor_stand ~ ~10 ~2 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"W\"]}}],CustomName:\"\\\"W\\\"\",Tags:[\"ASCII\",\"W\"],\"HurtByTimestamp\":87b}","summon armor_stand ~ ~10 ~3 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"X\"]}}],CustomName:\"\\\"X\\\"\",Tags:[\"ASCII\",\"X\"],\"HurtByTimestamp\":88b}","summon armor_stand ~ ~10 ~4 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"Y\"]}}],CustomName:\"\\\"Y\\\"\",Tags:[\"ASCII\",\"Y\"],\"HurtByTimestamp\":89b}","summon armor_stand ~ ~10 ~5 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"Z\"]}}],CustomName:\"\\\"Z\\\"\",Tags:[\"ASCII\",\"Z\"],\"HurtByTimestamp\":90b}","summon armor_stand ~ ~10 ~6 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"1\"]}}],CustomName:\"\\\"1\\\"\",Tags:[\"ASCII\",\"1\"],\"HurtByTimestamp\":49b}","summon armor_stand ~ ~10 ~7 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"2\"]}}],CustomName:\"\\\"2\\\"\",Tags:[\"ASCII\",\"2\"],\"HurtByTimestamp\":50b}","summon armor_stand ~ ~10 ~8 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"3\"]}}],CustomName:\"\\\"3\\\"\",Tags:[\"ASCII\",\"3\"],\"HurtByTimestamp\":51b}","summon armor_stand ~ ~10 ~9 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"4\"]}}],CustomName:\"\\\"4\\\"\",Tags:[\"ASCII\",\"4\"],\"HurtByTimestamp\":52b}","summon armor_stand ~ ~10 ~10 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"5\"]}}],CustomName:\"\\\"5\\\"\",Tags:[\"ASCII\",\"5\"],\"HurtByTimestamp\":53b}","summon armor_stand ~ ~10 ~11 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"6\"]}}],CustomName:\"\\\"6\\\"\",Tags:[\"ASCII\",\"6\"],\"HurtByTimestamp\":54b}","summon armor_stand ~ ~10 ~12 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"7\"]}}],CustomName:\"\\\"7\\\"\",Tags:[\"ASCII\",\"7\"],\"HurtByTimestamp\":55b}","summon armor_stand ~ ~10 ~13 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"8\"]}}],CustomName:\"\\\"8\\\"\",Tags:[\"ASCII\",\"8\"],\"HurtByTimestamp\":56b}","summon armor_stand ~ ~10 ~14 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"9\"]}}],CustomName:\"\\\"9\\\"\",Tags:[\"ASCII\",\"9\"],\"HurtByTimestamp\":57b}","summon armor_stand ~ ~10 ~15 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"0\"]}}],CustomName:\"\\\"0\\\"\",Tags:[\"ASCII\",\"0\"],\"HurtByTimestamp\":48b}","summon armor_stand ~ ~10 ~16 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"{\"]}}],CustomName:\"\\\"{\\\"\",Tags:[\"ASCII\",\"{\"],\"HurtByTimestamp\":123b}","summon armor_stand ~ ~10 ~17 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"}\"]}}],CustomName:\"\\\"}\\\"\",Tags:[\"ASCII\",\"}\"],\"HurtByTimestamp\":125b}","summon armor_stand ~ ~10 ~18 {NoGravity:1b,CustomNameVisible:1b,HandItems:[{id:\"minecraft:writable_book\",Count:1b},{id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"_\"]}}],CustomName:\"\\\"_\\\"\",Tags:[\"ASCII\",\"_\"],\"HurtByTimestamp\":95b}","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 68","/scoreboard players set arg2 arith 235","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 17","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 663","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 0","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[1]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 1","/scoreboard players set arg2 arith 399","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 19","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 350","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 1","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[2]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 8","/scoreboard players set arg2 arith 193","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 178","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 331","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 2","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[3]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 15","/scoreboard players set arg2 arith 377","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 365","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 848","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 3","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[4]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 9","/scoreboard players set arg2 arith 551","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 17","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 223","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 4","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[5]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 12","/scoreboard players set arg2 arith 181","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 63","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 176","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 5","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[6]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 67","/scoreboard players set arg2 arith 294","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 139","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 760","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 6","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[7]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 2","/scoreboard players set arg2 arith 459","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 37","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 148","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 7","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[8]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 19","/scoreboard players set arg2 arith 901","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 793","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 992","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 8","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[9]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 28","/scoreboard players set arg2 arith 555","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 522","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 552","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 9","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[10]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 320","/scoreboard players set arg2 arith 71","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 1","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 838","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 10","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[11]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 62","/scoreboard players set arg2 arith 218","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 144","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 972","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 11","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[12]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 12","/scoreboard players set arg2 arith 242","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 84","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 973","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 12","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[13]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 17","/scoreboard players set arg2 arith 151","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 81","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 183","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 13","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[14]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 33","/scoreboard players set arg2 arith 680","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 305","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 756","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 14","/data modify storage udctf x set from entity @p SelectedItem.tag.pages[15]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0] set value {id:\"minecraft:writable_book\",Count:1b,tag:{pages:[\"\"]}}","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run data modify entity @s HandItems[0].tag.pages[0] set from storage udctf x","execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]}] at @s run execute store success score @s arith run data modify entity @s HandItems[0].tag.pages[0] set from entity @s HandItems[1].tag.pages[0]","/execute as @e[type=minecraft:armor_stand,nbt={\"Tags\":[\"ASCII\"]},scores={arith=0}] at @s run execute store result score xval arith run data get entity @s HurtByTimestamp","/scoreboard players set arg1 arith 86","/scoreboard players set arg2 arith 31","/scoreboard players operation arg1 arith *= arg2 arith","/scoreboard players set arg2 arith 19","/scoreboard players operation arg1 arith += arg2 arith","/scoreboard players set arg2 arith 256","/scoreboard players operation arg1 arith %= arg2 arith","/scoreboard players operation arg1 arith -= xval arith","/execute unless score arg1 arith matches 0 run say Failed at page 15","/say if you saw no failures you have probably figured out the flag, congrats"]}
As recommended by the challenge text, we got the latest Minecraft Java Launcher and launched a world:
We followed the YouTube video and gave ourselves a command block, placed it with a button on it, and posted the mc86 initcode:
We clicked the button and received an enchanted book:
We followed the instructions and clicked each of the six links to generate my mc86 computer in our world:
Next, following the YouTube video, we pasted the challenge source code into the command block we created earlier and click the button:
This gave us a book and quill with 267 pages of instructions:
After reviewing the instructions and the code, we realized that we need to hold a book and quill when we execute this program in our mc86 computer. That book and quill needed to contain the flag with one character per page.
A further code review indicated that when this program runs, it summons armor stands and puts character near them (A-Z, 0-9, _, {, and }). This must be the character set for our flag.
Further code analysis told us that when this program runs, it iterates through each page of our flag book and checks if the right character is present. If so, the program moves on and checks the next character. If it is wrong, it throws an error for the particular page and moves on to the next:
Failed at page n
We realized this program only looks a pages 0-15, that must mean the flag is only 16 characters long.
For grins, we created a book and quill with the following flag broken up between the pages (we know the flag format, so we should be good on the first 6 characters and the last):
UDCTF{FOOFOOFOO}
We then placed this book and quill into the Shulker Box:
We placed a button in the mc86 computer (as directed in the YouTube video) and and clicked it to run the challenge program:
Here are the armor stands it summoned:
After running the program, we looked at the Minecraft log file (%appdata%/.Minecraft/logs/latest.log):
By looking for the errors, we could determine what characters we had right (no error) and what characters we had wrong (error).
In this instance, the first 6 characters and the last character were correct. Characters 6-14 or pages 7-15 in our flag book and quill were wrong.
While I’m sure there was a much more elegant way to automate the, we ended up iterating through the known flag character set for the 9 wrong pages. We got pretty good at watching the chat window and counting the number of errors. When we got fewer errors than the previous run, we would review the log file to see which character did not error this time and would subsequently know the correct character for that page.
Through this process of elimination, we determined the flag to be:
UDCTF{MC86_4EVA}
This was a very fun challenge, as all of the Minecraft challenges have been.