title: Escaping characters in linux for a buffer overflow
body: <p>So we have a lab where we need to perform a buffer overflow on a program.  I already found that GCC has buffer overflow protection and I found that when you compile it, you have to disable it using the -fno-stack-protector flag.  After I got past that, i disassembled the code using gdb and found that i want to redirect the program to the address 0x4005b1.  </p>
  
  <p>However when i enter user input, how do i enter the hex value of b1 in ASCII?</p>
  
  <p>When the program prompts for user input is there a way to escape the b1 value.  something similar to:
  aaaaaaaaaaaaaaaaaaaaaaaaaaa@^E\xb1  .  Normally when I just compiled the program the address would start close to 0x040000, but when i use the -fno-stack-protector is starts at a much later address and that is why i need to redirect the return address to 0x4005b1.  If there isn't a way to enter b1, what are some alternative ways to get around this?  Could I somehow link the program to start at a particular address and if so, how is that done?  Any other help or suggestions would be much appreciated. </p>