"CTF" Reverse CSC2015 120

Source: Internet
Author: User

Source: Cyber Security Challenge

Title: Crackme

Type: Reverse

Score: 120

Difficulty: medium (difficult to easy three levels)

Description: we found this binary, but we lost the password. Retrieve it for us.

Topic Links: https://github.com/ctfs/write-ups-2015/tree/master/cyber-security-challenge-2015/reverse-engineering/ Reverse-that-binary

Answer: Tnvrzsb0agugv2hhbgvz

?

?

?

Problem Solving Ideas:

Take a look at the file format, Linux 64-bit program

Put it in Ida. Find the main function, can make the following analysis, 1. Need to run the program with parameters 2. Parameter length is 20

By analyzing the assembly code, you can see that the IDA Analysis Const_return function has one less parameter.

Next we can analyze the framework of the entire program:

Convert input string to bit

To be removed from the rear and converted to int according to the predetermined length

Call Const_return to verify

Flag is output by calibration

?

Because there are many functions called in the Const_return, one-by-one analysis is too cumbersome, here you can write the so library to call the Const_return function, so that the different inputs can get the corresponding return value

From here we can get the address of the called 12 function sequentially, so we can write the following inject.c file

Compile the inject.c into inject.so

Let Crackme load the inject.so library by setting Ld_preload

Crackme executes our init function and successfully outputs a value that satisfies the condition. Considering the number of 01 in the string, here we choose the maximum value to calculate the Flag,python script as follows

Run to get flag

?

?

@Reference Bluecake

@Reference https://github.com/ctfs/write-ups-2015/tree/master/cyber-security-challenge-2015/reverse-engineering /reverse-that-binary

?

"CTF" Reverse CSC2015 120

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.