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

having fun executing shellcodes :)

Name: Anonymous 2012-03-21 11:43


#include <stdio.h>

unsigned char a[] = {
  0x7f, 0x45, 0x4c, 0x46, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00,
  0x30, 0x83, 0x04, 0x08, 0x34, 0x00, 0x00, 0x00, 0x28, 0x11, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x20, 0x00, 0x08, 0x00, 0x28, 0x00,
  0x1e, 0x00, 0x1b, 0x00, 0x06, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
  0x34, 0x80, 0x04, 0x08, 0x34, 0x80, 0x04, 0x08, 0x00, 0x01, 0x00, 0x00,
  0x00, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
  0x03, 0x00, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, 0x34, 0x81, 0x04, 0x08,
  0x34, 0x81, 0x04, 0x08, 0x13, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
  0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x00, 0x80, 0x04, 0x08,
  0xd4, 0x04, 0x00, 0x00, 0xd4, 0x04, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
  0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x0f, 0x00, 0x00,
  0x0c, 0x9f, 0x04, 0x08, 0x0c, 0x9f, 0x04, 0x08, 0x08, 0x01, 0x00, 0x00,
  0x10, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
  0x02, 0x00, 0x00, 0x00, 0x20, 0x0f, 0x00, 0x00, 0x20, 0x9f, 0x04, 0x08,
  0x20, 0x9f, 0x04, 0x08, 0xd0, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00,
  0x06, 0x00,
  0x83, 0xec, 0x04, 0xa1, 0x0c, 0x9f, 0x04, 0x08, 0x83, 0xf8, 0xff, 0x74,
  0x13, 0xbb, 0x0c, 0x9f, 0x04, 0x08, 0x66, 0x90, 0x83, 0xeb, 0x04, 0xff,
  0xd0, 0x8b, 0x03, 0x83, 0xf8, 0xff, 0x75, 0xf4, 0x83, 0xc4, 0x04, 0x5b,
  0x5d, 0xc3, 0x90, 0x90, 0x55, 0x89, 0xe5, 0x53, 0x83, 0xec, 0x04, 0xe8,
  0x00, 0x00, 0x00, 0x00, 0x5b, 0x81, 0xc3, 0x4c, 0x1b, 0x00, 0x00, 0xe8,
  0xac, 0xfe, 0xff, 0xff, 0x59, 0x5b, 0xc9, 0xc3, 0x03, 0x00, 0x00, 0x00,
  0x01, 0x00, 0x02, 0x00, 0x77, 0x61, 0x73, 0x6e, 0x74, 0x20, 0x74, 0x68,
  0x61, 0x74, 0x20, 0x66, 0x75, 0x6e, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00
};

void main(){
    int (*func)();
      func = (int (*)()) a;
      (int)(*func)();
}

Name: Optimized 2012-03-21 12:00

int main() {
    return ((int (*)(void))(unsigned char[]){
  0x7f, 0x45, 0x4c, 0x46, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00,
  0x30, 0x83, 0x04, 0x08, 0x34, 0x00, 0x00, 0x00, 0x28, 0x11, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x20, 0x00, 0x08, 0x00, 0x28, 0x00,
  0x1e, 0x00, 0x1b, 0x00, 0x06, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
  0x34, 0x80, 0x04, 0x08, 0x34, 0x80, 0x04, 0x08, 0x00, 0x01, 0x00, 0x00,
  0x00, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
  0x03, 0x00, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, 0x34, 0x81, 0x04, 0x08,
  0x34, 0x81, 0x04, 0x08, 0x13, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
  0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x00, 0x80, 0x04, 0x08,
  0xd4, 0x04, 0x00, 0x00, 0xd4, 0x04, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
  0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x0f, 0x00, 0x00,
  0x0c, 0x9f, 0x04, 0x08, 0x0c, 0x9f, 0x04, 0x08, 0x08, 0x01, 0x00, 0x00,
  0x10, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
  0x02, 0x00, 0x00, 0x00, 0x20, 0x0f, 0x00, 0x00, 0x20, 0x9f, 0x04, 0x08,
  0x20, 0x9f, 0x04, 0x08, 0xd0, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00,
  0x06, 0x00,
  0x83, 0xec, 0x04, 0xa1, 0x0c, 0x9f, 0x04, 0x08, 0x83, 0xf8, 0xff, 0x74,
  0x13, 0xbb, 0x0c, 0x9f, 0x04, 0x08, 0x66, 0x90, 0x83, 0xeb, 0x04, 0xff,
  0xd0, 0x8b, 0x03, 0x83, 0xf8, 0xff, 0x75, 0xf4, 0x83, 0xc4, 0x04, 0x5b,
  0x5d, 0xc3, 0x90, 0x90, 0x55, 0x89, 0xe5, 0x53, 0x83, 0xec, 0x04, 0xe8,
  0x00, 0x00, 0x00, 0x00, 0x5b, 0x81, 0xc3, 0x4c, 0x1b, 0x00, 0x00, 0xe8,
  0xac, 0xfe, 0xff, 0xff, 0x59, 0x5b, 0xc9, 0xc3, 0x03, 0x00, 0x00, 0x00,
  0x01, 0x00, 0x02, 0x00, 0x77, 0x61, 0x73, 0x6e, 0x74, 0x20, 0x74, 0x68,
  0x61, 0x74, 0x20, 0x66, 0x75, 0x6e, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00 })();
}

Name: id 2012-03-21 12:08

>>2
you're supposed to post your shellcode
and let others find what is happening

Name: Anonymous 2012-03-21 13:14

How is this shell code? I can tell it's an ELF executable because it starts with "\x7fELF".

