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: Anonymous 2012-03-21 16:51

>>38
I think he actually believes that this is C, and that ELF is a portable format.

Name: Anonymous 2012-03-21 16:51

>>34
>>36
You fucking retards do you realize that it's some small homework that you can adjust to run if you were not fucking loosers complaining about totally not interesting details because that's the only thing you can do?

inb4 Oh yeah C standard is detail.
Grow up kids.

Name: Anonymous 2012-03-21 16:53

>>39
Your point? Are you trying to prove to use that you're so mentally disabled that you can't rewrite void to int or use the version in >>2?

Name: Anonymous 2012-03-21 16:53

>>39
touchy, touchy
here watch this, relax a bit
http://en.wikipedia.org/wiki/Anger_Management
and when you are ready and you have calmed down
take a look at this
http://en.wikipedia.org/wiki/C_%28programming_language%29
only when you are ready, remember learning should be fun!

Name: Anonymous 2012-03-21 16:53

>>42
You're not even trying anymore. Fuck off back to /g/, ``tray''.

Name: Anonymous 2012-03-21 16:54

>>44
You're not even trying anymore. Fuck off back to /g/, ``tray''.

Name: Anonymous 2012-03-21 16:56

>>43,44
Listen you stupid piece of shit, you can't cast object pointer types to function pointer types, so it isn't C.

Just fucking deal with you fucking moron, go back to /g/ with this shit.

Name: Anonymous 2012-03-21 16:58

>>43 again one step at the time. skipping steps wont get you anywhere

Name: Anonymous 2012-03-21 16:59

>>47
LOL, you can ... http://stackoverflow.com/a/9593583

back to /g/ lol

Name: Anonymous 2012-03-21 16:59

This isn't C.
error: ISO C forbids conversion of object pointer to function pointer type

Name: Anonymous 2012-03-21 17:00

>>49
Read the fucking standard you stupid piece of shit, it specifically mentions that it's illegal.

Name: Anonymous 2012-03-21 17:03

>>51
illegal
LOL ROFL, back to /g/ kid

Name: Anonymous 2012-03-21 17:04

>>40
no the arguments made about specific os,compilers etc are totally fictitious
So this compiles with C compilers? (no it doesn't, illegal conversion, main has wrong type, both illegal per the C standard)
So this works on both little endian and big endian machines? (no it doesn't)
So this works on something else than 32 bit machines? (no it doesn't)
So this works on something else than x86? (no it doesn't)
So this works on OS'es that mark data segments as non-executable? (no it doesn't)

Name: Anonymous 2012-03-21 17:05

>>49 no don't make fun of him, just because he's frustrated
doesn't mean we cant help him, his excessive use of words like shit and fuck, should only be a flag to this person's age and ethnicity, and i be damned if i give up to another keen but not able soul like him

Name: Anonymous 2012-03-21 17:05

>>52
Please cite from the C standard where it mentions otherwise.

Specifically try to look at section 6.3.2.3 of the ISO/IEC 9899:2011 standard, I think you'll be surprised.

Name: Anonymous 2012-03-21 17:07

>>55 lmao idiot who reads the rules like that its obviously allowed or else http://stackoverflow.com/a/9593583 wouldn't exist

LOL what an idiot go back to /g/ kid

Name: Anonymous 2012-03-21 17:07

>>55
Ok, here are some facts: You're
1) Interested in this thread
2) Not interested in figuring out what that machine code does
3) Interested in repeating excerpt from C standard that everybody knows and no one cares because GCC will compile it (and Clang too if you're not faggot)

Face it, you're just a looser.

Name: Anonymous 2012-03-21 17:08

Name: Anonymous 2012-03-21 17:10

>>1
Since this is undefined behavior (void main and trying to execute data as a function) and either fails to compile or segfaults with all compilers I've used, what OS, architecture, compiler, and compiler flags did you use to get this to run.

Name: Anonymous 2012-03-21 17:11

>>56,57
Same retard.

Name: Anonymous 2012-03-21 17:12

>>60
retard is a strong word
and no not same person

Name: Anonymous 2012-03-21 17:12

>>57

Interested in this thread
Not really.

Not interested in figuring out what that machine code does
It doesn't do anything, because it's not valid C code, you have to specify some compiler, platform and architecture before this becomes valid code.

Interested in repeating excerpt from C standard that everybody knows and no one cares because GCC will compile it (and Clang too if you're not faggot)
This is nonsensical, newer GCC and clang will compile this as GNU-C code. This still means that there are versions and flags you can't use, so you're dependent on a specific version of GCC and a specific version of clang, and then after you have specified those you are dependent on specific compiler flags.

Face it, you're just a looser.
First of all, it's called loser and not looser. I thought I would help you out since you're obviously mentally challenged. Second of all, ad hominem attacks will get you nowhere, you're wrong and you can either deal with it or go cry in a corner.

Name: Anonymous 2012-03-21 17:13

>>60
LOL idiot how can you say these are the same people
obviously not same person ROFL how can you believe that...

Name: Anonymous 2012-03-21 17:15

>>61
>>63
haha I'm laughing so much right now LOL how he thinks they are same person amazing...

Name: Anonymous 2012-03-21 17:16

>>62
OMG listen here are some more facts:
1) you are an idiot
2) you dont know what your talking about
3) you dont know how to compile code with GCC

Name: Anonymous 2012-03-21 17:16

i had no idea /prog/ was this dumb cant even compile and run C code LOL

Name: Anonymous 2012-03-21 17:17

>>62
you are just being too anal about things, without any particular
reason other than being a buster, i mean relax, if you don't want to participate then don't, but don't bring everyone down just because you are grumpy

Name: Anonymous 2012-03-21 17:18

That kind of shellcode won't work if the memory is marked as non executable. Use return to libc instead.

Name: Anonymous 2012-03-21 17:20

I like how he included stdio without using any part of it.

Name: Anonymous 2012-03-21 17:24

wow i ran this code this is so cool thanks OP
also cant believe that /prog/ isnt smart enough to run C code LOL ROFL haha they should really go back to /g/ LOL

Name: Anonymous 2012-03-21 17:25

>>57
Interested in repeating excerpt from C standard that everybody knows and no one cares because GCC will compile it (and Clang too if you're not faggot)
You can go back to /g/ now.

Name: Anonymous 2012-03-21 17:26

>>1,63-67,70,71
Same person.

Name: Anonymous 2012-03-21 17:28

When will people stop making shitty threads like this?

Name: Anonymous 2012-03-21 17:29

>>72 nope

Name: Anonymous 2012-03-21 17:30

>>72
You're probably not very far off, but I haven't posted in this thread before >>71. I don't think my post really looks like the ones you linked to either.

Name: Anonymous 2012-03-21 17:30

>>73
agreed c, and creating shellcode is way too advanced
for the average /prog/
try some python for god's sake

Name: Anonymous 2012-03-21 17:31

How do I disable DEP in Linux?

Name: Anonymous 2012-03-21 17:32

>>77
Just grab an older version.

Name: Anonymous 2012-03-21 17:34

If you post non-conforming code don't get butthurt when someone points it out, >>53 sums it up pretty well, and that doesn't even mention the ELF format.

Name: Anonymous 2012-03-21 17:36

>>79
ROFL LOL if you dont know how to run C code how are you on /prog/???

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