shekyan / slowhttptest

Application Layer DoS attack simulator
Apache License 2.0
1.51k stars 303 forks source link

How to access the reports #52

Open takearun opened 6 years ago

takearun commented 6 years ago

Hi, I used the docker build to build the image and I was able to run it like this,

docker run slowhttptest:latest -c 100 -H -g -i 10 -r 20 -t GET -u https://localhost/api/resources/365037?api-key=1234 -p 10

It seemed to have ran fine and I got this output,

slow HTTP test status on 240th second:

initializing: 0 pending: 0 connected: 100 error: 0 closed: 0 service available: YES Fri Nov 16 13:48:33 2018: Test ended on 241th second Exit status: Hit test time limit CSV report saved to slow_2018-11-16_13-44-32.csv HTML report saved to slow_2018-11-16_13-44-32.html

Now where are the csv and html files stored?

Thanks, Arun

jessforrest commented 5 years ago

Was wondering the same. I'm starting to think it's impossible.

Googolaire commented 4 years ago

on a unix computer you could use a grep command, on windows you should download search everything.

maikthulhu commented 3 years ago

Since slowhttptest saves files to the current directory and doesn't have a way to specify an output folder or name output files, you can accomplish this by creating a bind mount between the host and container, and telling docker where to set the working directory when it starts. I'm an idiot.

Here's one way to do it.

user@host:~$ mkdir output
user@host:~$ sudo docker run -v /home/user/output:/output -w /output shekyan/slowhttptest:latest -c 100 -H -g -i 10 -r 20 -t GET -u https://localhost/api/resources/365037?api-key=1234 -p 10
... wait ...
user@host:~$ ls -l output/
total 8
-rw-r--r-- 1 root    root     485 Oct  6 19:05 slow_2021-10-06_19-04-54.csv
-rw-r--r-- 1 root    root    2861 Oct  6 19:05 slow_2021-10-06_19-04-54.html

Here's another way.

user@host:~$ mkdir output
user@host:~$ sudo docker run -v /home/user/output:/output shekyan/slowhttptest:latest -c 100 -H -g -i 10 -r 20 -t GET -u https://localhost/api/resources/365037?api-key=1234 -p 10 -o /output/my_results
... wait ...
user@host:~$ ls -l output/
total 8
-rw-r--r-- 1 root root  485 Oct  6 19:33 my_results.csv
-rw-r--r-- 1 root root 2861 Oct  6 19:33 my_results.html
springleo commented 1 year ago

you can start the container in daemon mode, attach to this container, run the test (which generates csv/html), exit the container and copy them back to host.

docker run -d -it --entrypoint sh <image_id>
docker exec -it <container_id> sh
#now we are inside the container, at its CLI prompt
#slowhttptest execution
exit
docker cp <container_id>:my*.html .