A free, open-source alternative to Burp Suite: an intercepting proxy and web app security testing suite with Repeater, Intruder, Collaborator and a built-in OWASP ZAP scanner. Linux, AGPL-3.0.
Java application-securityappsecbug-bountyburp-alternativeburp-suitedasthttp-proxyinfosecintercepting-proxyjavaowaspowasp-zappenetration-testingpentestingsecuritysecurity-toolsvulnerability-scannerweb-application-securityweb-security
package opensuite.extensions;
import opensuite.script.ScriptCompiler;
import opensuite.testkit.Expect;
import opensuite.testkit.Harness;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import javax.swing.SwingUtilities;
import javax.tools.ToolProvider;
/** The script library opens a named custom action, and Check lists its compile errors in place. */
public final class ScriptLibraryCheckTest {
public void run() {
Harness.suite("script library check");
Harness.test("reveal opens a script, and Check lists its errors", () -> {
String home = System.getProperty("user.home");
try {
Path tmp = Files.createTempDirectory("opensuite-library");
System.setProperty("user.home", tmp.toString());
Path dir = Files.createDirectories(ScriptLibraryPanel.root().resolve("custom-action"));
Files.writeString(dir.resolve("Bad.java"), "utilities.lg(1);\n");
Files.writeString(dir.resolve("Good.java"), "utilities.log(1);\n");
Object[] got = new Object[2];
SwingUtilities.invokeAndWait(() -> {
ScriptCompiler c = new ScriptCompiler(ToolProvider.getSystemJavaCompiler());
ScriptLibraryPanel p = new ScriptLibraryPanel(null, "t", "b", "e", "x",
source -> c.compileCustomAction(source).errors());
p.reveal("Bad");
got[0] = p.checkNow();
p.reveal("Good");
got[1] = p.checkNow();
});
@SuppressWarnings("unchecked") List<String> bad = (List<String>) got[0];
Expect.equal(bad.size(), 1, "one error: " + bad);
Expect.isTrue(bad.get(0).startsWith("line 1:"), "at line 1: " + bad);
Expect.equal(got[1], List.of(), "a clean script");
} catch (Exception e) {
throw new AssertionError(e);
} finally {
System.setProperty("user.home", home);
}
});
}
}