Skip to content

Commit e7ac1ab

Browse files
authored
Proxy Settings added to OWASP Benchmark Crawler to enable different hosts (OWASP-Benchmark#1)
1 parent 8d4fcf9 commit e7ac1ab

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

runCrawler.bat

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1-
# source "scripts/verifyBenchmarkPluginAvailable.sh" - Don't have .bat version of this (yet)
2-
CALL mvn org.owasp:benchmarkutils-maven-plugin:run-crawler -DcrawlerFile=data/benchmark-crawler-http.xml
3-
1+
@echo off
2+
REM source "scripts/verifyBenchmarkPluginAvailable.sh" - Don't have .bat version of this (yet)
3+
set /A args_count=0
4+
for %%A in (%*) do set /A args_count+=1
5+
if %args_count% NEQ 0 (
6+
if %args_count% EQU 2 (
7+
CALL mvn org.owasp:benchmarkutils-maven-plugin:run-crawler -DcrawlerFile=data/benchmark-crawler-http.xml -DproxyHost="%1" -DproxyPort="%2"
8+
) else (
9+
echo Error!!
10+
echo -------
11+
echo To run the Crawler for localhost, execute runCrawler.bat with no arguments.
12+
echo To run the Crawler for remote host, execute runCrawler.bat with only 2 arguments, proxy-host and proxy-port.
13+
echo Example: runCrawler.bat 192.168.0.1 53452
14+
)
15+
) else (
16+
CALL mvn org.owasp:benchmarkutils-maven-plugin:run-crawler -DcrawlerFile=data/benchmark-crawler-http.xml
17+
)

runCrawler.sh

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
#!/bin/sh
12
source "scripts/verifyBenchmarkPluginAvailable.sh"
2-
mvn org.owasp:benchmarkutils-maven-plugin:run-crawler -DcrawlerFile=data/benchmark-crawler-http.xml
3-
3+
if [ $# -eq 2 ]; then
4+
mvn org.owasp:benchmarkutils-maven-plugin:run-crawler -DcrawlerFile=data/benchmark-crawler-http.xml -DproxyHost="$1" -DproxyPort="$2"
5+
elif [ $# -eq 0 ]; then
6+
mvn org.owasp:benchmarkutils-maven-plugin:run-crawler -DcrawlerFile=data/benchmark-crawler-http.xml
7+
else
8+
echo "Error!!"
9+
echo "-------"
10+
echo "To run the Crawler for localhost, execute runCrawler.sh with no arguments."
11+
echo "To run the Crawler for remote host, execute runCrawler.sh with only 2 arguments, proxy-host and proxy-port."
12+
echo "Example: ./runCrawler.sh 192.168.0.1 53452"
13+
fi

0 commit comments

Comments
 (0)