Day 1

Description

Every year, Santa maintains the legendary Naughty-or-Nice list, and despite the rumors, there’s no magic behind it at all—it’s pure, meticulous byte-level bookkeeping. Your job is to apply every tiny change exactly and confirm the final list matches perfectly—check it once, check it twice, because Santa does not tolerate even a single incorrect byte. At the North Pole, it’s all just static analysis anyway: even a simple objdump | grep naughty goes a long way.

Provided

/challenge/check-list

My Solve

First check what type of file it is, run the binary

$ file /challenge/check-list
/challenge/check-list: setuid ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=bec7b06ce41d2387ff43f204bc4e91193111b83a, stripped

Running the binary stops at stdin, providing any input returns

🚫 Wrong: Santa told you to check that list twice!

Naturally , I started decompiling with IDA. but i think the file was too large or something

Decided to go with dynamic analysis with gdb

gef➤  x/30i $rip
=> 0x401000:    mov    rbp,rsp
   0x401003:    sub    rsp,0x500
   0x40100a:    mov    eax,0x0
   0x40100f:    mov    edi,0x0
   0x401014:    lea    rsi,[rbp-0x400]
   0x40101b:    mov    edx,0x400
   0x401020:    syscall
   0x401022:    sub    BYTE PTR [rbp-0x49],0xc0
   0x401026:    add    BYTE PTR [rbp-0x1cb],0xa
   0x40102d:    add    BYTE PTR [rbp-0x1d0],0xb7
   0x401034:    sub    BYTE PTR [rbp-0x1fc],0x60
   0x40103b:    sub    BYTE PTR [rbp-0x58],0xc3
   0x40103f:    sub    BYTE PTR [rbp-0x4b],0x63
   0x401043:    sub    BYTE PTR [rbp-0x3],0xc5
   0x401047:    add    BYTE PTR [rbp-0x3d6],0x4e
   0x40104e:    add    BYTE PTR [rbp-0x11a],0xa7
   0x401055:    sub    BYTE PTR [rbp-0x2b1],0x94
   0x40105c:    sub    BYTE PTR [rbp-0x120],0x5e
   0x401063:    add    BYTE PTR [rbp-0x264],0xe6

Up to 0x400 bytes are read from stdin and stored at [rbp-0x400]. In the next few instructions after the read syscall, these input bytes are manipulated, with random values being added to and subtracted from each byte.

Since there are a lot of these operations, I decided to just check what each byte ends up being compared with after all the add and subtract steps.

$ objdump -d -M intel /challenge/check-list | grep cmp| grep -o ',0x[0-9a-fA-F]\+' |  tr '\n' ' ' > cmp.txt

Extracting these bytes via grep, we have in a python list :

