From 15f8e2007ef6a97523b7de31f42cacde5649bb8c Mon Sep 17 00:00:00 2001 From: thort Date: Thu, 12 Sep 2024 15:50:41 +0200 Subject: [PATCH 1/3] increase SerialVersion --- BappManifest.bmf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BappManifest.bmf b/BappManifest.bmf index 5f75984..25e0b18 100644 --- a/BappManifest.bmf +++ b/BappManifest.bmf @@ -3,7 +3,7 @@ ExtensionType: 1 Name: SAML Raider RepoName: saml-raider ScreenVersion: 2.0.1 -SerialVersion: 15 +SerialVersion: 16 MinPlatformVersion: 0 ProOnly: False Author: Roland Bischofberger / Emanuel Duss / Tobias Hort-Giess From 456ee543228ffe05d892ce3957eb9e3410c6ae76 Mon Sep 17 00:00:00 2001 From: thort Date: Thu, 12 Sep 2024 15:51:54 +0200 Subject: [PATCH 2/3] remove problematic code --- src/main/java/gui/CertificateTab.java | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/main/java/gui/CertificateTab.java b/src/main/java/gui/CertificateTab.java index f49b742..7b2042f 100644 --- a/src/main/java/gui/CertificateTab.java +++ b/src/main/java/gui/CertificateTab.java @@ -1,10 +1,8 @@ package gui; -import burp.BurpExtender; -import javax.swing.tree.TreeSelectionModel; -import model.BurpCertificateBuilder; import application.CertificateTabController; import model.BurpCertificate; +import model.BurpCertificateBuilder; import model.ObjectIdentifier; import net.miginfocom.swing.MigLayout; @@ -13,6 +11,7 @@ import javax.swing.event.TreeSelectionListener; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreeSelectionModel; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -500,19 +499,6 @@ public void actionPerformed(ActionEvent e) { this.setLayout(new MigLayout()); this.add(topPanel, "wrap"); this.add(scrollableBottomPanel, "width 100%"); - - // In the default look and feel the JTree component does not render correctly. - // Icons are missing and tree notes are not correctly indented. - // This workaround should changes the look and feel of the JTree only. - // https://forum.portswigger.net/thread/jtree-not-rendering-correctly-with-burpsuite-s-look-and-feel-2a164857?CategoryId=bug-reports - try { - var lookAndFeel = UIManager.getLookAndFeel(); - UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); - SwingUtilities.updateComponentTreeUI(certificateTree); - UIManager.setLookAndFeel(lookAndFeel); - } catch (Exception exc) { - BurpExtender.api.logging().logToError(exc); - } } public void setCertificateTabController(CertificateTabController certificateTabController) { From 9361a96d9a6263d3dca7f4f0709ccfb80f35e6ca Mon Sep 17 00:00:00 2001 From: thort Date: Thu, 12 Sep 2024 17:01:24 +0200 Subject: [PATCH 3/3] Fix JTree rendering There is still a problem when loading the extension in debug mode with certificates pre-imported, or when changing the color scheme of burpsuite from dark to light or vice versa. Then the JTree rendering is corrupted. --- BappManifest.bmf | 4 +-- README.md | 2 +- build.gradle | 2 +- src/main/java/gui/CertificateTab.java | 37 +++++++++++++++++++-------- 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/BappManifest.bmf b/BappManifest.bmf index 25e0b18..46355a6 100644 --- a/BappManifest.bmf +++ b/BappManifest.bmf @@ -2,12 +2,12 @@ Uuid: c61cfa893bb14db4b01775554f7b802e ExtensionType: 1 Name: SAML Raider RepoName: saml-raider -ScreenVersion: 2.0.1 +ScreenVersion: 2.0.2 SerialVersion: 16 MinPlatformVersion: 0 ProOnly: False Author: Roland Bischofberger / Emanuel Duss / Tobias Hort-Giess ShortDescription: Provides a SAML message editor and a certificate management tool to help with testing SAML infrastructures. -EntryPoint: build/libs/saml-raider-2.0.1.jar +EntryPoint: build/libs/saml-raider-2.0.2.jar BuildCommand: ./gradlew jar SupportedProducts: Pro, Community diff --git a/README.md b/README.md index e9917de..e4f5694 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Don't forget to rate our extension with as many stars you like :smile:. ### Manual Installation First, download the latest SAML Raider version: -[saml-raider-2.0.1.jar](https://github.com/SAMLRaider/SAMLRaider/releases/download/v2.0.1/saml-raider-2.0.1.jar). +[saml-raider-2.0.2.jar](https://github.com/SAMLRaider/SAMLRaider/releases/download/v2.0.2/saml-raider-2.0.2.jar). Then, start Burp Suite and click in the `Extensions` tab on `Add`. Choose the SAML Raider JAR file to install it and you are ready to go. diff --git a/build.gradle b/build.gradle index 006deea..f5f5223 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id "java-library" } -version = "2.0.1" +version = "2.0.2" repositories { mavenCentral() diff --git a/src/main/java/gui/CertificateTab.java b/src/main/java/gui/CertificateTab.java index 7b2042f..595dc89 100644 --- a/src/main/java/gui/CertificateTab.java +++ b/src/main/java/gui/CertificateTab.java @@ -7,8 +7,6 @@ import net.miginfocom.swing.MigLayout; import javax.swing.*; -import javax.swing.event.TreeSelectionEvent; -import javax.swing.event.TreeSelectionListener; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeSelectionModel; @@ -149,16 +147,34 @@ public void actionPerformed(ActionEvent e) { certificateTreeModel = new DefaultTreeModel(new DefaultMutableTreeNode("root")); certificateTree = new JTree(certificateTreeModel); certificateTree.setRootVisible(false); + certificateTree.setShowsRootHandles(true); + certificateTree.setCellRenderer((tree, value, selected, expanded, leaf, row, hasFocus) -> { + var label = new JLabel(); + label.setText(value.toString()); + if (leaf) { + label.setIcon(UIManager.getIcon("Tree.leafIcon")); + } else if (expanded) { + label.setIcon(UIManager.getIcon("Tree.openIcon")); + } else { + label.setIcon(UIManager.getIcon("Tree.closedIcon")); + } + if (selected) { + label.setForeground(UIManager.getColor("Tree.selectionForeground")); + label.setBackground(UIManager.getColor("Tree.selectionBackground")); + } else { + label.setForeground(UIManager.getColor("Tree.textForeground")); + label.setBackground(UIManager.getColor("Tree.textBackground")); + } + return label; + }); certificateTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); - certificateTree.addTreeSelectionListener(new TreeSelectionListener() { - public void valueChanged(TreeSelectionEvent e) { - DefaultMutableTreeNode node = (DefaultMutableTreeNode) certificateTree.getLastSelectedPathComponent(); - if (node == null || node.getUserObject() instanceof String) { - return; - } - BurpCertificate burpCertificate = (BurpCertificate) node.getUserObject(); - certificateTabController.setCertificateDetails(burpCertificate); + certificateTree.addTreeSelectionListener(event -> { + DefaultMutableTreeNode node = (DefaultMutableTreeNode) certificateTree.getLastSelectedPathComponent(); + if (node == null || node.getUserObject() instanceof String) { + return; } + BurpCertificate burpCertificate = (BurpCertificate) node.getUserObject(); + certificateTabController.setCertificateDetails(burpCertificate); }); txtStatus = new JTextPane(); @@ -749,7 +765,6 @@ public boolean isAutoSubjectKeyIdentifier() { public void setCertificateRootNode(DefaultMutableTreeNode rootNode) { this.certificateTreeModel.setRoot(rootNode); - certificateTree.setModel(certificateTreeModel); } public void setAllExtensions(List allExtensions) {