📌 逆向工程
· ☕ 1 min read
工具 靜態分析程式 Binwalk Ghidra 動態分析程序 gdb Z3 Theorem Prover 超猛拉 分析linux核心 User-Mode Linux bpftrace ftrace相關工具 基礎知識 microcode 比機械碼還底層 Meltdown Spectre 機械碼編碼方法 inte

assambly
· ☕ 1 min read
注意要點 這種關於rip基底做偏移要注意%rip要帶入下一行指令的位置 0x1–mov 0x2ee6(%rip),%rdx 這裡%rip指向0x1 但執行mov 0x2ee6(%rip),%rdx

c inline assambly and system call
· ☕ 4 min read
簡介 這裡我們要學到如何利用c語言直接呼叫system call做到printf顯示的功能 範例 實做直接呼叫linux system code 根據1-1表格找到的資訊

calling conventions
· ☕ 1 min read
其實wiki x86 calling conventions寫的很完整,我只是整理一下 簡介 當函數調用的時候必須傳遞參數,但傳遞的時候到底如何約定底層組合語言?就稱

canary analysis
· ☕ 2 min read
https://ctf-wiki.org/pwn/linux/mitigation/canary/ 你的程式 https://hardenedlinux.github.io/2016/11/27/canary.html https://stackoverflow.com/questions/10325713/why-does-this-memory-address-fs0x28-fs0x28-have-a-random-value 範例 題目 下面程式會觸發smashing detected請修好下面的程式 ** stack smashing detected ***: terminated 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #include<stdio.h>int

elf
· ☕ 14 min read
接下來以linux v5.10 64bit Elf64作範例 簡介 Executable and Linking Format (ELF)這個格式包含了執行與連結用的檔案,可以搭配文件交叉看 elf.pdf 原始碼elf.h linux

ftrace
· ☕ 2 min read
介紹 ftrace是Steven Rostedt開發trace-cmd也是他開發的,接下來用trace-cmd示範 細節文件請看ftrace.tx

gdb
· ☕ 11 min read
介紹 GDB(GNU Debugger)是Richard Stallman為了GNU所開發的其中一個套件 debug format 目前linux elf的debug format是DW

godbolt
· ☕ 1 min read
介紹 godbolt 就是給你看,各個語言,編譯器,不同參數 出來的機械碼,組合語言,執行 範例 可以看到xor %eax,%eax 的機械碼拉與c語言的組合語言 Output:compile to binary,x86-64 gcc 10.2 1 2 3 4 5

linux security module
· ☕ 1 min read
LSM_HOOK_INIT與call_int_hook是linux kernel 的macro負責處理 舉例ptrace安全處理 security_ptrace_access_check call_int_hook LSM_HOOK_INIT(ptrace_access_check, cap_ptrace_access_check) ftrace ptrace attach resault 1 2 3 cap_ptrace_access_check <-- security_ptrace_access_check

objdump
· ☕ 1 min read
ss

shellcode
· ☕ 1 min read
http://shell-storm.org/shellcode/