📖
CTF Wiki
  • 🚩Arne's CTF Writeups!
  • 2025
    • TUCTF
      • Forensics - Security Rocks
    • San Diego CTF
      • Crypto - RustSA
      • Misc - Triglot
  • 2024
    • Lexington CTF
      • Misc - a little bit of tomcroppery
    • Imaginary CTF
      • Web - Journal
    • Space Heroes CTF
      • Web - Antikythera
    • HTB Cyber Apocalypse
      • Pwn - Sound of Silence
      • Misc - MultiDigilingual
  • 2023
    • NahamConCTF
      • Mobile - Red Light Green Light
    • BucketCTF
      • Rev - Schematic
      • Rev - Random security
    • HTB Cyber Apocalypse
      • Rev - Cave System
      • Rev - Somewhat Linear
      • Pwn - Void
  • 2022
    • DownUnderCTF 2022
      • Cloud - Jimmy Builds a Kite
    • Ã¥ngstromCTF 2022
      • Pwn - really obnoxious problem
      • Pwn - whatsmyname
    • Engineer CTF
      • Misc - Not really random
      • Misc - Broken Pieces
    • KnightCTF 2022
    • HTB CTF: Dirty Money
      • Forensics - Perseverance
  • 2021
    • MetaCTF CyberGames 2021
    • HTB - Cyber Santa
      • RE - Infiltration
    • Securebug CTF Thor 2021
      • Web - Tricks 1
      • Web - Tricks 2
      • RE - Hidden in Plain Sight
    • TFC CTF 2021
      • RE - Crackity
      • Pwn - Jumpy
      • Misc - Weird Friend
    • K3RN3L CTF 2021
      • Crypto - Pascal RSA
    • DamCTF 2021
      • Misc - library-of-babel
      • Pwn - cookie-monster
    • Killer Queen CTF 2021
      • Pwn - Tweety Birb
      • Forensics - Tippy Tappies
      • Pwn - I want to break free
    • BuckeyeCTF 2021
      • Web - pay2win
      • Misc - USB Exfiltration
Powered by GitBook
On this page
  • Description
  • Downloads
  • Solution
  1. 2023
  2. BucketCTF

Rev - Schematic

Easy | 284 points

Last updated 2 years ago

Description

Downloads

Solution

A quick google search revealed that .schematic files are in the NBT file format.

Open the file using NBTExplorer.

At the start I thought the dispenser will be one of the TileEntities so I tried to find it using the following python code:

from nbt import nbt

nbtfile = nbt.NBTFile("Ricardo3s_60AP_100C_200SB.schematic",'rb')

for tileentities in nbtfile['TileEntities']:
	try:
		for item in tileentities['Items']:
			print(item)
	except:
		print(tileentities)

As it turns out, TileEntities only contain either minecraft:tnt item or a Minecraft Comparator.

I then proceeded to search up on Minecraft dispenser to find out what exactly it is since it is not in TileEntities.

It seems like a Dispenser is a block. I then edited the python script to print out all the blocks.

from nbt import nbt
nbtfile = nbt.NBTFile("Ricardo3s_60AP_100C_200SB.schematic",'rb')
print(nbtfile['Blocks'])

The output is as follows:

The output is an array of numbers which suggests that every block is stored as a unique number that determines which block type it is. Previously from the Minecraft wiki page, we can also see the number 23 under the dispenser's Numeric ID. Now we just need to count the number of dispensers with the following code:

from nbt import nbt
nbtfile = nbt.NBTFile("Ricardo3s_60AP_100C_200SB.schematic",'rb')

# Count number of blocks with 23 as Numeric ID
print(len([i for i in nbtfile['Blocks'] if i == 23]))

Flag: bucket{2238}

15KB
Ricardo3s_60AP_100C_200SB.zip
archive
From Minecraft Wiki
NBTExplorer GUI
Python output
From Minecraft Wiki once again
Python output