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.script;
import opensuite.core.Bytes;
import opensuite.core.HttpMessage;
import opensuite.testkit.Expect;
import opensuite.testkit.Harness;
import java.util.List;
/** The short account of what an action changed in a request. */
public final class RequestDiffTest {
private static HttpMessage m(String s) { return new HttpMessage(Bytes.bytes(s)); }
public void run() {
Harness.suite("request diff");
Harness.test("nothing changed is an empty list", () -> {
Expect.equal(RequestDiff.summarise(m("GET / HTTP/1.1\r\nHost: a\r\n\r\n"), m("GET / HTTP/1.1\r\nHost: a\r\n\r\n")), List.of(), "diff");
});
Harness.test("added, changed and removed headers, then the body", () -> {
HttpMessage before = m("POST /p HTTP/1.1\r\nHost: a\r\nX-Old: 1\r\nX-Ts: 1\r\n\r\nabc");
HttpMessage after = m("POST /p HTTP/1.1\r\nHost: a\r\nx-ts: 2\r\nX-Sig: f\r\n\r\nabcd");
Expect.equal(RequestDiff.summarise(before, after),
List.of("+ X-Sig", "~ x-ts", "- X-Old", "body 3 -> 4 bytes"), "diff");
});
Harness.test("a change to the first header is reported", () -> {
Expect.equal(RequestDiff.summarise(m("GET / HTTP/1.1\r\nHost: a\r\n\r\n"), m("GET / HTTP/1.1\r\nHost: b\r\n\r\n")),
List.of("~ Host"), "diff");
});
Harness.test("a new request line is reported", () -> {
Expect.equal(RequestDiff.summarise(m("GET /a HTTP/1.1\r\nHost: a\r\n\r\n"), m("POST /a HTTP/1.1\r\nHost: a\r\n\r\n")),
List.of("~ request line"), "diff");
});
}
}