Name: Anonymous 2012-03-21 13:15

>>3
implying I would be stupid enough to actually run these

Name: Anonymous 2012-03-21 13:19

The first one installed Gentoo on my machine and the second one blew my computer and half my dick vaporized.

Worst day ever.

Name: Anonymous 2012-03-21 13:58

Fuck off back to /g/ with your retarded shit.

Name: Anonymous 2012-03-21 14:41

>>5
well dont if you dont know how to run it safely
stupidity has nothing to do with it

>>4 well it aint elfcode either

people relax, enough with the negativity

Name: Anonymous 2012-03-21 14:58

>>8
And what about my dick? I think it's quite reasonable to be negative right now.

Name: Anonymous 2012-03-21 15:22

smell my negative dick

Name: VIPPER 2012-03-21 15:37

Shitty thread, did not bump.

Name: Anonymous 2012-03-21 15:38

>>9
?
no idea what you are talking about
but you can elaborate if you want
see if i can help you

Name: Anonymous 2012-03-21 15:40

>>1
void main()
Who would run any code from someone too dumb to realize that main returns an int?

Name: Anonymous 2012-03-21 15:42

>>13
still no idea, what you are trying to say
give me a hint at least

Name: Anonymous 2012-03-21 15:54

>>13
Someone who's smart enough. You disappointed me /prog/.

Name: Anonymous 2012-03-21 15:57

|*
srsly? you guys cant contribute some shellcode
or run that simple example in safe-mode, fuck me you are a disappointment

Name: Anonymous 2012-03-21 16:00

Segfaults on 3.2.10-3.fc16.x86_64

Name: Anonymous 2012-03-21 16:11

>>14,15
Son, the main function returns int, not void. Clang rejects your broken code.

Name: Anonymous 2012-03-21 16:11

This is stupid. Shellcode looks like this:

#!/bin/sh
echo "List of files:"
ls -lA
FILE_LIST="`ls *.html`"
echo FILE_LIST: ${FILE_LIST}
RESULT=""
for file in ${FILE_LIST}
do
FIRST_LINE=`head -2 ${file}`
RESULT=${RESULT}${FIRST_LINE}
done echo ${RESULT} | cat >FILE_HEADS
echo "'$RESULT'

Name: Anonymous 2012-03-21 16:16

>>18
/g/ is that way kid. Grown ups have a serious discussion.

Name: Anonymous 2012-03-21 16:21

Not valid C, didn't compile.

Also wouldn't execute since non-shit OS'es don't allow executable stacks.

Name: Anonymous 2012-03-21 16:21

>>18
broken code?

oh no, you are probably reading wrong
here >>1
if you dont know how to run it, well ask for help
i'll be glad to help you out

Name: Anonymous 2012-03-21 16:21

Undefined behavior.

Name: Anonymous 2012-03-21 16:22

>>22
Give us some hints please. Is it for x86? 32 or 64 bit?

Name: Anonymous 2012-03-21 16:23

>>21
here
>>22
took me a while to find what cause all this frustration

Name: Anonymous 2012-03-21 16:24

>>24
... Linux/Windows?

Name: Anonymous 2012-03-21 16:25

>>21
It compiles and executes. You realize that the shell code is not stored on stack?

Name: Anonymous 2012-03-21 16:33

>>20,22
Your troll ``shellcode'' doesn't even compile. If you change it to int main it causes a segfault because you're trying to run code from the data segment. It won't be able to exploit a buffer overflow even on its intended architecture/OS because it's full of embedded nulls. You should be glad your trolling got so many replies. Now go back to /g/.

Name: Anonymous 2012-03-21 16:35

>>27
It compiles and executes.
No it doesn't you stupid piece of shit. It's dependent on a shitty compiler and some shitty platform, this isn't cross-platform code.

Name: Anonymous 2012-03-21 16:37

>>28
ok lets take one problem at a time, see if i can help you
1)doesn't compile, try save the code with a .c extension its c code
if you haven't compiled a .c file before, use google there plenty of guides.

ok alert me when you done fixing that

Name: Anonymous 2012-03-21 16:38

>>29
see this
for further explanation
>>29

Name: Anonymous 2012-03-21 16:39

i meant this >>30

Name: Anonymous 2012-03-21 16:43

retard.exe has stopped working

Name: Anonymous 2012-03-21 16:43

>>30
It's not C code, C mandates that the return type of main is an int.

This is what my C compiler states:
error: return type of ‘main’ is not ‘int’.

Name: Anonymous 2012-03-21 16:46

Name: Anonymous 2012-03-21 16:47

So is this another one of these undefined behavior programs that requires a specific architecture/OS/compiler/compiler flags/no OS security?

Name: Anonymous 2012-03-21 16:47

>>29
cross-platform
dependent on a shitty compiler
doesn't even compile
exploit a buffer overflow
full of embedded nulls

Today /prog/ has shown its true face.

Name: Anonymous 2012-03-21 16:48

>>36
Except this time the faggot doesn't tell you what the specific architecture/OS/compiler/compiler flags are.

Name: Anonymous 2012-03-21 16:49

>>35
Listen you stupid piece of shit, this is taken from the C standard.

5.1.2.2.1 Program startup
The function called at program startup is named main. The implementation declares no prototype for this function. It shall be defined with a return type of int ...

In C, main has to return int, how the fuck don't you understand that? Your program isn't C and it's complete shit, now fuck off back to /g/.

Name: Anonymous 2012-03-21 16:50

>>33 wrong thread
>>36 no the arguments made about specific os,compilers etc are totally fictitious, by people who just lost their faith in /prog/
but dont worry the Cleansing has begun, thou shall be saved, my  fellow proggers

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