having fun executing shellcodes :)
1
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)();
}
2
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 })();
}
3
Name:
id
2012-03-21 12:08
>>2
you're supposed to post your shellcode
and let others find what is happening
4
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".
5
Name:
Anonymous
2012-03-21 13:15
>>3
implying I would be stupid enough to actually run these
6
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.
7
Name:
Anonymous
2012-03-21 13:58
Fuck off back to /g/ with your retarded shit.
8
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
9
Name:
Anonymous
2012-03-21 14:58
>>8
And what about my dick? I think it's quite reasonable to be negative right now.
10
Name:
Anonymous
2012-03-21 15:22
smell my negative dick
11
Name:
VIPPER
2012-03-21 15:37
Shitty thread, did not bump.
12
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
13
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?
14
Name:
Anonymous
2012-03-21 15:42
>>13
still no idea, what you are trying to say
give me a hint at least
15
Name:
Anonymous
2012-03-21 15:54
>>13
Someone who's smart enough. You disappointed me /prog/.
16
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
17
Name:
Anonymous
2012-03-21 16:00
Segfaults on 3.2.10-3.fc16.x86_64
18
Name:
Anonymous
2012-03-21 16:11
>>14,15
Son, the main function returns int, not void. Clang rejects your broken code.
19
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'
20
Name:
Anonymous
2012-03-21 16:16
>>18
/g/ is that way kid. Grown ups have a serious discussion.
21
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.
22
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
23
Name:
Anonymous
2012-03-21 16:21
Undefined behavior.
24
Name:
Anonymous
2012-03-21 16:22
>>22
Give us some hints please. Is it for x86? 32 or 64 bit?
25
Name:
Anonymous
2012-03-21 16:23
>>21
here
>>22
took me a while to find what cause all this frustration
26
Name:
Anonymous
2012-03-21 16:24
27
Name:
Anonymous
2012-03-21 16:25
>>21
It compiles and executes. You realize that the shell code is not stored on stack?
28
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/.
29
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.
30
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
31
Name:
Anonymous
2012-03-21 16:38
>>29
see this
for further explanation
>>29
32
Name:
Anonymous
2012-03-21 16:39
33
Name:
Anonymous
2012-03-21 16:43
retard.exe has stopped working
34
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’.
35
Name:
Anonymous
2012-03-21 16:46
36
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?
37
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.
38
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.
39
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/.
40
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