goreplay icon indicating copy to clipboard operation
goreplay copied to clipboard

when run gor,there are some errors.

Open wsm1988 opened this issue 3 years ago • 13 comments

[DEBUG][elapsed 217.594µs]: [HTTP-OUTPUT] error when sending: "malformed MIME header: missing colon: "\r\r"" [DEBUG][elapsed 68.93µs]: [HTTP-OUTPUT] error when sending: "malformed MIME header: missing colon: "X-Forwar"" [DEBUG][elapsed 595.34µs]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 23.978µs]: [HTTP-OUTPUT] error when sending: "malformed MIME header: missing colon: "X-Forwar111.177.8.97"" [DEBUG][elapsed 10.379µs]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 10.402µs]: [HTTP-OUTPUT] error when sending: "malformed MIME header: missing colon: "X-Forwar"" [DEBUG][elapsed 41.794µs]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 34.597µs]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 7.662µs]: [HTTP-OUTPUT] error when sending: "malformed MIME header: missing colon: "X-Forwarded.168.100"" [DEBUG][elapsed 24.353µs]: [HTTP-OUTPUT] error when sending: "malformed MIME header: missing colon: "X-"" [DEBUG][elapsed 19.583µs]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 32.937µs]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 26.797µs]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 24.829µs]: [HTTP-OUTPUT] error when sending: "malformed MIME header: missing colon: "13"" [DEBUG][elapsed 45.812696ms]: [INPUT-RAW] message timeout reached, increase input-raw-expire [DEBUG][elapsed 37.428µs]: [INPUT-RAW] message timeout reached, increase input-raw-expire [DEBUG][elapsed 19.91µs]: [INPUT-RAW] message timeout reached, increase input-raw-expire [DEBUG][elapsed 17.222µs]: [HTTP-OUTPUT] error when sending: "malformed MIME header: missing colon: "User-Agent"" [DEBUG][elapsed 15.127µs]: [HTTP-OUTPUT] error when sending: "malformed MIME header: missing colon: "Cli1"" [DEBUG][elapsed 15.818µs]: [INPUT-RAW] message timeout reached, increase input-raw-expire [DEBUG][elapsed 34.603µs]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 14.539µs]: [INPUT-RAW] message timeout reached, increase input-raw-expire [DEBUG][elapsed 17.713µs]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 11.775µs]: [INPUT-RAW] message timeout reached, increase input-raw-expire [DEBUG][elapsed 19.839µs]: [INPUT-RAW] message timeout reached, increase input-raw-expire [DEBUG][elapsed 18.81µs]: [INPUT-RAW] message timeout reached, increase input-raw-expire [DEBUG][elapsed 17.201µs]: [INPUT-RAW] message timeout reached, increase input-raw-expire [DEBUG][elapsed 17.936µs]: [HTTP-OUTPUT] error when sending: "malformed MIME header: missing colon: "X-ForwardedTVxWTM5CipaViBRHhhEADMmIlxtKAgnS1g9XF8GAFEeMStdbigUIFFeIl1XBARDADU%252F"" [DEBUG][elapsed 24.959µs]: [INPUT-RAW] message timeout reached, increase input-raw-expire [DEBUG][elapsed 41.816µs]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 1.04069ms]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 4.886139ms]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 833.971µs]: [HTTP-OUTPUT] error when sending: "unexpected EOF" [DEBUG][elapsed 1.76812ms]: [HTTP-OUTPUT] error when sending: "Post "http://XXXXXXXXX:8456/miner/report?type=normal": readfrom tcp 10.202.144.28:40254->10.41.103.27:8456: unexpected EOF" [DEBUG][elapsed 41.13922ms]: [INPUT-RAW] message timeout reached, increase input-raw-expire panic: runtime error: slice bounds out of range [807:806]

