# NCtfU - 3/8 (Reverse, PWN) (A205) ###### tags: `新手場` `nctfu2021` ## 會參加 * Onebone * m5063232325 * ppodds * ching * idisused * yenchia * Labebebedu(May be late) * wilson * 石頭 * QT * jefferyhe(will be late for class) ## 講者 - Onebone ## 會後問卷 - https://forms.gle/sZ4AFzpL9yf2yYJf6 ## 下週報告 - idisused ## 講者筆記 - 事前準備 - 可以跑 Linux 的環境 (VM, WSL...) - 以下為建立環境的指令(以 ubuntu 為例(18.04 以上應該都可以)) ``` bash= sudo apt update sudo apt install gdb -y sudo apt install git -y sudo apt-get update sudo apt-get isntall python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential pip3 install pwntools git clone https://github.com/pwndbg/pwndbg cd pwndbg ./setup.sh ``` - 上課教材 - https://github.com/onebone1/NCtfU_2021_spring ### 工具使介紹 - Assembly (x86) - gdb - b # 設定中斷點 - r # 執行程式 - n # next line - s # step in - c # continue - set #設置暫存器的值 - checksec - disassemble - info share - info function #看到該程式目前已經call的function - vmmap - x/ - ghidra - ida (pro) ## 共筆 - objdump -d -M intel <elf> - file #查看檔案類型 ![](https://i.imgur.com/mUyrX1K.png =400x) - function開啟會有基本開頭跟結尾,...內放function的功能(參見Stack Frame) ```asm push ebp #function prologue mov ebp,esp .... pop ebp #function epilogue ret ``` - picoCTF:reverse Engineering的asm1 asm1(0x8be) 會傳入0x8be進去放在ebp+0x8 第三行cmp 比較0x8be 與0x71c - x/w $記憶體位置 #查該位置存的值