Questions tagged [gdb]

A source level debugger based on `ptrace` for *NIX systems and developed by the GNU project.

Filter by
Sorted by
Tagged with
4 votes
2 answers
557 views

Can't trace MIPS embedded device remotely

I'm trying to debug a remote device using gdbserver and IDA Pro. I'm attached to the correct PID and I'm able to step through instructions until the point where I redirect $pc to my ROP chain. At the ...
1 vote
0 answers
25 views

IDA Pro ignores present database with remote debugging

I have a qemu instance running a custom Linux distribution, within which I'd like to debug an (already running) application. I have already embedded a gdbserver inside (and have a root shell available)...
1 vote
1 answer
53 views

Why this x64 shellcode doesn't work?(segmentation fault)

I found a simple shellcode on the internet. Then, to test this shellcode, I make the simple ret overwrite code. test.c #include <stdio.h> #include <string.h> char buf[100]; int main(void)...
2 votes
3 answers
3k views

startup program exits with code 126 when executing program at entrypoint

I want to reverse engineer a program. I managed to find the entry point but every time I want to launch the application I get the same error `During startup program exited with code 126. Here is what ...
119 votes
2 answers
93k views

How to handle stripped binaries with GDB? No source, no symbols and GDB only shows addresses?

I have GDB but the binary I want reverse engineer dynamically has no symbols, that is when I run the file utility it shows me stripped: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), ...
2 votes
0 answers
64 views

format-string + ret2libc (or format string only)?

I found that we have a format-string bug with in argument 7. I found a function containing system(/bin/sh)). So I'm not saying stupidity I have to mess with a format-string and a ret2libc (correct me ...
1 vote
0 answers
76 views

Binary Exploitation

I am trying to learn binary exploitation. I can modify the binary behaviour with gdb, but I have not understood how to exploit the binary in C. I've found some references on "Hacking - the art of ...
2 votes
0 answers
38 views

IDA remote GDB debugger cannot suspend linux machine

I am starting Debugging Linux Virtual Machine by IDA GDB debugger. I can say I am able to connect to process (0) and start the machine (by using IDA 32bit, IMO it has something to do with bios! or I ...
2 votes
0 answers
28 views

How to get the address of a glibc private symbol at runtime programmatically?

I am trying to get the address of a private function in GLIBC. For instance - the function __run_prefork_handlers(). I have done it with gdb, using info symbol __run_prefork_handlers and info address ...
5 votes
1 answer
2k views

GDB find string strange results

I'm playing with gdb and strange things are happening. I wanted to find some address in memory where string "/bin/sh" is located, and gdb says it found it. But when I examine the memory there, the ...
2 votes
1 answer
98 views

GDB breakpoint crashes at a correct memory location

I'm trying to debug binaries of a a firmware running Linux with no ASLR, binaries are not compiled with PIE either so I have no issue getting the memory locations. So after including gdbserver in the ...
1 vote
0 answers
51 views

debug stripped file

I've system embedded mips big endian with gdb-server and I want debug stripped file of the target, I can run in target gdb server with stripped file (--attach PID), but when I try to connect with gdb-...
1 vote
2 answers
512 views

Run a python in command (kali) with "run" on gdb-peda$

While debugging a program under gdb with gdb-peda installed, I need to pass args to the binary using output from something like python. Why I am not getting AAAAA? gdb-peda$ b doSomthing gdb-peda$ run ...
1 vote
1 answer
86 views

How can I verify section -> segment mapping for ELFs on linux?

I'm looking at at ELF on linux and I have readelf --segments ./myELF which shows: Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR ...
3 votes
1 answer
406 views

Find string in stripped binary file use gdb

Does this debugger support this feature? Through find it is impossible, as the file stripped.
2 votes
0 answers
141 views

Is there a way to reprint the screen in gdb gef?

I am using gdb-gef and I've searched the manual several times for the answer to this question. Sometimes I run a lot of commands and I would like to re-draw the current program state the way gef ...
2 votes
0 answers
362 views

GDB "Cannot access memory at address ...." Breakpoint error

I have not yet found the solution on internet so i ask it here. Never had this problem before it was always doing fine, so i don't know what changed. I'm using gdb peda but the problem stays the same ...
1 vote
0 answers
112 views

can't debug properly

In the last few days I tried to solve "unlink" challenge in pwnable.kr and I'm struggling to attach a debugger remotely and locally on the server using pwntools (code added below). #!/usr/...
4 votes
0 answers
214 views

What utilities allow you to debug a process without pausing execution?

I was just reading this answer on StackOverflow, "How can you debug a process using gdb without pausing it?" The Linux kernel provides some support for this via PTRACE_SEIZE, but gdb doesn'...
1 vote
1 answer
70 views

Gdb hardware watchpoint error on android

After failing to find a solution to this I have started using Gdb and have encountered another error. Gdbfails to set hardware watchpoint when I'm remote debugging a rooted arm7-a target. It supports ...
2 votes
2 answers
305 views

Changing value of parameter with gdb

I have a file named exploit.c inside which: #include <stdbool.h> #include <stdio.h> const char y1 = 'a'; const char y2 = 'b'; const char y3 = 'x'; const char y4 = 'y'; const char y5 = 'i';...
12 votes
2 answers
3k views

Encrypted Mach-o binary cannot be disassembled/traced with GDB

I'm trying to analyze an encrypted Mach-O binary (non-iPhone one), and I am observing the following strange behaviors: when I load this binary into GDB and try to disassemble the code at the address ...
0 votes
1 answer
222 views

Debugging Windows applications on Linux: Hardware watchpoints and backtracing in IDA not working and winedbg hardware watchpoints borderline unusable?

As in the title. Maybe someone has any experience with this. It's a significant impediment when trying to debug Windows applications on Linux. I find hardware watchpoints, in particular, to be ...
1 vote
0 answers
73 views

Why Qiling doesn't recognize the right EntryPoint?

I'm trying to emulate an EFI driver. Luckily, I found a nice emulator called Qiling and try to debug it with GDB but it doesn't recognize the right Entry-Point. Here is the Entry-Point in IDA and in ...
98 votes
20 answers
132k views

Decent GUI for GDB

Learning the GDB commands is on my bucket-list, but in the meantime is there a graphical debugger for *nix platforms that accepts Windbg commands, and has similar functionality? For example, the ...
3 votes
3 answers
7k views

Why does my shellcode work in gdb but not on the command line

So I just started with reverse engineering and have run into some issues until I recently noticed something strange. I wrote an extremely simple shellcode (exit system call) for practice and I played ...
1 vote
1 answer
61 views

Paint path in Ida according to gdb log file

In Gdb I put script that print each instruction to gdb.txt file. I want to load this file to Ida to show and print/paint the path that the process has been running. The gdb script is # not strictly ...
0 votes
1 answer
48 views

ROP: System function not printing results to stdout

in oder to solve a CTF-Challenge I have to construct a small ROP-chain. The scope of the ROP chain is to print the content of the `flag` file. I already constructed the ROP-chain, but it seems that ...
0 votes
1 answer
2k views

How to watch a function's local variable in GDB?

I'm reversing a 64bit binary with gdb & peda and I've identified a function of interest (probably encoding user input). I want to watch the function interesting's local variable arg1. How can I ...
1 vote
1 answer
136 views

breakpoint already hit 1 time

I'm following Erickson 2008 Hacking the art of exploitation. The program is very simple. #include <stdio.h> #include <string.h> int main() { char str_a[20]; strcpy(str_a, "Hello, ...
0 votes
1 answer
650 views

IDA Pro ignores condition in breakpoint

Look at the condition. It is supposed to break only when the R2 is 40, but it breaks in any call to this instruction. I'm using IDA Pro 7.2.181105, debugging with Remote GDB Debugger, an ARMv4T code. ...
1 vote
0 answers
27 views

Using rbreak without import functions

While debugging with GDB I want to break for each function and print the PC register. rbreak . define hook-stop i r $PC c end The problem is that is stop on functions that imported like printf ...
2 votes
1 answer
1k views

Debug shared library in Android application

There is an Android application that has a shared library (.so) file in split_config.arm64_v8a.apk that I want to debug . When I look at /proc/PID/maps I don't see that library (I do see the ...
0 votes
1 answer
170 views

PEDA: Don't show context

gdb-peda shows a very useful context each time it stops (b, si, etc.), but sometimes I don't want it. Is there any way to quiet it so it won't show the context automatically (unless prompted context)?...
1 vote
1 answer
91 views

Adding ltrace information to gdb

I'd like to run gdb (or gdb-peda) with ltrace like info on each syscall. How can I do that? I know that, as per ltrace and gdb attach to same process , you can't actually attach ltrace and gdb to the ...
1 vote
1 answer
964 views

How can I find out the size of heap allocations?

While I debug with GDB I see the address of a buffer that's located on the heap. How can I know what is the size of this buffer? Or where (in the code) this buffer was originally allocated? When I ...
1 vote
1 answer
260 views

Connect remotely with GDBSERVER to pid

When I run gdbserver to listen for port and connect remotely with gdb: Gdbserver command: gdbserver --multi 0.0.0.0:4444 Gdb command: target remote 192.168.1.99 4444 In gdb . How can I connect to pid ...
2 votes
1 answer
2k views

Why can't gdb read memory if pwntools is used to send input?

Here is the program which gdb is attached to: prog.c #include <stdio.h> void dummy(char* s) { } int main() { char buf[512]; scanf("%s", buf); printf("%s\n", ...
2 votes
0 answers
320 views

Passing a String into a Function With GDB

So, I have a function with the prototype according to GDB: {std::string (std::string)} 0x56027729e545 <function(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator&...
1 vote
3 answers
11k views

Use GCC and objdump to disassemble any hex to assembly code

What would be the best way (also fewer steps) to generate assembly code for a given hex code ? For e.g., if we know the architecture is x86, and given hex value 0x55, what is the best way to generate ...
1 vote
0 answers
61 views

Handle Ioctl call while running with qemu

I am using qemu to emulate a binary like this qemu -strace XXXXX . I saw that the first 2 system calls of this process were TCGETS to stdin and stdout. From man pages Get and set terminal attributes ...
1 vote
1 answer
141 views

Debug bFLT in qemu-arm-static

I have bFLT binary (into linux-arm arch.) that I can run with qemu-arm-static . I want to debug that binary dynamically with GDB. I know I can debug binary with qemu like qemu-arm-static -g 1111 <...
1 vote
1 answer
47 views

Define operations to do in specific breakpoints using GDB

In gdbinit I defined some breakpoints. How can I do that when specific breakpoint called I want to run x/s $r1 ?
2 votes
0 answers
2k views

How to decompile python ELF file (Compiled with Nuitka)?

I have some files that compiled with nuitka. formats are .bin. I could get shell access to running process with pyrasite same as this guide. but I cannot decompile function codes or anything else, and ...
0 votes
0 answers
158 views

/bin/sh shell not execute when performing ret2libc attack

I have attempted to do a ret2libc attack. It's a simple buffer overflow with the return address pointed to the system call with the string "/bin/sh" on the stack. For some reason, when I try ...
2 votes
1 answer
535 views

GDB inserting breakpoint cause Segmentation Fault

I was trying to play around with gdb, and I'm especially interest in seeing how the Procedural Linkage Table(PLT) and the Global Offset Table (GOT) interact with each other. So I set some breakpoints ...
0 votes
1 answer
133 views

Debug process that use /dev/watchdog

I want to debug a process with gdb into Linux system, but the problem is that process pings /dev/watchdog so when I tried to debug it, it stop the process for longer than the watchdog interval so the ...
3 votes
1 answer
160 views

Confused about the use of the shl instruction in this disassembly

I created a code construct in C to see how it looks in x86. I'm confused about the use of the shl instructions. I'm confused about what is happening in between the lines <+39> and <+51> I ...
1 vote
1 answer
107 views

What's wrong with my mitm to support rr commands with gdbserver on IDA?

First of here is the gdb remote protocol doc. The idea of the below script is the following - you enter an actual command (one that will be send as a direct packet see packets) in the gdb window then ...
2 votes
0 answers
540 views

How to perform full MIPS system emulation with QEMU, using the squashfs image and uBoot kernel image?

TL;DR: Need tips on emulation of MIPS-BE system using QEMU with the help of squashfs image file and uBoot Kernel image file extracted from the firmware file. Long Version: - What I have: A cheap ...

1
2 3 4 5 6