How to execute CMU binary bomb on Ubuntu Linux?

I am trying to make the CMU binary bomb as an independent project in order to learn some x86 builds and reverse engineering. (This is not an automatic version bound to a class.)

I downloaded bomb.tar from http://csapp.cs.cmu.edu/public/labs.html .

From the CMU lab description:

A "binary bomb" is a program provided to students as an object code file. At startup, it prompts the user to enter 6 different lines. If either of them is incorrect, the bomb explodes, printing an error message and logging events on the classification server. Students must β€œdefuse” their own unique bomb by disassembling and reversing the development of a program to determine what should be 6 lines. The lab teaches students to understand assembly language, as well as the power to learn how to use the debugger. It is also fun. The legendary laboratory among KMU subcontractors.

Here is the Linux / IA32 binary bomb , which you can try yourself. the function that notifies the classification server has been disabled, so feel free to detonate this bomb with impunity.

After saving to the appropriate folder, I ran this command in the terminal:

tar xvf bomb.tar 
  • He extracted a file called bomb (without the file extension), but I thought that he would also give me bomb.c , which would also be useful for reference.

  • I can't fire a bomb. Here is what I tried:

     bomb bomb: command not found ./bomb bash: ./bomb: No such file or directory 
  • While I understand that this solution requires going through gdb through it, I can't even run it in BASH and blow myself up with incorrect answers yet! A little help would be fantastic.

+6
source share
3 answers

Since Fabio A. Correa launched the file on a bomb and found out that it is a 32-bit LSB executable, it looks like this is caused by some missing LSB scripts that need to be loaded at startup.

Just doing sudo apt-get install lsb-core fix this. After that, ldd bomb will also work.

Update:

Further, ldd (after receiving the finished LSB file) shows that it is actually called by some inexist libc.so.6 => /lib32/libc.so.6 , which is the i386 libc architecture. You can try installing the libc6-i386 package directly.

After that, you can run disassemble func_name directly into your gdb. When saving all characters, you can directly see function names. strings can help you.

Btw, this question should be placed on Unix & Linux, I think.

+1
source

As other answers showed, this is due to a processor architecture compatibility issue. I was able to resolve this on the 64-bit version of Ubuntu 15.04 by installing packages located on AskUbuntu.com How to run 32-bit programs on a 64-bit system [duplicate]

In particular, the following team helped.

 sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 
+1
source

file bomb reports:

 ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.0.0, not stripped 

You can run it on bash by typing:

 tar xvf bomb.tar chmod +x bomb ./bomb 

It worked on my 64-bit Kubuntu 14.04.

0
source

Source: https://habr.com/ru/post/976901/


All Articles