From ba00c2e10367c18dff908f485cbade2cff8f6cc4 Mon Sep 17 00:00:00 2001 From: Martin Hoffmann Date: Thu, 26 Nov 2015 10:49:54 +0100 Subject: [PATCH 1/4] Set methods to public protected HttpSessionsSite getHttpSessionsSite(String site) protected HttpSessionsSite getHttpSessionsSite(String site, boolean createIfNeeded) --- .../zap/extension/httpsessions/ExtensionHttpSessions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/zaproxy/zap/extension/httpsessions/ExtensionHttpSessions.java b/src/org/zaproxy/zap/extension/httpsessions/ExtensionHttpSessions.java index 77e7d5b613e..3df80b86c2d 100644 --- a/src/org/zaproxy/zap/extension/httpsessions/ExtensionHttpSessions.java +++ b/src/org/zaproxy/zap/extension/httpsessions/ExtensionHttpSessions.java @@ -450,7 +450,7 @@ protected HttpSessionsPanel getHttpSessionsPanel() { * missing, a default protocol of 80 is used. * @return the http sessions site container */ - protected HttpSessionsSite getHttpSessionsSite(String site) { + public HttpSessionsSite getHttpSessionsSite(String site) { return getHttpSessionsSite(site, true); } @@ -467,7 +467,7 @@ protected HttpSessionsSite getHttpSessionsSite(String site) { * false * */ - protected HttpSessionsSite getHttpSessionsSite(String site, boolean createIfNeeded) { + public HttpSessionsSite getHttpSessionsSite(String site, boolean createIfNeeded) { // Add a default port if (!site.contains(":")) { site = site + (":80"); From 8d48aaf162bbb74315a836c961c35b9f29416471 Mon Sep 17 00:00:00 2001 From: Martin Hoffmann Date: Thu, 26 Nov 2015 10:57:37 +0100 Subject: [PATCH 2/4] Set methods to public protected Set getHttpSessions() protected HttpSession getHttpSession(String name) --- .../zaproxy/zap/extension/httpsessions/HttpSessionsSite.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/zaproxy/zap/extension/httpsessions/HttpSessionsSite.java b/src/org/zaproxy/zap/extension/httpsessions/HttpSessionsSite.java index 1ea737c596f..17c2a218378 100644 --- a/src/org/zaproxy/zap/extension/httpsessions/HttpSessionsSite.java +++ b/src/org/zaproxy/zap/extension/httpsessions/HttpSessionsSite.java @@ -567,7 +567,7 @@ protected void cleanupSessionToken(String token) { * * @return the http sessions */ - protected Set getHttpSessions() { + public Set getHttpSessions() { synchronized (this.sessions) { return Collections.unmodifiableSet(sessions); } @@ -579,7 +579,7 @@ protected Set getHttpSessions() { * @param name the name * @return the http session with a given name, or null, if no such session exists */ - protected HttpSession getHttpSession(String name) { + public HttpSession getHttpSession(String name) { synchronized (this.sessions) { for (HttpSession session : sessions) { if (session.getName().equals(name)) { From ae42491296dde065832b2047ad82f4b2761efede Mon Sep 17 00:00:00 2001 From: Martin Hoffmann Date: Thu, 26 Nov 2015 14:39:59 +0100 Subject: [PATCH 3/4] Method to access the next unique Session ID Required for script development --- .../zaproxy/zap/extension/httpsessions/HttpSessionsSite.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/org/zaproxy/zap/extension/httpsessions/HttpSessionsSite.java b/src/org/zaproxy/zap/extension/httpsessions/HttpSessionsSite.java index 17c2a218378..46ddd0bf652 100644 --- a/src/org/zaproxy/zap/extension/httpsessions/HttpSessionsSite.java +++ b/src/org/zaproxy/zap/extension/httpsessions/HttpSessionsSite.java @@ -626,4 +626,8 @@ public boolean renameHttpSession(String oldName, String newName) { static void resetLastGeneratedSessionId() { lastGeneratedSessionID = 0; } + + public static int getNextSessionId() { + return lastGeneratedSessionID++; + } } From 59d76ba3234ff6d5ba77815065ac581aa0337b70 Mon Sep 17 00:00:00 2001 From: Martin Hoffmann Date: Wed, 20 Jan 2016 15:14:57 +0100 Subject: [PATCH 4/4] Count Messages for Spider and Active Scanner --- .../zap/extension/httpsessions/ExtensionHttpSessions.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/org/zaproxy/zap/extension/httpsessions/ExtensionHttpSessions.java b/src/org/zaproxy/zap/extension/httpsessions/ExtensionHttpSessions.java index 3df80b86c2d..8993f5c3da9 100644 --- a/src/org/zaproxy/zap/extension/httpsessions/ExtensionHttpSessions.java +++ b/src/org/zaproxy/zap/extension/httpsessions/ExtensionHttpSessions.java @@ -607,8 +607,7 @@ public void onHttpRequestSend(HttpMessage msg, int initiator, HttpSender sender) @Override public void onHttpResponseReceive(HttpMessage msg, int initiator, HttpSender sender) { - if (initiator == HttpSender.ACTIVE_SCANNER_INITIATOR || initiator == HttpSender.SPIDER_INITIATOR - || initiator == HttpSender.CHECK_FOR_UPDATES_INITIATOR) { + if (initiator == HttpSender.CHECK_FOR_UPDATES_INITIATOR) { // Not a session we care about return; }