Challenge

We receive a .ttf font file. The flag is the input string that, when typed and rendered with this font, produces a special glyph.

Approach

  1. Open the font in FontForge or parse it with fonttools:
1
2
3
4
5
6
7
8
from fonttools import ttLib
tt = ttLib.TTFont("franklin.ttf")
gsub = tt["GSUB"].table
for lookup in gsub.LookupList.Lookup:
    for sub in lookup.SubTable:
        for ligature_set in sub.ligatures.values():
            for lig in ligature_set:
                print(lig.Component, "->", lig.LigGlyph)
  1. One ligature rule maps the sequence ['f','R','4','n','k','l','1','n','_','f','0','n','7'] to a single “flag” glyph.
  2. The input sequence is the flag content.

Flag

boroCTF{fR4nkl1n_f0n7}