Question

In: Computer Science

I am exploiting a buffer overflow attack and need to find three pieces of information in...

I am exploiting a buffer overflow attack and need to find three pieces of information in Linux using gdb.

  • 1) The address of the function system
  • 2) The address of the function parameter for system() which is /bin/sh. /bin/ parameter is what will spawn a shell
  • 3) The address of a function that can exit the shell.

I was able to use gbd commands to find the first two but what command would I use to find the address of a function that can exit the shell?

Solutions

Expert Solution

GDB is basically stands for GNU Debugger, it is software tool to debug the C/C++ code. You can get the information of compiled code by running it using GDB.

Before using GDB, the code should be compiled with the option -g.

for ex: gcc -g buffer_demo.c -o buffer_demo

There are number of commands available in GDB, using GDB commands, one can use the capabilities of GDB.

Some examples of commands are:

  1. Run
  2. Help
  3. break or b
  4. enable
  5. delete
  6. info
  7. print and so on

Here, with respect to your query, "info" command shall be used to find out the address information you are targeting for. Info command gives you the address of symbol (function) present in the source file. You can get the address of symbol by making it as a break point.

Exit command is used to terminate the shell script. So all scripts contain exit statement at the end of script file. Last command executed in function or scripts gives information about exit status.Successful termination throws zero value while unsuccessful throws non-zero with error reporting message.

One trick could be use to find out your exit statement address. Just set the exit () or return or last statement of script/function as a break-point and then execute the command "info <break-point no>. It should display the address of function/symbol which is exiting the shell.


Related Solutions

Discuss how a stack buffer overflow attack is implemented.
Discuss how a stack buffer overflow attack is implemented.
For lab, I need to prepare 25 mL of complete lysis buffer. I am provided with...
For lab, I need to prepare 25 mL of complete lysis buffer. I am provided with 1 M Tris, 5 M NaCl, 1 M MgCl2, lysozyme, and DNase. Our complete lysis buffer contains all of the following components: 50 mM Tris, 150 mM NaCl, 2 mM MgCl2, 0.5 mg/mL lysozyme, and 0.04 uL/mL DNase. Plan and calculate exactly how to make the complete lysis buffer. *My instructor recommended getting the amount of lysozyme needed into a solution to make it...
1.write three methods to exploit buffer overflow and to archive the goal. If local variables are...
1.write three methods to exploit buffer overflow and to archive the goal. If local variables are exploited present all possible approaches. Goal: The goal is to exploit the program to let it print out “CORRECT SERIAL”. Note: A “Segmentation fault” is fine if the program prints out the desired message. C programming
I am currently doing research and I need to find the correlation between "HOURS OF SLEEP"...
I am currently doing research and I need to find the correlation between "HOURS OF SLEEP" and "LPI SCORES" I want a table to look as below how would I achieve this on Excel. In short I want to find out what the average score someone gets when they get a certain amount of sleep. I have all the data in a spreadsheet but cannot get the table right. SLEEP HOURS                               LPI SCORES 4                                                      ?? 5 6 7 8 9...
I'm working in Java and am working on a project where I need to find an...
I'm working in Java and am working on a project where I need to find an average. The catch is that for some of the values there is no data because they will be entered at a later date. I have variables assigned so that for each entry if there is an input I'll have it say _____available = 1, otherwise the variable will equal 0. I'll use an example to make this more clear. Let's say I am trying...
I am writing a marketing plan on SUNPOWER. I need information on 1. Competition 2. Product...
I am writing a marketing plan on SUNPOWER. I need information on 1. Competition 2. Product offering 3. Keys to success 4. Critical issues 5. Historical results Hand write please
I am in need of a great elevator pitch for a nursing portfolio. I am presenting...
I am in need of a great elevator pitch for a nursing portfolio. I am presenting this via video and I am at a loss on where to even begin for an elevator pitch while introducing myself.
I just need 3 and 5. I am not sure what I am doing wrong. I...
I just need 3 and 5. I am not sure what I am doing wrong. I get different numbers every time. Superior Markets, Inc., operates three stores in a large metropolitan area. A segmented absorption costing income statement for the company for the last quarter is given below: Superior Markets, Inc. Income Statement For the Quarter Ended September 30 Total North Store South Store East Store Sales $ 4,800,000 $ 960,000 $ 1,920,000 $ 1,920,000 Cost of goods sold 2,640,000...
If I am given E=z 3 cos(3*10^3t + betax) I need to find H. I do...
If I am given E=z 3 cos(3*10^3t + betax) I need to find H. I do not have a specific number for betax right now. Could you please give me a layout of how to work this problem?
I am working on an accounting assignment and am having problems. Firstly, 1.I need to journalize...
I am working on an accounting assignment and am having problems. Firstly, 1.I need to journalize these entries and post the closing entries 2. i need to prepare Dalhanis multi-step income statement and statement of owners equity for August 2010 3. i need to prepare the blance sheet at august 31,2010 4. i need to prepare a post-closing trial balance at august 31,2010 DALHANI makes all credit sales on terms 2/10 n/30 and uses the Perpetual Inventory System Aug 1...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT