This was originally a Benchmarking Vulnerability Detection Tools for Web Services available in Nuno Antunes' github repository. For more details please check out the github previously mentioned.
Some changes were made in order to make this project a RESTFull API for futher testing with bBOXRT tool. TPC-W, TPC-APP and TPC-C will be use with these new changes.
This changed version enable all operations to be done using REST services, these services will be tested with bBOXRT tool and specify with a OpenAPI (Swagger) document.
First of all the code changed is optimize with queries for PostgreSQL and this tutorial will describe the steps to run in Tomcat Web Server.
You can change the queries, for other SQL engines, in the files available in wsvd-Rest/src/main/java/pt/uc/dei/wsvdbench/tpcw/versions/ folder.
In data folder is available a tpc.dump file, it is a script to fill a PostgreSQL database. You can do that with this command:
-
Command:
sudo psql -h hostIPaddress -U userName -d databaseName -f /path/to/tpc.dump- Example:
sudo psql -h localhost -U postgres -d wsvd -f ~/Documents/tpc.dump
- Example:
- In
wsvd-Rest/src/main/java/pt/uc/dei/wsvdbench/util/folder you must configure the class Database.java according to the database and configuration used in the first step.
| variable | description |
|---|---|
server |
IP address where postgres' server is running (if local then "localhost") |
post |
Port number of postgres' server is running (default value for postgres is 5432) |
dbName |
Database's name created. |
userName |
User name where database was created in postgres. |
passwd |
Password to the user with username where database was created in postgres. |
For tomcat we will need postgresql driver in order to communicate with the database and postgres server.
-
In
jarNeededfolder is postgresql-42.2.22.jar, this jar file needs to be in tomcat'slibfolder.-
To find where your tomcat is located you can run something like this:
sudo find / -name "tomcat". Mine is in/opt/tomcat/folder. -
postgresql-42.2.22.jar file should be located in
/path/to/tomcat/libfolder. Example according to my tomcat's path/opt/tomcat/lib.
-
-
For TPC-C and TPC-W just go to their folders (
~/wsvd-Rest/TPCCand~/wsvd-Rest/TPCW), where the pom.xml file is located, and build the .war package by running the following command:mvn installormvn package
-
For TPC-APP will be needed two commands, the first one is to install dependencies. There is a file with the name install.sh to help, located in
~/wsvd-Rest/wsvd-tpcapp/installInMavenand run the following command:./install.sh
After that go to wsvd-tpcapp folder:
cd ~/wsvd-Rest/wsvd-tpcapp
Finnaly build the .war package by running the following command:
mvn installormvn package
The .war package will be located in target folder.
-
Copy the .war package gotten in step 5 to Tomcat
webappsfolder.- Example of
webappsfolder path:/opt/tomcat/webapps
- Example of
-
Restart Tomcat server. This command change from OS to OS but should look something like this:
sudo service tomcat restart