Skip to content

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.

1.4 KB
Raw Blame
package opensuite.proxy;

import opensuite.testkit.Expect;
import opensuite.testkit.Harness;

/** The page at http://opensuite/: the built-in browser's start page and the place the CA certificate is fetched from. */
public final class StartPageTest {
    public void run() {
        Harness.suite("start page");

        Harness.test("it is a banner, four columns that each lead somewhere, and the certificate at the foot", () -> {
            String html = StartPage.html(8085, "x");
            Expect.isTrue(html.contains("<h1>Open Suite, <span>open source.</span></h1>"), "the name in the banner");
            Expect.equal(html.split("<h2>").length - 1, 4, "four columns");
            Expect.equal(html.split("class=\"btn\"").length - 1, 5, "one button in the banner and one in each column");
            Expect.isTrue(html.contains("href=\"/cert/download\""), "the certificate link other browsers use");
            Expect.isTrue(!html.contains("<form") && !html.contains("<input") && !html.contains("<script"), "nothing to fill in or run");
        });

        Harness.test("it loads nothing from anywhere else", () -> {
            String html = StartPage.html(8080, "x");
            Expect.isTrue(!html.contains("src=\"http") && !html.contains("url(http") && !html.contains("<link"),
                    "no outside image, script, style or font: opening it adds nothing to the proxy history");
        });
    }
}