Hello)

Maybe some people know such, for example compileonline.com

In general, one question remains, the security of these services.

However, everything in the district and around.

There is this exploit:

#include <stdio.h> extern "C" asm( ".global _data\n" ".data\n" "_data:\n" ".incbin \"/etc/passwd\"\n" ".byte 0" ); extern const char _data; const char* data = &_data; int main() { printf("%s", data); } 

Here, during the compilation, the incbin assembler function is called, which in turn, at the time of compilation, starts or reads a third-party file, in this exploit, the etc / passwd file is read.

In order to exploit the vulnerability, it is necessary in any online compiler to compile the above code shown under the C ++ language

And now the question is: I would like to know if there is an equivalent of this assembly function, just not reading, but creating certain files?

  • Oh, and really works. - dzhioev
  • 2
    - The thing is cool, but there is little practical use. “With the help of such a thing, it is possible to use the service unless it compiles the code as root' , while not reading /etc/passwd, but /etc/shadow. It is clear that in normal systems compilation and launch of binaries will be carried out in a special sandbox'е or at least under dedicated restricted user. - Costantino Rupert
  • four
    @ Nu11ers3t - I sincerely hope that you are still trolling. If not, I recommend you start reading Hacker magazines of 2000 year :) - Costantino Rupert
  • one
    @ Nu11ers3t, and you, in fact, fear that some kind of "prankster" will fill up such a service? And where did you find the root? I tried using your link, sketched a couple of programs Compiling the source code .... $ gcc main.c -o demo -lm -pthread -lgmp -lreadline 2> & 1 Executing the program .... $ demo uid: 48 euid: 48 End Reading / etc / passwd showed apache: x: 48: 48: Apache: / var / www: / sbin / nologin By the way, the output is limited (du / did not reach the end). - Somewhere on this topic I read that one of the organizers of such a server promised a reward to anyone who breaks it. - avp 5:44 pm
  • 2
    @avp: this is from Habra . Sandbox, no problem. Hang up air raid. - VladD

0