







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








Group Number: _________ Member Names: ___________________ _______________________ Date Assigned: Date Due: Last Edited: Please read the entire lab and any extra materials carefully before starting. Be sure to start early enough so that you will have time to complete the lab. Answer ALL questions in the Answer Sheet and be sure you turn in ALL materials listed in the Turn-in Checklist on or before the Date Due.
some concepts of debugging when the source code is not available, and reverse engineering, and how to protect intellectual property against reverse engineering through executable encryption.
source code, encrypt and try to disassemble encrypted executable.
(http://en.wikipedia.org/wiki/Software_cracking). Take a look at OllyDbg tutorial before you start the lab (http://sos.x-mirror.com/files/Olly.htm).
XP virtual machine. To help with the transfer of files between Host and virtual machine, it may be helpful to set up Shared folders on the virtual machines. To do so, see previous labs.
Debugging, while not extremely liked by many programmers, is in fact one of the main concepts that allow computer programmers to review erroneous functionality of the underlying code that they have developed. There are many tools available over the Internet, both proprietary as well
as open-source to help programmers to pin point the exact source of the erroneous functionality. In this lab we will take a look at OllyDbg. OllyDbg is a tool that can be served both as debugging and disassembling tool in that we could debug existing application, and disassemble them into assembly language. At the assembly level we will be able to look at various routines that the application has. In this lab, we will take an approach of using those tools to patch an executable to ignore the built in registration process bypassing it completely. Installing OllyDbg Copy the odbg110.zip file from the NAS to your Windows XP machine (if the NAS is not available, download olbg110.zip from http://www.ollydbg.de/odbg110.zip) Create OllyDbg directory on your Desktop and unzip the file into that directory Copy Lab14.exe from the NAS. This file is the one we will disassemble and patch to override security portions of the application. Open OllyDbg by executing OllyDbg.exe file. If you are prompted with a dialog box similar to Figure 1, click NO to make sure that the debugger would continue to function as it suppose to. Figure 1: DLL replacement dialog In the main window, click on File->Open and select Lab14.exe, Click OK to disassemble the file. You should get a similar window to Figure 2. The top right window is the register window. It contains all the current register values for the program. The bottom left window is the HEX and ASCII dump of the executable. The top left window is your disassembled application represented in assembly code.
In this section we will go over how to disassemble a standard executable file. In the next section we will cover the encrypted executable file scenario. If you have not opened “Lab14.exe” file in OllyDbg yet, then you need to do so. Go to File->Open and find location where you have saved “Lab14.exe” and select it.
Now that you have set up OllyDbg and opened “Lab14.exe” file, review the assembly code on your top left hand side of the OllyDbg window. In there you will be able to look at a more detailed level of the disassembled code. . Q2.1. How many function calls exist in this file? Now that you found all the function calls, it’s time to look for any security related portions of the code. Since the execrable itself is a serial number verifier, you will need to look for anything that would give you an impression of checking the input against specific serial number stored in the binary or an algorithm that manipulates the input in any way to verify the inputted serial number. (Hint: the method should be similar to getc, in that it reads in a string, and then compares it through a BEQ kind of trap) Q2.2. What is the line number at which the comparison function starts? Take a screenshot of OllyDbg at that location (Screenshot 1) Q2.3. Write down a pseudo code of the algorithm that is used in this program to check the inputted string?
Open the AC-Protect short-cut located on your desktop. Now click on the browse icon next to the “Fire to Protect” input field. Name the output filename at the second field. Click on Protect tab, and click Protect. Take a screen shot showing successful protection of the executable file (Screenshot 2)
After that you have passed the executable through AC-Protect, open the executable in OllyDbg. Once OllyDbg is opened you should see a warning notifying you about the encrypted content. It should look similar to that in Figure 3.
Figure 3: Compressed executable warning After that OllyDbg opens the encrypted executable, your screen should look similar to Figure 4.
more than one copy of it showing. These are the different forms. Select the form that shows a timestamp as its title. Keeping in mind that to execute the application that has been protected, it must be decrypted, unpacked, and loaded into memory. Select view->memory. Q4.3. Which of the memory areas will hold the contents of the unencrypted executable? Take a screenshot showing the unencrypted executable residing in memory (Screenshot 4). Q4.4 What are the pros and cons of this protection scheme? Can you think of any additional security that could be used to protect the executable? Q4.5 Could someone produce a patch/crack file that will override the registration process by bypassing it? Q4.6 Is it possible to recover the executable from memory (and save it to the hard drive as a working application)? What tools/techniques might you use to accomplish this?
The following websites were used as a references for this lab: http://sos.x-mirror.com/files/Olly.htm //greate tutorial on OllyDbg http://en.wikipedia.org/wiki/Disassembler http://www.osix.net/modules/article/?id=
Group Number: _________ Member Names: ___________________ _______________________ Date Assigned: Date Due: Last Edited:
Q2.1. How many methods exist in this file? Q2.2. What is the line number at which the comparison function starts? Take a screenshot of OllyDbg at that location (Screenshot 1) Q2.3. Write down a pseudo code of the algorithm that is used in this program to check the inputted string?
Q4.1. What do you notice that is different between this executable and the unencrypted version? What code are you actually looking at with the debugger? Is it the previous application or not? Q4.2 What does OllyDbg find when it analyses section of the encrypted file? Take a screen shot of OllyDbg after the file was passed through AC-Protect. (Screenshot 3) Q4.3. Which of the memory areas will hold the contents of the unencrypted executable? Take a screenshot showing the unencrypted executable residing in memory (Screenshot 4)
How long did it take you to complete this lab? Was it an appropriate length lab? What corrections and/or improvements do you suggest for this lab? Please be very specific and if you add new material give the exact wording and instructions you would give to future students in the new lab handout. You may cross out and edit the text of the lab on previous pages to make minor corrections/suggestions. General suggestions like add tool xyz to do more capable scanning will not be awarded extras points even if the statement is totally true. Specific text that could be cut and pasted into this lab, completed exercises, and completed solutions may be awarded additional credit. Thus if tool xyz adds a capability or additional or better learning experience for future students here is what you need to do. You should add that tool to the lab by writing new detailed lab instructions on where to get the tool, how to install it, how to run it, what exactly to do with it in our lab, example outputs, etc. You must prove with what you turn in that you actually did the lab improvement yourself. Screen shots and output hardcopy are a good way to demonstrate that you actually completed your suggested enhancements. The lab addition section must start with the form “laboratory Additions Cover Sheet”.