/
CS   Defusing a Binary Bomb  Introduction The nefariou CS   Defusing a Binary Bomb  Introduction The nefariou

CS Defusing a Binary Bomb Introduction The nefariou - PDF document

yoshiko-marsland
yoshiko-marsland . @yoshiko-marsland
Follow
438 views
Uploaded On 2015-05-26

CS Defusing a Binary Bomb Introduction The nefariou - PPT Presentation

Evil has planted a slew of binary bombs on our machines A binary bomb is a program that consists of a sequence of phases Each phase expects you to type a particular string on the standard input stdin If you type the correct string then the phase i ID: 74901

Evil has planted

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "CS Defusing a Binary Bomb Introductio..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Step2:DefuseYourBombYourjobistodefusethebomb.Youcanusemanytoolstohelpyouwiththis;pleaselookatthehintssectionforsometipsandideas.Thebestwayistousethegdbdebuggertostepthroughthedisassembledbinary.Eachtimeyourbombexplodesitnotiesthestaff,andyoulose1/4point(uptoamaxof10points)inthenalscoreforthelab.Sothereareconsequencestoexplodingthebomb.Youmustbecareful!Inamomentofweaknesshowever,Dr.Evildecidedthattherst10bombexplosionswillbefreeofcharge.Eachphaseisworth10points,foratotalof60points.Thephasesgetprogressivelyhardertodefuse,buttheexpertiseyougainasyoumovefromphasetophaseshouldoffsetthisdifculty.Thebombignoresblankinputlines.Ifyourunyourbombwithacommandlineargument,forexample,bash$./bombbsol.txtthenitwillreadtheinputlinesfrombsol.txtuntilitreachesEOF(endofle),andthenswitchovertothestandardinput(stdin).Thisway,youdon'thavetokeepretypingthesolutionstophasesyouhavealreadydefused.Toavoidaccidentlydetonatingthebomb,youwillneedtolearnhowtosingle-stepthroughtheassemblycodeandhowtosetbreakpoints.Youwillalsoneedtolearnhowtoinspectboththeregistersandthememorystates.Oneoftheniceside-effectsofdoingthelabisthatyouwillgetverygoodatusingadebugger.Thisisacrucialskillthatwillpaybigdividendstherestofyourcareer.LogisticsYoumayworkinagroupofupto2people.Youshoulddotheassignmentonfelix.csc.villanova.edu.Infact,thereisarumorthatDr.Evilreallyisevil,andthebombwillalwaysblowupifrunelsewhere.Thereareseveralothertamper-proongdevicesbuiltintothebombaswell,orsotheysay.Hand-InThereisnoexplicithand-in.Thebombwillnotifyyourinstructorautomaticallyafteryouhavesuccessfullydefusedit.Youcankeeptrackofhowyou(andtheothergroups)aredoingbylookingathttp://www.csc.villanova.edu/˜mdamian/csc2400/bomblab.htmlThiswebpageisupdatedcontinuouslytoshowtheprogressofeachgroup.2 gdb./bombkDisassembletherstphaseusingdisasphase_1Youwillseethatthisphasecallsafunctioncalledstrings not equal.2.Setabreakpointtocallstrings not equalbreak*(phase_1+???)Displaythenextmachineinstructiontobeexecutedeachtimethedebuggersuspendsexecution,soyouknowwhereyouareatalltimes:display/i$eipThenruntheprogramuptotherstbreakpoint–youwillneedtotypeinyourownstring(typeinanarbitrarystring,suchas123456)togetpastthepointwheretheprogramiswaitingforuserinput.Weallknowthat,priortothecall not �equalmachineinstruction,theargumentsforstrings not equalarepushedintothestack(inparticular,theaddressesofthetwostringsthataretobecompared).Inspectthetwowordsatthetopofthestacktolearntheseaddresses:x/2xw$espNextinspectthememorycontentsattheaddressesyou'velearned.x/saddresswhereaddressiswhatgetspushedontothestackbeforethecalltostrings not equal.Thisshouldrevealthesecretstringforyou.3.Supposethatyouarenishedwithphase 1,andarereadytostartphase 2.Afterdefusingphase 1,theprogramwillwaitforinputfromyoutobeusedinphase 2.Inthiscase,itwillwaitforsixnumbersseparatedbyspaces.Asbefore,disassemblethecodeforphase 2usingdisasphase_2Youwillseethatphase 2seeks6integersthatsatisfycertainconditions.Focusonthecmpinstruc-tionsandinspecttheargumentsbeingcompared.4