General purpose debugger.
Hint: gbd disables ASRL by default.
Commands
- General
set disassembly-flavor intel/att
- Process handling
runruns a programm without parametersrun `python -c 'print("a")'‘ runs a program with a parameterrun < <(python -c 'print("a")') runs a program and enters the given string into STDINccontinuesistep one instruction
- Breakpoints
break $forbreak *$addressdel breakpointsinfo breakpoints
- Disassembling
disass <$function | $address>disassembles a function or memory address- shows with parameter
-rthe opcodes
- shows with parameter
printorinfoprints content of registers and variablesinfo funcshows all functions
x/$numi $addressprints $num entries from address $address onx/32wx $esp-32(x86) orx/32gw $rsp-32(x64) for showing the memory at the stack pointer.- Important: remember to decrese the address from the stack pointer because the stack is above it…
x/32s $esp-32(x86) orx/32s $rsp-32(x64) for showing the memory at the stack pointer as strings.
backtraceprints the return pointerinfo functionsshows all functionsbtbacktrace — Shows where the current address is references.
Peda
Peda is a extension for gdb which provides useful additional commands.
- General information
checksecprints the security optionsaslrprints whether aslr is active
- (Cross-) referencing
xrefs $functionshows all references to the given function.- Note that gdb’s
btshows references to an address and Peda’sxrefsto a function (=start address of a function)
- Note that gdb’s
- Payload creation
pattern_create ncreats a string pattern like msfvenomjmpcallsearches for jmp calls
Leave a Reply
You must be logged in to post a comment.