Coder Social home page Coder Social logo

cda-elf-analysis-exercise's Introduction

CDA ELF Analysis Exercise

This repository contains the sources of three binaries, each of them reads a password from standard input, compares it with a fixed value, and prints whether the two match.

The task is to reconstruct the password from the program binaries using readelf, objdump, eventually also strings. Correct answers can be easily deduced from the source code of the exercises.

Exercise 1

The password is stored in the .data section at the end, clearly separated from the rest of the data, where it can be found by both readelf and strings.

Exercise 2

Hint: look at the sections header for clues

The password is stored in a custom section called .secretsection. On the top of that, it is stored in between two other strings without any separation.

Hence, objdump has to be used to deduce the exact arguments to strncmp to get the address, which can be then used together with the start address of the section to determine the offset inside the section.

(Alternatively, the address of the passwords symbol can be used.)

Exercise 3

The password is determined by a series of compare instructions cmp $0x--,%al. With some knowledge of x86 assembly, this should be easy to see; it is also possible to deduce without much understanding of assembly, since it is the only compare instruction operating on bytes in the code.

cda-elf-analysis-exercise's People

Contributors

lenticularis39 avatar

Watchers

 avatar Viktor Malík avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.