gdb windbg and od use
gdb
- aslr -- 显示/设置 gdb 的 ASLR
- asmsearch -- Search for ASM instructions in memory
- asmsearch "int 0x80"
- asmsearch "add esp, ?" libc
- assemble -- On the fly assemble and execute instructions using NASM
- assemble
- assemble $pc
> mov al, 0xb
> int 0x80
> end - checksec -- 检查二进制文件的安全选项
- cmpmem -- Compare content of a memory region with a file
- cmpmem 0x08049000 0x0804a000 data.mem
- context -- Display various information of current execution context
- context_code -- Display nearby disassembly at $PC of current execution context
- context_register -- Display register information of current execution context
- context_stack -- Display stack of current execution context
- context reg
- context code
- context stack
- crashdump -- Display crashdump info and save to file
- deactive -- Bypass a function by ignoring its execution (eg sleep/alarm)
- deactive setresuid
- deactive chdir
- distance -- Calculate distance between two addresses
- dumpargs -- 在调用指令停止时显示传递给函数的参数
- dumpmem -- Dump content of a memory region to raw binary file
- dumpmem libc.mem libc
- dumprop -- 在特定的内存范围显示 ROP gadgets
- dumprop
- dumprop binary "pop"
- eflags -- Display/set/clear/toggle value of eflags register
- elfheader -- 获取正在调试的 ELF 文件的头信息
- elfheader
- elfheader .got
- elfsymbol -- 从 ELF 文件中获取没有调试信息的符号信息
- elfsymbol
- elfsymbol printf
- gennop -- Generate abitrary length NOP sled using given characters
- gennop 500
- gennop 500 "\x90"
- getfile -- Get exec filename of current debugged process
- getpid -- Get PID of current debugged process
- goto -- Continue execution at an address
- help -- Print the usage manual for PEDA commands
- hexdump -- Display hex/ascii dump of data in memory
- hexdump $sp 64
- hexdump $sp /20
- hexprint -- Display hexified of data in memory
- hexprint $sp 64
- hexprint $sp /20
- jmpcall -- Search for JMP/CALL instructions in memory
- jmpcall
- jmpcall eax
- jmpcall esp libc
- loadmem -- Load contents of a raw binary file to memory
- loadmem stack.mem 0xbffdf000
- lookup -- 搜索属于内存范围的地址的所有地址/引用
- lookup address stack libc
- lookup pointer stack ld-2
- nearpc -- Disassemble instructions nearby current PC or given address
- nearpc 20
- nearpc 0x08048484
- nextcall -- Step until next 'call' instruction in specific memory range
- nextcall cpy
- nextjmp -- Step until next 'j*' instruction in specific memory range
- nextjmp
- nxtest -- Perform real NX test to see if it is enabled/supported by OS
- patch -- 使用字符串/十六进制字符串/整形数
- patch $esp 0xdeadbeef
- patch $eax "the long string"
- patch (multiple lines)
- pattern -- 生成,搜索或写入循环 pattern 到内存
- pattern_arg -- Set argument list with cyclic pattern
- pattern_create -- Generate a cyclic pattern
- pattern_env -- Set environment variable with a cyclic pattern
- pattern_offset -- Search for offset of a value in cyclic pattern
- pattern_patch -- Write a cyclic pattern to memory
- pattern_search -- Search a cyclic pattern in registers and memory
- pattern create 2000
- pattern create 2000 input
- pattern offset $pc
- pattern search
- pattern patch 0xdeadbeef 100
- payload -- Generate various type of ROP payload using ret2plt
- payload copybytes
- payload copybytes target "/bin/sh"
- payload copybytes 0x0804a010 offset
- pdisass -- Format output of gdb disassemble command with colors
- pdisass $pc /20
- pltbreak -- Set breakpoint at PLT functions match name regex
- pltbreak cpy
- procinfo -- 显示调试进程的 /proc/pid/
- procinfo
- procinfo fd
- profile -- Simple profiling to count executed instructions in the program
- pyhelp -- Wrapper for python built-in help
- pyhelp peda
- pyhelp hex2str
- pshow -- 显示各种 PEDA 选项和其他设置
- pshow
- pshow option context
- pset -- 设置各种 PEDA 选项和其他设置
- pset arg '"A"*200'
- pset arg 'cyclic_pattern(200)'
- pset env EGG 'cyclic_pattern(200)'
- pset option context "code,stack"
- pset option badchars "\r\n"
- readelf -- 获取 ELF 的文件头信息
- readelf libc .text
- refsearch -- Search for all references to a value in memory ranges
- refsearch "/bin/sh"
- refsearch 0xdeadbeef
- reload -- Reload PEDA sources, keep current options untouch
- ropgadget -- 获取二进制或库的常见 ROP gadgets
- ropgadget
- ropgadget libc
- ropsearch -- 搜索内存中的 ROP gadgets
- ropsearch "pop eax"
- ropsearch "xchg eax, esp" libc
- searchmem|find -- 搜索内存中的 pattern; 支持正则表达式搜索
- find "/bin/sh" libc
- find 0xdeadbeef all
- find "..\x04\x08" 0x08048000 0x08049000
- searchmem -- Search for a pattern in memory; support regex search
- session -- Save/restore a working gdb session to file as a script
- set -- Set various PEDA options and other settings
- set exec-wrapper ./exploit.py
- sgrep -- Search for full strings contain the given pattern
- shellcode -- 生成或下载常见的 shellcode
- shellcode x86/linux exec
- show -- Show various PEDA options and other settings
- skeleton -- 生成 python exploit 代码模板
- skeleton argv exploit.py
- skipi -- Skip execution of next count instructions
- snapshot -- Save/restore process's snapshot to/from file
- snapshot save
- snapshot restore
- start -- Start debugged program and stop at most convenient entry
- stepuntil -- Step until a desired instruction in specific memory range
- stepuntil cmp
- stepuntil xor
- strings -- Display printable strings in memory
- strings
- strings binary 4
- substr -- Search for substrings of a given string/number in memory
- telescope -- Display memory content at an address with smart dereferences
- telescope 40
- telescope 0xb7d88000 40
- tracecall -- Trace function calls made by the program
- tracecall
- tracecall "cpy,printf"
- tracecall "-puts,fflush"
- traceinst -- Trace specific instructions executed by the program
- traceinst 20
- traceinst "cmp,xor"
- unptrace -- Disable anti-ptrace detection
- unptrace
- utils -- Miscelaneous utilities from utils module
- vmmap -- 在调试过程中获取段的虚拟映射地址范围
- cmmap
- vmmap binary / libc
- vmmap 0xb7d88000
- waitfor -- Try to attach to new forked process; mimic "attach -waitfor"
- waitfor
- waitfor myprog -c
- xinfo -- Display detail information of address/registers
- xinfo register eax
- xinfo 0xb7d88000
- xormem -- 用一个 key 来对一个内存区域执行 XOR 操作
- xormem 0x08049000 0x0804a000 “thekey”
- xprint -- Extra support to GDB's print command
- xrefs -- Search for all call/data access references to a function/variable
- xuntil -- Continue execution until an address or function
OD
- Ctrl+F1:打开与所选行内符号相关的 API 帮助文档。
- F2:在光标选定位置按 F2 键设置或取消断点。
- Shift+F2:在首个选择命令设置条件断点。
- Ctrl+F2:重新启动被调试程序。
- F4:运行到光标选定位置处暂停。
- Shift+F4:设置记录断点。
- F5:最大化当前窗口。
- Ctrl+F5:打开与首个选择的命令相对应的源文件。
- Alt+F5:让 OllyDbg 窗口总在最前面。
- F6:切换到下一个窗口。
- Shift+F6:切换到前一个窗口。
- F7:单步步入:每次执行一条指令,遇到 call 等子程序时进入其中。
- Shift+F7:与 F7 相同,但当被调试程序发生异常而中止时,调试器首先尝试步入被调试程序指定的异常处理。
- Ctrl+F7:自动步入,在所有的函数调用中一条一条地执行命令。
- Alt+F7:转到上一个找到的参考。
- F8:单步步过,每次执行一条指令,遇到 call 等子程序时不进入其中。
- Shift+F8:与 F8 相同,但当被调试程序发生异常而中止时,调试器首先尝试步过被调试程序指定的异常处理。
- Ctrl+F8:自动步过,一条一条执行命令,但不进入函数内部调用。
- Alt+F8:转到下一个找到的参考。
- F9:运行,被调试软件继续运行,直到遇到下一个断点。
- Shift+F9:与 F9 相同,但当被调试程序发生异常而中止时,调试器首先尝试执行被调试程序指定的异常处理。
- Ctrl+F9:执行到返回,在执行到一个 ret 指令时暂停,常用于从当前函数快速返回到上一个函数。
- Alt+F9:执行到用户代码,可用于从系统部分快速返回到被调试程序部分。
- F10:打开与当前窗口或面板相关的快捷菜单。
- Ctrl+F11:Run 跟踪步入,一条一条执行命令,进入子函数调用,并把寄存器信息加入到 Run 跟踪的存储数据中。
- F12:停止执行,暂停所有线程。
- Ctrl+F12:Run 跟踪步过,一条一条执行命令,不进入子函数调用,并把寄存器信息加入到 Run 跟踪的存储数据中。
- Alt+F3:关闭当前窗口。
- Alt+B:显示断点窗口。
- Alt+C:显示 CPU 窗口。
- Alt+E:显示模块列表。
- Alt+K:显示调用栈。
- Alt+L:显示日志窗口。
- Alt+M:显示内存窗口。
- Alt+O:显示选项对话框。
- Alt+Backspace:撤销对所选部分的修改。
- Ctrl+A:分析当前模块的代码段。
- Ctrl+B:开始二进制搜索。
- Ctrl+E:以十六进制格式编辑所选内容。
- Ctrl+F:开始命令搜索。
- Ctrl+G:转到某地址。
- Ctrl+J:列出所有的涉及到该位置的调用和跳转。
- Ctrl+K:查看与当前函数相关的调用树。
- Ctrl+L:搜索下一个。
- Ctrl+N:打开当前模块的名称列表。
- Ctrl+O:扫描对象文件。
- Ctrl+P:显示补丁窗口。
- Ctrl+R:搜索所选命令的参考。
- Ctrl+S:命令搜索。
- Ctrl+T:打开“暂停Run跟踪”对话框。
- Esc:停止自动执行或跟踪。
- Enter:将选中的命令添加到命令历史,如果当前命令是一个跳转或者函数,则进入到目的地址。
- Backspace:如果分析器将代码误识为数据,可以将选中部分的自动分析信息移除。
- *:转到原始位置
- Ctrl+*:指定新的起始位置。
- +:如果 Run 跟踪没有激活,则根据历史命令跳到下一条运行过命令的地方;否则跳到 Run 跟踪的下一个记录。
- Ctrl++:跳到前一个函数的开始处。
- -:如果 Run 跟踪没有激活,则根据历史命令跳到前一条运行过命令的地方;否则跳到 Run 跟踪的前一个记录。
- Ctrl+-:跳到下一个函数的开始处。
- Space:修改命令。
- ::添加标签。
- ;:添加注释。
- windbg
- F10:单步步过F11:
- 单步步入Shift+F11:跳出当前函数
- 调试
t
:单步步入p
:单步步过- 执行
g [addr|func]
:执行到指定位置gh [addr|func]
:执行到指定位置,遇到异常时中断gn [addr|func]
:执行到指定位置,遇到异常时忽略- 断点
bl
:列出已设置的断点be [ID]
:激活断点bd [ID]
:禁用断点bc [ID]
:清除断点bp [addr|func]
:设置断点
- 数据显示
d [addr]
:显示内存数据db [addr]
:按字节模式显示dd [addr]
:按双字模式显示dD
:按双精度浮点数显示da
:按 ASCII 显示du
:按 Unicode 显示ds
:按字符串显示dt
:套用已知的数据结构模板显示
- 数据编辑
e [addr] [data]
:修改任意地址内存的值eb [addr] [data]
:以字节写入ed [addr] [data]
:以双字写入ea [addr] [data]
:以 ASCII 字符写入eu [addr] [data]
:以 Unicode 字符写入
- 栈帧显示
k [x]
:由栈顶开始列出当前线程中的栈帧,x 为需要回溯的栈帧数kb [x]
:可以额外显示 3 个传递给函数的参数
- 寄存器显示
r [reg]
:显示指定寄存器的值
- 模块显示
lm
:列出当前已经读入的所有模块
- 反汇编
u
:反汇编当前指令后的几条指令u [start]
:从指定位置开始反汇编u [start] [end]
:反汇编指定地址区间