Skip to content

Instantly share code, notes, and snippets.

@tanaka-geek
Last active August 2, 2021 11:58
Show Gist options
  • Save tanaka-geek/2787d3aefbd41e090ffd22b905da98fd to your computer and use it in GitHub Desktop.
Save tanaka-geek/2787d3aefbd41e090ffd22b905da98fd to your computer and use it in GitHub Desktop.
Different Compilers

Type of compiler

In Kernel Exploitation Stage, Compiler do matter in fact.

They compile exploit to execute, and the system can excute it with specific compiler.

Changing some line in kernel exploit code in 37292.c for clang compiler, not gcc.

    # lib = system("gcc -fPIC -shared -o /tmp/ofs-lib.so /tmp/ofs-lib.c -ldl -w");
    lib = system("cc -fPIC -shared -o /tmp/ofs-lib.so /tmp/ofs-lib.c -ldl -w");

If not compiled by the compiler that the system has, the exploit will not work!!!

compilers

GCC gcc

GNU Compiler Collection is the compiler produced by the GNU Project.

Clang cc

Clang; including C, is also a compiler for C++, Objective-C, and objective-C++ programming languages.

Borland Turbo C

Turbo C is one of the basic and popular compilers for the C programming language. This was first introduced in 1987

Tiny C Compiler

The Tiny C Compiler is designed to work on slow computers with little disk space. This is an ARM processor C compiler.

Portable C Compiler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment