0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

中古ノート、買ってみた。 その43

Posted at

概要

中古ノート買ってみた。
wsl1のubuntu18.04にnasm入れてみた。
アセンブラでshellcodeやってみた。

手順

アセンブラを書く

# cat shell.asm

section .text
global _start
_start:
        xor     rdx, rdx
        push    rdx
        mov     rax, 0x68732f6e69622f
        push    rax
        mov     rdi, rsp
        push    rdx
        push    rdi
        mov     rsi, rsp
        xor     rax, rax
        mov     al, 0x3b
        syscall


コンパイル

# nasm -f elf64 shell.asm

リンク

# ld -o b shell.o

実行

# ./b
# ls
a  a.c  a.out  a.s  b  b.asm  b.o  shell.asm  shell.o
# pwd
/root/nasm
# exit
#

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?