goroutine 34 [running]: github.com/buger/goreplay/proto.header(0xc002500380, 0x339, 0x339, 0xc0038a8ac8, 0x7, 0x20, 0xedb92e, 0x3, 0xedc2cc, 0x4, ...) /go/src/github.com/buger/goreplay/proto/proto.go:115 +0x41a github.com/buger/goreplay/proto.SetHeader(0xc002500380, 0x339, 0x339, 0xc0038a8ac8, 0x7, 0x20, 0xc0038a8aa8, 0xd, 0x20, 0x3f, ...) /go/src/github.com/buger/goreplay/proto/proto.go:157 +0x85 main.(*HTTPModifier).Rewrite(0xc0038a8d38, 0xc002500380, 0x339, 0x339, 0x4, 0x4, 0x600) /go/src/github.com/buger/goreplay/http_modifier.go:60 +0x20c main.CopyMulty(0x7f3cc0151e58, 0xc0003621c0, 0xc0004921d0, 0x1, 0x1, 0x0, 0x0) /go/src/github.com/buger/goreplay/emitter.go:108 +0x97e main.(*Emitter).Start.func2(0xc000484540, 0xc00021e780, 0x7f3cc0151e58, 0xc0003621c0) /go/src/github.com/buger/goreplay/emitter.go:53 +0x8f created by main.(*Emitter).Start /go/src/github.com/buger/goreplay/emitter.go:51 +0x119

wsm1988 avatar Oct 12 '21 08:10 wsm1988

my command is: ./gor --input-raw :8456 --output-http "http://{dest ip}:8456" --http-set-param type=normal --http-set-header "XCDN-IP: 116.8.226.132" --output-http-redirects 2 --verbose 2

wsm1988 avatar Oct 12 '21 08:10 wsm1988

Very interesting. What is the version you running?

Any way to replicate the issue?

buger avatar Oct 12 '21 08:10 buger

Can you check if you have the same issue without --http-set-param and -http-set-header ?

buger avatar Oct 12 '21 08:10 buger

my version is: Current Version: v1.3.0 the issue appers each time

wsm1988 avatar Oct 12 '21 09:10 wsm1988

if not add --http-set-param and -http-set-header, it can not realize my aim

wsm1988 avatar Oct 12 '21 09:10 wsm1988

if not add --http-set-param and -http-set-header, it can not realize my aim

I just want to double-check if it will fix the errors, and confirm my theory if this params cause bug.

buger avatar Oct 12 '21 09:10 buger

I try to run without --http-set-param and -http-set-header, it is ok

wsm1988 avatar Oct 12 '21 09:10 wsm1988

if not add --http-set-param and -http-set-header, it can not realize my aim

I just want to double-check if it will fix the errors, and confirm my theory if this params cause bug.

if there are some bugs ? when add this params 。 Look forward to your reply,thank you very much!

wsm1988 avatar Oct 14 '21 07:10 wsm1988

It feels so. It will take a few days to investigate and fix.

buger avatar Oct 14 '21 07:10 buger

It feels so. It will take a few days to investigate and fix.

OK, thank you very much, best wishes~

wsm1988 avatar Oct 14 '21 07:10 wsm1988

It feels so. It will take a few days to investigate and fix.

HI, if the bug fixed? wait your reply, thank you~

wsm1988 avatar Nov 04 '21 08:11 wsm1988

it was caused by some malformed HTTP request headers there, e.g. ... X-MALFORMED-HEADER1:\n ... while matching the position for header "X-MALFORMED-HEADER1" in func header() in proto/proto.go, the OOB access in the payload slice occurred, the similar malformed header "Transfer-Encoding:\nchunked\r\n" led the OOB crash, as you can see there was only LF character instead of CRLF characters between header 'Transfer-Encoding' and the value 'chunked', the func header() in proto/proto.go assumed the pairing CR character must be in front of LF character, and decrease the value end index by 2, so an OOB like "... slice bounds out of range [376:375]" occurred.

inter169 avatar Nov 11 '21 04:11 inter169

it was caused by some malformed HTTP request headers there, e.g. ... X-MALFORMED-HEADER1:\n ... while matching the position for header "X-MALFORMED-HEADER1" in func header() in proto/proto.go, the OOB access in the payload slice occurred, the similar malformed header "Transfer-Encoding:\nchunked\r\n" led the OOB crash, as you can see there was only LF character instead of CRLF characters between header 'Transfer-Encoding' and the value 'chunked', the func header() in proto/proto.go assumed the pairing CR character must be in front of LF character, and decrease the value end index by 2, so an OOB like "... slice bounds out of range [376:375]" occurred.

how can I solve the problem?

wsm1988 avatar Nov 16 '21 01:11 wsm1988