Description Category: reversing In order to get access to another server room we need to gain access to a secure room. Unfortunately, this door has been locked with a custom high security lock produced at Amalgamated Electro Dynamics. Luckily, we've recovered both a copy of the circuit diagram for the lock, as well as the original source code from the microcontroller (an arduino, those damn n00bs). Your job is to select the proper input for the lock in order to open the door. The good news is that there are only 10 bits of inputs. The bad news is it takes a few seconds to try each possible combination. Also, because of low battery power, we need to boost the signals for the door lock before the input to the arduino. That means you need to specify the input to the original circuit and the output from the circuit (which is the same as the input to the arduino). When you get the right password, the door should unlock and reveal the key for the challenge. Good luck! http://a4.amalgamated.biz/cgi-bin/hardware0x.cgi (if there is trouble understanding this problem, ask in IRC or email) *** Contents of http://a4.amalgamated.biz/cgi-bin/hardware0x.cgi *** This circuit is attached to this arduino sketch **Notice:** the original sketch does not compile with the most recent Arduino software. A verson that should be equivalent and compilable can be found here The original sketch functions correctly when emulated in "Virtual BreadBoard". Your task is to select the input for the circuit diagram (the 10 pins) which will lead to the correct 8 pins (whose output you must also specify) of the arduino (pin1-pin8 on J2 on the left corresponds to digital input 0-7 on the arduino) output high to digital pin 8 on the Arduino, unlocking the secret door in the amalgamated control room. Use the checkboxes to select the proper input bits. *** /END *** The circuit diagram is in http://www.limited-entropy.com/docs/pctf/writeup/rev350/circuit.png, the Arduino sketch in http://www.limited-entropy.com/docs/pctf/writeup/rev350/lock.pde . I wrote a C program that mimics the Arduino sketch and tries all possible inputs (256) to find the one we look for. This is http://www.limited-entropy.com/docs/pctf/writeup/rev350/arduino.c , after running it you get: $ ./arduu 237 : clamber $ I also represented the logic circuit in a python script ( http://www.limited-entropy.com/docs/pctf/writeup/rev350/arduino_circuit.py.txt ) and ran through all possible inputs to see which ones generate 237. This is the result: Z:\devel>python arduino_circuit.py YEAH: 0b1100100111 YEAH: 0b1100101111 Z:\devel> The first one, together with 237 (MSB first) are the solution to be entered in the web site using the checkboxes.