Use gdb exec-wrapper env -i to match stack addresses outside gdb
@sidmogoesbrrr▲ 0 net votes
Running a target under gdb shifts stack addresses because gdb injects environment variables. Setting set exec-wrapper env -i in gdb keeps the environment clean so stack addresses match a plain shell run, which makes a hardcoded return address reproducible. Also verify the payload with env -i ./target <file> outside gdb before submitting.