values = [
0x2b,0x8f,0x22,0xaf,0xc7,0x19,0xbc,0x74,0x46,0xc2,0x4f,0x1d,0x30,0x97,0x4e,0xaf,0x73,0xe4,0x22,0xfd,0xb6,0x3e,0x47,0x1f,0xbd,0x63,0x30,0xd2,0xc0,0x2,0x17,0x4d,0xd4,0xf8,0x2b,0x20,0x6b,0x42,0x6d,0x94,0x60,0x35,0xdd,0xbb,0xde,0xba,0xad,0x89,0xde,0xc2,0xc9,0xb4,0xf3,0x16,0x96,0x81,0x59,0xf3,0xbb,0xac,0x7b,0xb2,0xe7,0x9e,0x38,0xf5,0xc0,0x29,0x9d,0xc9,0x42,0xee,0xc5,0x61,0x4f,0xde,0x24,0xc9,0xc6,0xfa,0xe,0xbc,0x55,0xcf,0xe0,0x8b,0x27,0x2b,0x6e,0x1b,0x8f,0xa9,0x92,0x40,0x4b,0x22,0x6d,0xa3,0x60,0x2a,0xa5,0x60,0x3a,0xec,0xf8,0x32,0x6f,0x18,0x6,0xe7,0x1,0x26,0x57,0x35,0x24,0xfa,0xc4,0x12,0xfe,0x5d,0x7d,0xb2,0x2f,0x46,0xa8,0xd,0x4a,0x50,0xd6,0xc0,0x8a,0x27,0xd,0xdb,0x32,0xd8,0xa5,0xd7,0x43,0x64,0x9c,0xda,0xee,0x75,0x5d,0x65,0x12,0x5d,0xe6,0x5c,0x1e,0x7f,0x6b,0x8f,0x6b,0x5a,0xc3,0x77,0xc,0xf3,0xfc,0x85,0x89,0xfc,0xda,0xa5,0xba,0x8a,0x8e,0x16,0xba,0x3b,0x78,0x37,0xfe,0xe6,0xac,0x11,0xc3,0x97,0x75,0x9f,0x7f,0x9a,0xd0,0x55,0x81,0xca,0x4e,0xd1,0xf1,0xb4,0xa9,0x4a,0x16,0x2a,0x9b,0x98,0xcc,0x3f,0x45,0x8a,0xa0,0x6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46,0xdb,0x28,0xda,0x6b,0xcc,0x69,0xe2,0x30,0x16,0x1e,0xc6,0xb5,0x7e,0x98,0xf0,0x40,0x9,0x46,0x82,0xfa,0xc3,0x62,0xaf,0x6a,0xd7,0x4f,0x6e,0x1f,0x2b,0x2e,0xe4,0x31,0x2f,0xad,0xb8,0x45,0x75,0x75,0x50,0xb1,0x3b,0x46,0xe2,0x7c,0x40,0xd6,0x8,0x11,0x69,0x43,0x31,0xdc,0xa4,0x55,0x58,0x83,0x9,0xb4,0xd2,0xf3,0x7,0x7a,0x30,0xfb,0xd2,0xd3,0x91,0xc6,0x82,0xa9,0x38,0xa1,0xf4,0xd1,0x76,0x9,0xa0,0xb3,0xae,0xb6,0x46,0xaa,0x2f,0x9b,0x7e,0x92,0x3a,0xee,0x25,0xba,0xf7,0xb0,0x4e,0xa4,0xad,0x3f,0x96,0x97,0x12,0xf5,0x84,0x98,0xc5,0x42,0xd7,0xdc,0xa0,0x8a,0x55,0xbb,0x7b,0x82,0x5f,0x7d,0x55,0x45,0xd9,0xc0,0x6e,0xe4,0x4c,0x9,0x8f,0xca,0x38,0xb,0xdb,0x0,0x65,0x53,0xaf,0x7c,0x3c,0xc1,0x74,0xd4,0x7e,0x9,0xab,0x29
]

I decided to send 0x400 bytes 0xff via stdin, so that after the addition and subtraction operation is done , i can have the resulting bytes before the compare instructions , this way, i can know how to adjust my input so it ends up as the bytes i wxtracted above

from pwn import *


context.update(arch="amd64") 


path =  '/challenge/check-list'


gdbscript = """
set logging file dump.txt
break *0xaa1454

commands 1
    set $start = $rbp - 1
    set $end = $rbp - 0x400
    set $size = $end - $start
    set $i = 0
    set logging on
    printf "DumpStart\\n"

    while ($i <= 0x400)
        printf "0x%x,", *(unsigned char*)($end + $i)
        set $i = $i + 1
    end
    printf "\\nDumpEnd\\n"
    set logging off
end

continue
"""


initial_values =  [0xff] * 0x400

p = gdb.debug(path, gdbscript=gdbscript, api=True)
p.send(initial_values)

The resulting bytes are dumped in dump.txt file, putting that in a list

