Strace Ltrace Retrace

Information

KringleCon - Kitchen

Pasted image 20220910184330

Conversations

Pasted image 20220910184247


Solution

Took a look at the files on the terminal, saw there was a bin named make_the_candy. Pasted image 20220910184351

Tried running the binary, output indicated that a configuration file was missing. Pasted image 20220910184401

Executed the binary through strace, and saw that quite a few different files weren't able to be accessed, but they were stuff like /etc/ld.so.preload and everything. Pasted image 20220910184408

Ran the binary through ltrace, only output was a missing registration.json file. Pasted image 20220910184416

Touched registration.json then ran the file again. It worked, but this time was told that the program was unregistered so it was exiting. Pasted image 20220910184424

Using ltrace just showed the single line that was put out on the terminal. Pasted image 20220910184435

Ran through strace again. Pasted image 20220910184451

Still saying unregistered. I'll try making a json format entry in the file saying that I am registered. Pasted image 20220910184500

Same unregistered error. I ran the binary via strace again, this time with the -v flag.

Nothing new really. Running ltrace with the valid file here shows a bit more. There's some getline stuff that's repeated, maybe it's looking to compare my string to the getline string? Pasted image 20220910184509

Ah, wait, at the end of the string it read, it says "Registration" = nil, maybe it's looking for that line? Pasted image 20220910184515

I echoed Registration into registration.json and yeah, that worked. It matched, then searched for the next string, ':'. strace-1

I added ': ' to the first line in the file, then ran ltrace again. I can see now that it's looking for the word 'True'. Pasted image 20220910184548

That worked, and popped the achievement while running the program! Pasted image 20220910184557 strace-2


Next: term-11