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.

6.4 KB
Raw Blame
package opensuite.proxy;

/**
 * The page the proxy serves at {@code http://opensuite/}: what the built-in
 * browser opens on. A banner with the name and one button, then four columns
 * that each lead somewhere: the documentation, the latest release, the issue
 * list and the source. The CA certificate, which another browser needs, is a
 * link at the foot. One self-contained page: no script, image or font is
 * fetched from anywhere, so opening it puts nothing in the proxy history.
 */
final class StartPage {
    private StartPage() {}

    private static final String HOME = "https://github.com/scottsturrock/open-suite";

    /** The two-tone cloud of the application icon, drawn for a dark ground. */
    private static final String LOGO =
            "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' role='img' aria-label='Open Suite'>"
            + "<defs><g id='c' transform='translate(0 2.5)'><circle cx='92' cy='248' r='62'/><circle cx='142' cy='190' r='58'/>"
            + "<circle cx='211' cy='180' r='95'/><circle cx='300' cy='241' r='69'/><rect x='92' y='200' width='208' height='110'/></g>"
            + "<clipPath id='l'><rect x='0' y='0' width='140' height='400'/></clipPath>"
            + "<clipPath id='r'><rect x='152' y='0' width='248' height='400'/></clipPath></defs>"
            + "<use href='#c' fill='#E4E4E7' clip-path='url(#l)'/><use href='#c' fill='#EC673A' clip-path='url(#r)'/></svg>";

    static String html(int port, String caPem) {
        StringBuilder b = new StringBuilder(8192);
        b.append("<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><title>Open Suite</title>")
         .append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><style>")
         .append("*{box-sizing:border-box}html,body{margin:0}")
         .append("body{font:16px/1.6 system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;color:#1c2733;background:#F0F5FC;")
         .append("min-height:100vh;display:flex;flex-direction:column}")
         // The banner: a dark ground with a warm glow at the top and a few faint lines across it.
         .append(".hero{position:relative;overflow:hidden;background:#0B0B1E;color:#fff;padding:64px 40px 150px;")
         .append("background-image:radial-gradient(45% 60% at 50% 0%,rgba(236,103,58,.20),transparent 70%)}")
         .append(".hero svg.lines{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}")
         .append(".in{position:relative;max-width:1180px;margin:0 auto;display:flex;gap:32px;align-items:flex-start}")
         .append(".mark{flex:none;width:84px;height:84px;margin-top:14px;border-radius:16px;background:#17172C;border:1px solid rgba(236,103,58,.55);")
         .append("box-shadow:0 0 22px rgba(236,103,58,.35);display:flex;align-items:center;justify-content:center}.mark svg{width:60px;height:60px}")
         .append("h1{font-size:88px;line-height:1.1;margin:0;font-weight:800;letter-spacing:-2.5px;white-space:nowrap}h1 span{color:#F26B3A}")
         .append(".lead{font-size:28px;line-height:1.4;color:#E6E6EE;max-width:740px;margin:26px 0 0}")
         .append(".note{font:15px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:#C9C9D6;margin:22px 0 0}")
         .append("a.btn{display:inline-block;font-weight:700;color:#fff;background:#F26B3A;text-decoration:none;border-radius:3px}")
         .append("a.btn:hover{background:#DB612F}.hero a.btn{font-size:18px;padding:18px 36px;margin-top:36px}")
         .append(".cols{flex:1;display:grid;grid-template-columns:repeat(4,1fr);gap:40px;padding:76px 40px 40px}")
         .append(".cols h2{font-size:21px;margin:0 0 12px;color:#0B0B1E}.cols p{margin:0 0 24px;color:#4A5563;min-height:78px}")
         .append(".cols a.btn{font-size:15px;padding:11px 20px}")
         .append("footer{text-align:center;padding:26px 40px 22px;font-size:13px}footer a{color:#1c2733}")
         .append("@media(max-width:1300px){h1{font-size:56px;letter-spacing:-1.5px;white-space:normal}.lead{font-size:22px}.cols{grid-template-columns:repeat(2,1fr)}.cols p{min-height:0}}")
         .append("@media(max-width:640px){.in{flex-direction:column}h1{font-size:44px}.cols{grid-template-columns:1fr}}")
         .append("</style></head><body>");
        b.append("<div class=\"hero\">")
         .append("<svg class=\"lines\" viewBox=\"0 0 1900 620\" preserveAspectRatio=\"xMidYMid slice\" fill=\"none\" stroke=\"#F26B3A\" stroke-opacity=\".13\" stroke-width=\"2\">")
         .append("<path d=\"M-40 560 L420 40 L900 40\"/><path d=\"M300 620 L640 250 L1500 250 L1500 620\"/><path d=\"M1180 620 L1620 90 L1960 90\"/><path d=\"M1700 300 L1960 20\"/></svg>")
         .append("<div class=\"in\"><div class=\"mark\">").append(LOGO).append("</div><div>")
         .append("<h1>Open Suite, <span>open source.</span></h1>")
         .append("<p class=\"lead\">A complete toolkit for web security testing, free for everyone: proxy, repeater, intruder, scanner and more in one application.</p>")
         .append("<p class=\"note\">Free to use, study and change.</p>")
         .append("<a class=\"btn\" href=\"").append(HOME).append("\">Learn more</a>")
         .append("</div></div></div>");
        b.append("<div class=\"cols\">");
        column(b, "Documentation", "Learn what each tool does and how to use it, with the guide that is kept up to date with every release.",
                "Read the documentation", HOME + "#readme");
        column(b, "Latest release", "See what is new in Open Suite and download the newest version for your machine.",
                "Get the latest release", HOME + "/releases/latest");
        column(b, "Report a problem", "Found a fault, or missing something you need? Tell us about it and follow its progress.",
                "Open an issue", HOME + "/issues");
        column(b, "Source code", "Open Suite is developed in the open. Read the code, build it yourself, or help to improve it.",
                "View the source", HOME);
        b.append("</div>");
        b.append("<footer><a href=\"/cert/download\">Open Suite CA certificate</a></footer>");
        b.append("</body></html>");
        return b.toString();
    }

    private static void column(StringBuilder b, String title, String text, String button, String link) {
        b.append("<div><h2>").append(title).append("</h2><p>").append(text).append("</p>")
         .append("<a class=\"btn\" href=\"").append(link).append("\">").append(button).append("</a></div>");
    }
}