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.1 KB
Raw Blame
package opensuite.ui;

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

/** A finding's evidence is found in the message as sent and as the Pretty view lays it out. */
public final class EvidenceMarkTest {
    public void run() {
        Harness.suite("evidence marks");

        Harness.test("evidence is found as it stands and when pretty printing has spread it out", () -> {
            String evidence = "</p><scrIpt>alert(1);</scRipt><p>";
            Expect.isTrue(MessageEditor.loose(evidence).matcher("<h1>x</h1><p></p><scrIpt>alert(1);</scRipt><p></p>").find(), "in the raw text");
            Expect.isTrue(MessageEditor.loose(evidence).matcher("<p>\n    </p>\n    <scrIpt>\n      alert(1);\n    </scRipt>\n    <p>").find(), "in the pretty text");
            Expect.isTrue(!MessageEditor.loose(evidence).matcher("<script>alert(2);</script>").find(), "and not where it is not");
            Expect.isTrue(MessageEditor.loose("a.b(c)").matcher("xa.b(c)x").find() && !MessageEditor.loose("a.b").matcher("axb").find(), "its characters are taken literally");
        });
    }
}