Stack-based buffer overflow - not working on my own Kali

I’m following the module “stack-based buffer overflow linux” and I’m trying to reproduce every step on my own VM running Kali linux. But I get errors for simple things that work perfectly on the pawn box.

for example:

(gdb) run $(python -c “print ‘\x55’ * 1200”)

SyntaxError: Missing parentheses in call to ‘print’. Did you mean print(…)?

I’ve check the version of the gdb tool on both VM and they are different, but this instruction seems to be very simple to not execute in the same way…
Did someone try to follow the module on a different VM than the HTB pawnbox?


The bug is in the Python code, not in the GDB. You can try

$(python -c "print('\x55' * 1200)" )

The print statement without parentheses is used in Python version 2. The Python version 3 uses a print function with parentheses,

great, thanks a lot for clarifying this.