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.testkit;
import java.util.HashMap;
import java.util.Map;
import java.util.prefs.AbstractPreferences;
import java.util.prefs.Preferences;
import java.util.prefs.PreferencesFactory;
/**
* Preferences held in memory for the length of a test run, named by test.sh
* through java.util.prefs.PreferencesFactory. Nothing a test sets reaches the
* preferences of the person running them, on any system: macOS keeps
* preferences in a plist of its own that a preferences root folder does not move.
*/
public final class MemoryPreferences implements PreferencesFactory {
private static final Preferences USER = new Node(null, ""), SYSTEM = new Node(null, "");
@Override public Preferences userRoot() { return USER; }
@Override public Preferences systemRoot() { return SYSTEM; }
private static final class Node extends AbstractPreferences {
private final Map<String, String> values = new HashMap<>();
private final Map<String, Node> children = new HashMap<>();
Node(Node parent, String name) { super(parent, name); }
@Override protected void putSpi(String key, String value) { values.put(key, value); }
@Override protected String getSpi(String key) { return values.get(key); }
@Override protected void removeSpi(String key) { values.remove(key); }
@Override protected void removeNodeSpi() { if (parent() instanceof Node p) p.children.remove(name()); }
@Override protected String[] keysSpi() { return values.keySet().toArray(new String[0]); }
@Override protected String[] childrenNamesSpi() { return children.keySet().toArray(new String[0]); }
@Override protected AbstractPreferences childSpi(String name) { return children.computeIfAbsent(name, n -> new Node(this, n)); }
@Override protected void syncSpi() { }
@Override protected void flushSpi() { }
}
}