ola_val = [0xf1,0xfb,0xa0,0xbb,0x93,0x8a,0x40,0xa0,0x74,0xb4,0x22,0xc1,0xae,0x6f,0xf8,0x3e,0xa6,0xf4,0x1a,0x4a,0xe0,0x6,0x9c,0x79,0x12,0xa,0x53,0x23,0x6e,0xdb,0x76,0xb1,0x2,0x60,0xd9,0x47,0xa2,0xbd,0x45,0xa0,0xca,0xe7,0x3b,0x8,0x74,0x1c,0xf4,0x8,0xaa,0x28,0x58,0x54,0xd8,0xe,0x1a,0x5c,0xee,0xa4,0x55,0x77,0xd8,0xfc,0xaf,0x42,0x3,0x10,0x46,0x3b,0xd7,0xc8,0x67,0x38,0xc,0x25,0x89,0xf3,0xe7,0x82,0x6d,0x6f,0xd9,0xf3,0x61,0x43,0x8d,0x95,0x15,0xe4,0x2a,0xb8,0x40,0x80,0x44,0x6b,0x6c,0x1,0xe2,0x18,0xd8,0x7,0x21,0x8f,0x63,0x6a,0x3a,0x92,0x59,0xcc,0x5e,0xf7,0x20,0x13,0x4,0x3e,0x1b,0x5b,0xb0,0x2b,0x7e,0xbf,0x7,0xa2,0x87,0x62,0x5b,0xb6,0xa4,0xdc,0x7,0x5,0x5e,0x83,0x74,0x84,0xfd,0x1,0xec,0x0,0x2a,0xde,0xc9,0xdd,0xda,0xb5,0x67,0x8c,0xfb,0x60,0x84,0xac,0xdb,0x4b,0xd9,0x9b,0x43,0xb8,0x8e,0x98,0xd7,0x63,0x6e,0x5b,0x91,0x31,0x5a,0xca,0x21,0x37,0x6a,0x57,0xf1,0x20,0x56,0x82,0x64,0x23,0x1a,0x3a,0x67,0x8a,0x9a,0x7e,0x5b,0xde,0x7a,0x83,0xd2,0xe5,0x2c,0x21,0xac,0x98,0xeb,0x97,0xf2,0xec,0x6a,0x21,0x48,0x2,0x59,0x2b,0xd2,0x39,0x50,0xbc,0x0,0x3b,0x96,0xa5,0xad,0xdf,0x83,0xe5,0x8f,0x27,0xac,0x66,0xde,0x20,0x30,0xd,0xd8,0x85,0xff,0x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x56,0xaa,0x25,0x85,0x5d,0xb9,0xbb,0xb7,0xc8,0x59,0xc9,0xe7,0x44,0xc8,0xe0,0x37,0x56,0xb9,0xde,0xe8,0x4b,0xa9,0xf9,0xa4,0xae,0xee,0x40,0x2b,0x0,0x8c,0xea,0xb9,0x21,0x84,0xdd,0x79,0xb9,0xd5,0x4e,0x1b,0xb8,0xf3,0x52,0xc3,0x34,0x82,0x5,0x16,0xfc,0xff,0x95,0xb,0x46,0x5b,0xb8,0xe9,0x74,0x8e,0xeb,0x4c,0xde,0x38,0xb6,0x68,0x6d,0x89,0x4e,0x97,0x66,0x5,0x36,0x1a,0x3c,0xc7,0x2c,0x81,0x67,0xba,0xa9,0xd7,0x1d,0xff,0x21,0xa3,0x4e,0xaf,0xd4,0x26,0xa7,0xfc,0xbc,0x48,0xe,0xbc,0x6c,0xd4,0xbb,0xfd,0x5b,0x5b,0xa8,0x69,0xb4,0x9c,0x49,0x1c,0xf,0x61,0xad,0x8b,0x12,0xdc,0x92,0xf,0xb7,0x8d,0x3,0x9,0x3a,0x63,0x4,0x1,
]

I can calculate the values needed to be send such that after the operations we end up with the values compared with

result = []
for i in range((0x400)):
    result.append(((values[i] + (0xff - ola_val[i])) & 0xff))

Finally


payload = bytes(result)

p = process(path)

p.send(payload)