I solved picoCTF's Nice netcat... practice challenge which involved converting port numbers into the characters of the picoCTF key.
I wrote two Python scripts which solve Nice netcat...:
- the first script uses the GNU netcat networking utility to get a list of port numbers, then redirects that stdout to a file named ports.txt.
- the second script opens ports.txt, iterates through its port numbers, and converts them to characters using the Python built-in function named chr(). Then it calls the join() string method to join the characters, and finally prints the picoCTF key to the terminal emulator.
The two Python scripts can be found at this gist.