Skip to content
Margarete Mueller edited this page Oct 1, 2026 · 1 revision

Intro

Linux Tools

Several standard Linux binary analysis tools are used throughout this exercise.
This chapter provides a brief explanation of each tool and the flags used during the analysis process.


readelf

Purpose

The readelf utility is used to display information about ELF (Executable and Linkable Format) binaries. It is commonly used for inspecting sections, headers, symbols, and raw binary data.


Command Used

readelf -x .rodata level0

Flag Explanation

Flag Description
-x Displays the hexadecimal dump of a specified section.
.rodata Refers to the read-only data section, which typically contains static strings and constants.

Why It Is Used

The .rodata section frequently stores output strings such as:

No !
Access granted
Password:

Locating these strings helps identify important execution paths within the binary.


grep

Purpose

The grep utility is used to search for matching text patterns within command output or files.


Commands Used

readelf -x .rodata level0 | grep "No !"
objdump -d level0 | grep 080484a4

Common Flags

Flag Description
-A<number> Displays lines after the match.
-B<number> Displays lines before the match.
-i Performs case-insensitive matching.
-n Displays line numbers.

Example

objdump -d level0 | grep 080484a4 -A20 -B20

This command displays 20 lines before and after the matching address in order to provide assembly context.


objdump

Purpose

The objdump utility is used to display information about object files and executables. It is especially useful for disassembling binaries into assembly instructions.


Command Used

objdump -d level0

Flag Explanation

Flag Description
-d Disassembles executable sections into assembly code.

Why It Is Used

Disassembly allows the program logic to be inspected directly.
Conditional jumps, comparisons, function calls, and hardcoded values can all be identified through assembly analysis.

Typical instructions encountered include:

cmp eax, 0x1a7
je  0x080484f0

In this example:

  • cmp performs a comparison
  • je performs a jump if the comparison succeeds

The compared value may represent the expected password or key.


scp

Purpose

scp copies files between hosts on a network. It uses ssh for data transfer, and uses the same authentication and provides the same security as a login session.


Command Used

scp -P 4242 level00@10.245.254.235:/home/users/level00/level00 .

Flag Explanation

Flag Description
-P Define the port to be used for ssh transfer.

Why It Is Used

To dissassemble the file with third party software it needs to be transfered to the host system.

Ghidra

Purpose

Ghidra is a software reverse engineering (SRE) framework created and maintained by the National Security Agency Research Directorate. In this project it is mainly used to decompile the explotation binary and quickly find vulnerabilities due to unrpotected function usage or logical flaws.

Installation

https://github.com/nationalsecurityagency/ghidra https://snapcraft.io/install/ghidra/debian

Usage

On opening create a project and then chose the Code Browser (first icon in tool chest)
image
Afterwards the file to exploit needs to be imported and decompiled. We get the assembly code and and an example c code for the imported binary.
image