If your Linux is 64-bit and you wanna compile a .c file into a 32-bit .o file by gcc compiler, but get an error as the following while compiling, means that the compiler cannot find the libc-header-start.h file/library.

“fatal error: bits/libc-header-start.h: No such file or directory”
Now you try checking whether any file named libc-header-start.h exists in your OS.
On my machine, the result as below, the file was in x86_64-linux-gnu folder but still get the error:

In the picture 1, the -m32 tells gcc to compile for a 32-bit platform. On a 64-bit machine, gcc normally runs with 64-bit libraries. To solve, you need to install 32-bit headers and libraries.
Run below command to install libraries which pulled in the libc6-dev-i386 package:
sudo apt-get install gcc-multilib
If your OS can find the repositories/packages of gcc-multilib, it will download without any error:

After downloading, the packages will be unpacked and set up, means the installation is successful.

Now, run the command on picture 1 again to check if gcc compiler can successfully run .c shellcode:

It’s okay, a new file named getshell was created on the desktop.
Thanks for visiting my blog! Hope you will return next time…