我对ZAP插件有疑问,
我的问题是如何用我的参数配置构建,如何配置jenkins参数,不用selenium测试,
我的参数是,(windows)
感谢您的快速回答。
最后一个问题是如何在ZAP攻击期间运行SELENIUM TEST时配置构建。
非常感谢,并帮助我。
答案 0 :(得分:0)
我需要Windows批处理命令来启动firefox,zap和启动zap扫描程序
带参数认证登录界面
答案 1 :(得分:0)
您需要创建Java场景并通过ZAP代理运行。
Java样本(样本来自NoraUI POC):
/**
* NoraUi is licensed under the license GNU AFFERO GENERAL PUBLIC LICENSE
*
* @author Nicolas HALLOUIN
* @author Stéphane GRILLON
*/
package com.github.noraui.bot;
import java.io.File;
import org.openqa.selenium.By;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.noraui.utils.Utilities.OperatingSystem;
import com.github.noraui.utils.Utilities.SystemArchitecture;
public class FirstSimpleBotWithZAPProxy {
private static final Logger logger = LoggerFactory.getLogger(FirstSimpleBotWithZAPProxy.class);
public static void main(String[] args) throws InterruptedException {
Proxy proxy = new Proxy();
proxy.setAutodetect(false);
proxy.setHttpProxy("http://localhost:8092");
final OperatingSystem currentOperatingSystem = OperatingSystem.getCurrentOperatingSystem();
String pathWebdriver = String.format("src/test/resources/drivers/%s/googlechrome/%s/chromedriver%s", currentOperatingSystem.getOperatingSystemDir(),
SystemArchitecture.getCurrentSystemArchitecture().getSystemArchitectureName(), currentOperatingSystem.getSuffixBinary());
if (!new File(pathWebdriver).setExecutable(true)) {
logger.error("ERROR when change setExecutable on " + pathWebdriver);
}
System.setProperty("webdriver.chrome.driver", pathWebdriver);
final ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setProxy(proxy);
WebDriver driver = new ChromeDriver(chromeOptions);
for (int i = 0; i < 6; i++) {
driver.get("http://www.google.com/ncr");
WebElement element = driver.findElement(By.name("q"));
element.sendKeys("NoraUi");
element.submit();
logger.info(driver.getTitle());
WebElement r = driver.findElement(By.xpath("//*[@id='resultStats']"));
logger.info(r.getText());
}
driver.quit();
}
}
ZAP结果: