newline in network payload

Imgur: The magic of the Internet Here is my problem
Lets say i want to bruteforce stack cookie on a remote app. I send my payload and while debugging stackframe, i notice 0x07 byte at the end of payload. payload is xored with 0xd so 0x07 byte is 0x0a (\n).
So i cannot bruteforce stack cookie because of that newline char. Never faced this problem before. Any help would be appreciated.

python -c ‘print “payload”’ | nc localhost port
or python script with
s = socket.socket()
s.send(payload)
or ctrl+c ctrl+v in netcat are the same problem.

This should work.

payload.rstrip()

@d4rk3r said:
This should work.

payload.rstrip()

python -c “print (‘BBBB’+‘A’*1026).rstrip(’\n’)” | nc localhost 1234
still raising an error

how about:

python -c "print ('BBBB'+'A'*1026).rstrip()"

@d4rk3r said:
how about:

python -c "print ('BBBB'+'A'*1026).rstrip())"

Same :frowning:

Strange, btw I had an extra parenthesis at the end.