======Project: THE PUZZLE BOX====== A project for CSCS1730 UNIX/Linux Fundamentals by Derek Girardi during the Fall 2011 semester. This project was begun on 10/25/11 and is anticipated to take 1 day. =====Objectives===== To demonstrate understanding of tools through application of skills, observation, and the ability to reference necessary documentation. =====Prerequisites===== In order to successfully accomplish/perform this project, the listed resources/experiences need to be consulted/achieved: * know how to use the command-line * familiarity with using command-line arguments to alter default behaviors of commands * know how to bring up and read a manual page * familiarity with other resources that provide documentation or usage information =====Background===== For this project i attempting to see if i know how to use the tools i learned in an effective to navigate through files to find a hidden message. This is a puzzle box because hidden in files there is a secret message and i need to know how to archive, decompress files and text manipulate files to see what is inside. You must know how to use the command file, sed, cp, mv and many others. File allows you to see what kind of file it is, sed allows you to manipulate text through expressions and commands, cp and mv are simple copy and move commands. There is also a rev command that is implmented that is used far into the future box that will come handy. If you can master going through files, manipulateing them and using commands to push your way through, the puzzle box will be no problem to you. =====Scope===== To apply skills learned in unraveling the puzzle that isn't as it may seem. Located in **/var/public/unix/puzzlebox/** is a filed called **courses.html** ... have at it. =====Attributes===== State and justify the attributes you'd like to receive upon successful approval and completion of this project. * commands: utilization of commands to accomplish the task * files & directories: recognize what is being dealt with and act appropriately * text processing: retrieve/manipulate text * the UNIX shell: perform necessary command-line manipulations to accomplish the task at hand =====Procedure===== lab46:~$ cd /var/public/unix/puzzlebox lab46:/var/public/unix/puzzlebox$ ls courses.html lab46:/var/public/unix/puzzlebox$ cat courses.html Y[Àâ ¶©)¡¡¹©©PÈ16gP0` (-.I,RP`(OMIOÅ£.'1³aøof.0+lV°=² ? CIFªBb^qyj^IE~'óå¨ù~aóýJ+¸Yþ030°¼`$ÔÆÁà4Èmñ¼>F´(¦A9ùéù¥%`ãÛaÜÞ o¿ÃmPúå¥-pzÆãD ²ûù?¶S¤ R"þÐáZüNè©­pÀH>òÝÔ ÷hPË~ÆZ¶wçÌsèmÚ=TlQlºûfíNH ÷Éirñ@«ë3\èUÎbÏô;PºålI¯äÃß`"¼tÁW}^`øFã -OíKu~A¯tâÚã1$Ç[h W[AMg > ^C lab46:~/the answer.txt$ sed '^' logout^C lab46:~/the answer.txt$ sed ^' logout ^C lab46:~/the answer.txt$ sed "^" logout sed: -e expression #1, char 1: unknown command: `^' lab46:~/the answer.txt$ cat logout | sed ^ sed: -e expression #1, char 1: unknown command: `^' lab46:~/the answer.txt$ cd lab46:~$ ls Harchives.tar.bz2 archivees cmdcprog.c exper irc program soaringeagle.sh tmp Maildir archives contact.info.save hey killerwasp.sh program.c soaringeagle1.sh wildcards a.out bin courses hi lab1a.text pss src addscr.sh botopen data hi.c lyrics.mp3 public_html temp archive1.tar.gz candy destructo.sh hi.s motd regularexpressions temp.c archive2.zip closet dl in newdirectory scriptrgex.sh the answer.txt lab46:~/the answer.txt$ cat logout | sed 's/\^//g' ******************************************************* *,!xobelzzup,eht,tuo,derugif,ev'uoY,!snoitalutargnoC,* ******************************************************* ruoy,ot,elif,siht,liam-e,si,won,od,ot,evah,uoy,llA,, hsinif,esruoc,fo,dna(,tnuocca,64bal,s'rotcurtsni,, .)oiloftrop,ruoy,no,tcejorp,ruoy,pu,gnitirw,, ot,desu,uoy,snoitatnacni,dna,sdnammoc,cificeps,eht,no,tropeR,:oslA,, .mrof,elbadaer,ylluf,ni,egassem,siht,niatbo,, ******************************************************* rev(1)%is%a%nifty%command. lab46:~/the answer.txt$ man rev lab46:~/the answer.txt$ cat logout | sed 's/\^//g' | rev logout ^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^* ^*^,^C^o^n^g^r^a^t^u^l^a^t^i^o^n^s^!^,^Y^o^u^'^v^e^,^f^i^g^u^r^e^d^,^o^u^t^,^t^h^e^,^p^u^z^z^l^e^b^o^x^!^,^* ^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^* ^,^,^A^l^l^,^y^o^u^,^h^a^v^e^,^t^o^,^d^o^,^n^o^w^,^i^s^,^e^-^m^a^i^l^,^t^h^i^s^,^f^i^l^e^,^t^o^,^y^o^u^r ^,^,^i^n^s^t^r^u^c^t^o^r^'^s^,^l^a^b^4^6^,^a^c^c^o^u^n^t^,^(^a^n^d^,^o^f^,^c^o^u^r^s^e^,^f^i^n^i^s^h ^,^,^w^r^i^t^i^n^g^,^u^p^,^y^o^u^r^,^p^r^o^j^e^c^t^,^o^n^,^y^o^u^r^,^p^o^r^t^f^o^l^i^o^)^. ^,^,^A^l^s^o^:^,^R^e^p^o^r^t^,^o^n^,^t^h^e^,^s^p^e^c^i^f^i^c^,^c^o^m^m^a^n^d^s^,^a^n^d^,^i^n^c^a^n^t^a^t^i^o^n^s^,^y^o^u^,^u^s^e^d^,^t^o ^,^,^o^b^t^a^i^n^,^t^h^i^s^,^m^e^s^s^a^g^e^,^i^n^,^f^u^l^l^y^,^r^e^a^d^a^b^l^e^,^f^o^r^m^. ^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^* ^.^d^n^a^m^m^o^c^%^y^t^f^i^n^%^a^%^s^i^%^)^1^(^v^e^r lab46:~/the answer.txt$ cat logout | rev | sed 's/\^//g' | sed 's/,/ /g' ******************************************************* * Congratulations! You've figured out the puzzlebox! * ******************************************************* All you have to do now is e-mail this file to your instructor's lab46 account (and of course finish writing up your project on your portfolio). Also: Report on the specific commands and incantations you used to obtain this message in fully readable form. ******************************************************* .dnammoc%ytfin%a%si%)1(ver lab46:~/the answer.txt$ cat logout | rev | sed 's/\^//g' | sed 's/,/ /g' > ~/Puzzlewin lab46:~/the answer.txt$ cd lab46:~$ ls Harchives.tar.bz2 archive2.zip closet dl in newdirectory scriptrgex.sh the answer.txt Maildir archivees cmdcprog.c exper irc program soaringeagle.sh tmp Puzzlewin archives contact.info.save hey killerwasp.sh program.c soaringeagle1.sh wildcards a.out bin courses hi lab1a.text pss src addscr.sh botopen data hi.c lyrics.mp3 public_html temp archive1.tar.gz candy destructo.sh hi.s motd regularexpressions temp.c First step i went to the directory to where the file "courses.html was located". Second i used the file command to see what kind of file it was, it happened to be a gzip file. Then in orderto change it ( i had to change the extension to gz to decompress it or extract the contents in anyway) i moved it into my home directory so i had permissions to mess with it. then when i decompressed it it turned into "courses". I used the file command and it was a tar archive. so i used the tar command to recieve the contents lyrics.mp3. I used file again to see it was a zip file and i unzipped it to get an directory named "the answers.txt" so i go into that directory (surrounded by single qoutes because of the space) and i get the executable file "logout". I open it up and get a mess of kind of visible message. So iused the sed command to replace the carrot's (^) and the comma's and i used the rev command to flip the words around. Then wallah i get the message! I then save it into a new file into my home directory so i can email it. =====Reflection===== It helped me reinforce that i knew how to use certain commands and decompress files files. Some of it confused for a little bit like when a gzip file had a different exetension but that wasnt hard to get around. All in all, it was a fairly easy project, as long as you know what you are doing. =====References===== In performing this project, the following resources were referenced: * http://linuxquestions.org/questions/linux-hardware-18/file-=-posix-tar-archive-522904 * http://google.com (for help with general commands, could have used man pages but didnt lol)