Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I have read my SICP today

Name: Anonymous 2009-11-08 21:09

Name: Anonymous 2009-11-08 22:21

good.  I expect another program tomorrow too.

Name: Anonymous 2009-11-08 22:21

Condensed LISP code gives me headaches, add more blank lines and I'll read it.

Name: Anonymous 2009-11-08 22:49

Name: Anonymous 2009-11-09 4:20

codepad.org is an online compiler/interpreter, and a simple collaboration tool. Paste your code below, and codepad will run it
will run it
I'm surprised noone has forkbombed the server yet...

Name: Anonymous 2009-11-09 4:31

>>1
Hello, that guy who did anonchat

Name: Anonymous 2009-11-09 6:14

>>5
Obviously this thing is protected, dumbass

How it works
Code execution is handled by a supervisor based on geordi. The strategy is to run everything under ptrace, with many system calls disallowed or ignored. Compilers and final executables are both executed in a chroot jail, with strict resource limits.


Paranoia
When your app is remote code execution, you have to expect security problems. Rather than rely on just the chroot and ptrace supervisor, I've taken some additional precautions:
* The supervisor processes run on virtual machines, which are firewalled such that they are incapable of making outgoing connections.
* The machines that run the virtual machines are also heavily firewalled, and restored from their source images periodically.

Name: Anonymous 2009-11-09 7:15

Name: Anonymous 2009-11-09 9:02

>>8
I wonder how long it took to compute the output.

Name: Anonymous 2009-11-09 9:11

this website is awesome.
A++

Name: Anonymous 2009-11-09 10:25

>>7
http://codepad.org/9YEqz4Fl

Their server must have a ton of RAM for the execution time to expire before the stack did.

Name: Anonymous 2009-11-09 10:27

>>11
Maybe the compiler is smart enough to do tail-call optimization.

Name: Anonymous 2009-11-09 10:39

Name: Anonymous 2009-11-09 14:04

Let's figure out how to pwn this thing somehow.  I haven't succeeded in getting the C compiler to accept inline assembly yet.

Name: Anonymous 2009-11-09 14:16

>>14
And what would you do if it did?  C can do anything assembry can anyway.

Name: Anonymous 2009-11-09 14:18

>>14

Let's not!

Name: Anonymous 2009-11-09 14:18

>>14
You don't need to. Just put some code in a buffer and execute the buffer. You may want to run various tests to determine what platform it is before actually being able to run more useful code, but if >>7 is right, then this would be no better than owning a Honeypot, which is totally useless.

Name: Anonymous 2009-11-09 14:24

>>15
C can do anything assembry can anyway.
Now write a line of C code that will compile to a privileged instruction or invalid opcode. Without asm().

Name: Anonymous 2009-11-09 14:39

>>18
privileged instruction
Popular compilers have builtin support for most of these, even though 99.999% of developers don't need them. Here are some examples:

http://gcc.gnu.org/onlinedocs/gcc/X86-Built_002din-Functions.html#X86-Built_002din-Functions
http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html

invalid opcode
Why the fuck would you want to do this?

Name: Anonymous 2009-11-09 15:00

>>18
That's very simple actually, just assemble the instructions in a buffer, possibly writing the code so it would run from any base(call $/pop reg , and then use [reg+..] to offset all code from that), then just cast the buffer to a function pointer, and just call it.

There you go.

Name: >>20 2009-11-09 15:04

The only difference here is that the code would run from the heap or stack, and there's some minor differences between normal code sections and that (such as protection modes and maybe on some platform, they could be marked with the NX flag). In which case, you might want to call the appropriate APIs for setting protection flags on that buffer's pages, or just alloc a new buffer for the code, or in a weird case, you could copy the code to the CODE/.text section where the C code is compiled to and running it. Technically, you can run anything from C (or other high/mid level languages with a FFI or similar), that you could run from asm.

Name: Anonymous 2009-11-09 15:05

Holy shit, the code it generates for

uint32_t cObject(void)
{
    return 0x7A69;
}


is this:

push ebp
mov ebp, esp
sub esp, 00000018
mov eax, dword ptr [0804971C]
mov dword ptr [ebp-04], eax
xor eax, eax
mov eax, 0007A69
mov edx, dword ptr [ebp-04]
xor edx, dword ptr [0804971C]
je 00000025
call FFFFFF48
leave
ret


Anyone know what the extra bullshit is?  Any line that has anything to do with EDX or 0804971C is unnecessary to the function, and so it the jump-if-equal and that call...  I'm guessing this is some kind of protection but I don't know what it would protect against.

Name: Anonymous 2009-11-09 15:22

>>22
Looks like it's unoptimized, how terrible[i]![/b] GCC?
It may be a "security cookie" protection against buffer overflows. MSVC does it all the time, it's fairly simple, it places a special dummy value as the first variable on the stack, and then checks if it remains unchanged at the end, if it has been changed, it will safely generate an error to avoid exploitation. Smart compilers like MSVC don't generate code like this in functions as simple as that, they only generate it in functions where buffers are used/stack allocated and there's a potential for a stack overflow.

The code I would use for your function is

mov eax, 7A69h
ret

Name: Anonymous 2009-11-09 15:39

>>22
Also, are you compiling for C or sepples? Did you turn on optimization?

Name: Anonymous 2009-11-09 15:54

>>22
Also, did you -fomit-frame-pointer?

Name: Anonymous 2009-11-09 16:04

>>24
Compiling for C.  Didn't see any optimization options.

Name: Anonymous 2009-11-09 16:13

>>26
Then your and idiot.

Name: Anonymous 2009-11-09 18:02

>>26
Try again with -Os. It does -fomit-frame-pointer automatically.

Name: Anonymous 2009-11-09 18:30

>>28
Guess what? Read the fucking thread.  We are talking about www.codepad.org , not something on my machine

a-durrr to >>24-25,27-28

Name: Anonymous 2009-11-09 18:40

>>14
pwn
fuck you.
get out you pathetic worthless piece of shit, and never come back

Name: Anonymous 2009-11-09 19:10

>>30
Sounds like you have been pwned

Name: Anonymous 2009-11-09 19:24

>>31
back to 1337 pwing n00bz atzorz /counters strikezors/ ploxorz

Name: Anonymous 2009-11-09 20:01

>>32
why would I want to play some shitty cookie-cutter FPS game when I could pwn you some more on /prog/ ?

Name: Anonymous 2009-11-09 20:52

>>29 HBT

Name: Anonymous 2009-11-09 23:36

>>34

[Intelligence] So you fight the good fight by trying too hard to troll people?

Name: Anonymous 2009-11-10 1:11

>>33
because the only people who say pwn are leet 13 yearold cs h4x0rz.

Name: Anonymous 2009-11-10 2:00

>>32
Casual. Real men play Quake.

Name: Anonymous 2009-11-10 2:26

>>37
Way too easy. Real men play Dorf Fortrees.

Name: Anonymous 2009-11-10 3:33

>>38
i don't think most fps gamers have enough discipline or attention span to play something that takes so much time

Name: Anonymous 2009-11-10 3:38

>>38,39
Say that to me on Quake Live and not online and see what happens, fucker.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List