Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

503 responses being treated as Service OK #82

Open
krausyd opened this issue May 27, 2023 · 1 comment
Open

503 responses being treated as Service OK #82

krausyd opened this issue May 27, 2023 · 1 comment

Comments

@krausyd
Copy link

krausyd commented May 27, 2023

I am running a Slow body for penetration testing for my service. I am working in some mitigations for the DoS when slow http happens. When I have my service under attack, I do some real request to see if my service is up or not. And I get a 503 on those requests, and when I see my service dashboards, clearly it was overloaded, and restarted by my balancers due bad health.

But when I see the graphs and report generated from my test, it says my service was available 100% of the time. Shouldn't it show as unavailable?

The command I am running is:
slowhttptest -u <my_url> -c 10000 -B -g -v4

I can see the 503 responses in the logs:

Sat May 27 11:50:26 2023:
slow HTTP test status on 0th second:

initializing:        0
pending:             1
connected:           0
error:               0
closed:              0
service available:   YES

foo=barSat May 27 11:50:28 2023:socket 75 created 
Sat May 27 11:50:28 2023:run_test:initial 385 of 385 bytes sent on socket 70:
POST / HTTP/1.1
Host: <my_url>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:5.0.1) msnbot-131-253-46-102.search.msn.com
Referer: TESTING_PURPOSES_ONLY
Content-Length: 4096
Content-Type: application/x-www-form-urlencoded
Accept: text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Connection: close

foo=barSat May 27 11:50:28 2023:socket 80 created 
Sat May 27 11:50:28 2023:run_test:initial 385 of 385 bytes sent on socket 75:
POST / HTTP/1.1
Host: <my_url>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:5.0.1) msnbot-131-253-46-102.search.msn.com
Referer: TESTING_PURPOSES_ONLY
Content-Length: 4096
Content-Type: application/x-www-form-urlencoded
Accept: text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Connection: close
Sat May 27 11:50:31 2023:
slow HTTP test status on 5th second:

initializing:        0
pending:             6
connected:           193
error:               0
closed:              11
service available:   YES
Sat May 27 11:50:32 2023:run_test: socket 75 replied 147 bytes:
HTTP/1.1 503 Service Unavailable
Date: Sat, 27 May 2023 18:50:32 GMT
Content-Length: 0
Connection: close
x-amz-request-id: D089F0EFCC0BF7C6

Sat May 27 11:50:32 2023:run_test: socket 75 closed: Peer closed connection

Sat May 27 11:50:36 2023:
slow HTTP test status on 10th second:

initializing:        0
pending:             6
connected:           190
error:               0
closed:              212
service available:   YES

This is the graph:
Screenshot 2023-05-27 at 12 05 18 PM

This is the csv data:
Screenshot 2023-05-27 at 12 06 20 PM

You can see that second 6, when that socket was closed due 503, is shown as Service Available.

@shekyan
Copy link
Owner

shekyan commented May 31, 2023

The tool doesn't account for intermediaries (load balancers), and as long as new connection can be established and there is a response coming back - tool considers the service alive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants