wallarm / gotestwaf

An open-source project in Golang to asess different API Security tools and WAF for detection logic and bypasses
https://lab.wallarm.com/test-your-waf-before-hackers/
MIT License
1.55k stars 212 forks source link

Unable to send report to email #172

Closed drey143 closed 1 year ago

drey143 commented 1 year ago

Hello I'm wondering why the report is unable to be sent to my email. any help will be appreciated.thanks


ERRO[0500] caught error in main function                 error="couldn't send report by email: couldn't marshal report data into JSON format: json: unsupported value: NaN"
svkirillov commented 1 year ago

Hi!

Thanks for the report! This looks like a bug. I added a check for NaN floating point values to prevent this behavior.

drey143 commented 1 year ago

Hi @svkirillov thanks for your quick response. I just tried it now and still getting same error message

svkirillov commented 1 year ago

Could you please provide full command with url option?

drey143 commented 1 year ago

I'm testing this with a simple "Nginx" server to test WAF rule. below is a screenshot of what the test returns.

here is a complete url : go run ./cmd --url=http://nginx-server-test-loadbalancer-614402827.us-east-1.elb.amazonaws.com --blockStatusCode 200

Screen Shot 2022-11-29 at 6 36 14 AM
drey143 commented 1 year ago

it's strange everything is 0.00% or n/a. because the default_action in place for the WAF right now is "count". the nginx server has nothing install on it, just the default page for nginx

svkirillov commented 1 year ago

blockStatusCode is equal to 20. Is it ok?

drey143 commented 1 year ago

that was a typo..its 200

svkirillov commented 1 year ago

Fixed some calculations in #173. Could you check if it works properly for you?

drey143 commented 1 year ago

@svkirillov .its working now. thank you