├── doc
├── resources
│ ├── tab.gif
│ ├── titlebar.gif
│ ├── background.gif
│ └── titlebar_end.gif
├── package-list
├── burp
│ ├── package-frame.html
│ ├── package-tree.html
│ └── package-summary.html
├── eu
│ └── dety
│ │ └── burp
│ │ └── joseph
│ │ ├── scanner
│ │ ├── package-frame.html
│ │ ├── package-tree.html
│ │ └── package-summary.html
│ │ ├── gui
│ │ ├── editor
│ │ │ ├── package-frame.html
│ │ │ ├── package-summary.html
│ │ │ └── package-tree.html
│ │ ├── table
│ │ │ └── package-frame.html
│ │ └── package-frame.html
│ │ ├── exceptions
│ │ ├── package-frame.html
│ │ ├── package-tree.html
│ │ └── package-summary.html
│ │ ├── editor
│ │ ├── package-frame.html
│ │ └── package-summary.html
│ │ ├── package-frame.html
│ │ ├── attacks
│ │ ├── KeyConfusion
│ │ │ └── package-frame.html
│ │ ├── __AttackTemplate
│ │ │ └── package-frame.html
│ │ ├── __attack_template
│ │ │ └── package-frame.html
│ │ ├── SignatureExclusion
│ │ │ └── package-frame.html
│ │ ├── key_confusion
│ │ │ └── package-frame.html
│ │ ├── signature_exclusion
│ │ │ └── package-frame.html
│ │ ├── package-frame.html
│ │ ├── BleichenbacherPkcs1
│ │ │ ├── gui
│ │ │ │ └── package-frame.html
│ │ │ └── package-frame.html
│ │ └── bleichenbacher_pkcs1
│ │ │ ├── gui
│ │ │ └── package-frame.html
│ │ │ └── package-frame.html
│ │ ├── utilities
│ │ └── package-frame.html
│ │ ├── package-tree.html
│ │ └── package-summary.html
├── overview-frame.html
├── index.html
├── deprecated-list.html
└── constant-values.html
├── .gitignore
├── .travis.yml
├── nbactions.xml
├── CHANGELOG
├── license_header.txt
├── src
├── main
│ └── java
│ │ ├── eu
│ │ └── dety
│ │ │ └── burp
│ │ │ └── joseph
│ │ │ ├── attacks
│ │ │ ├── IAttack.java
│ │ │ ├── AttackPreparationFailedException.java
│ │ │ ├── bleichenbacher_pkcs1
│ │ │ │ ├── Interval.java
│ │ │ │ ├── BleichenbacherPkcs1AttackRequest.java
│ │ │ │ ├── BleichenbacherPkcs1Oracle.java
│ │ │ │ └── gui
│ │ │ │ │ ├── BleichenbacherPkcs1Table.java
│ │ │ │ │ └── BleichenbacherPkcs1TableEntry.java
│ │ │ ├── __attack_template
│ │ │ │ ├── AttackTemplateAttackRequest.java
│ │ │ │ ├── AttackTemplate.java
│ │ │ │ └── AttackTemplateInfo.java
│ │ │ ├── signature_exclusion
│ │ │ │ ├── SignatureExclusionAttackRequest.java
│ │ │ │ └── SignatureExclusion.java
│ │ │ ├── AttackRequest.java
│ │ │ ├── key_confusion
│ │ │ │ ├── KeyConfusionAttackRequest.java
│ │ │ │ └── KeyConfusion.java
│ │ │ ├── AttackLoader.java
│ │ │ └── IAttackInfo.java
│ │ │ ├── utilities
│ │ │ ├── DecryptionFailedException.java
│ │ │ ├── InvalidJoseValueException.java
│ │ │ └── Logger.java
│ │ │ ├── resources
│ │ │ └── JOSEPH.properties
│ │ │ ├── gui
│ │ │ ├── HelpPanel.java
│ │ │ ├── table
│ │ │ │ ├── Table.java
│ │ │ │ ├── TableModel.java
│ │ │ │ └── TableEntry.java
│ │ │ ├── AttackerInfoPanel.form
│ │ │ ├── HelpPanel.form
│ │ │ └── AttackerInfoPanel.java
│ │ │ └── scanner
│ │ │ └── Marker.java
│ │ └── burp
│ │ └── BurpExtender.java
└── test
│ └── java
│ └── eu
│ └── dety
│ └── burp
│ └── joseph
│ ├── BurpParameterMock.java
│ └── attacks
│ └── bleichenbacher_pkcs1
│ └── BleichenbacherPkcs1Test.java
└── README.md
/doc/resources/tab.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RUB-NDS/JOSEPH/HEAD/doc/resources/tab.gif
--------------------------------------------------------------------------------
/doc/resources/titlebar.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RUB-NDS/JOSEPH/HEAD/doc/resources/titlebar.gif
--------------------------------------------------------------------------------
/doc/resources/background.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RUB-NDS/JOSEPH/HEAD/doc/resources/background.gif
--------------------------------------------------------------------------------
/doc/resources/titlebar_end.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RUB-NDS/JOSEPH/HEAD/doc/resources/titlebar_end.gif
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | pom.xml.tag
3 | pom.xml.releaseBackup
4 | pom.xml.versionsBackup
5 | pom.xml.next
6 | release.properties
7 | dependency-reduced-pom.xml
8 | buildNumber.properties
9 | .mvn/timing.properties
10 | .DS_Store
11 | JOSEPH.iml
12 | .project
13 | .settings/
14 | .idea/
15 | .classpath
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 |
3 | os: linux
4 | dist: trusty
5 |
6 | jdk:
7 | - oraclejdk8
8 | - oraclejdk9
9 | - openjdk7
10 | - openjdk8
11 | - openjdk11
12 |
13 | branches:
14 | only:
15 | - master
16 |
17 | notifications:
18 | email:
19 | recipients:
20 | - dennis.detering@rub.de
21 |
--------------------------------------------------------------------------------
/nbactions.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | This program is free software; you can redistribute it and/or modify it under 5 | the terms of the GNU General Public License as published by the Free Software 6 | Foundation; either version 2 of the License, or (at your option) any later 7 | version. 8 |
9 | This program is distributed in the hope that it will be useful, but WITHOUT 10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 12 | details. 13 |
14 | You should have received a copy of the GNU General Public License along with 15 | this program; if not, write to the Free Software Foundation, Inc., 51 16 | Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/scanner/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later 8 | * version. 9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 | * details. 14 | *
15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package eu.dety.burp.joseph.attacks; 20 | 21 | /** 22 | * Interface defining necessary methods for attack classes 23 | * 24 | * @author Dennis Detering 25 | * @version 1.0 26 | */ 27 | public interface IAttack { 28 | /** 29 | * Perform the attack 30 | */ 31 | void performAttack(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/attacks/__AttackTemplate/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later 8 | * version. 9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 | * details. 14 | *
15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package eu.dety.burp.joseph.utilities; 20 | 21 | /** 22 | * DecryptionFailedException 23 | **/ 24 | public class DecryptionFailedException extends Exception { 25 | public DecryptionFailedException() { 26 | } 27 | 28 | public DecryptionFailedException(String message) { 29 | super(message); 30 | } 31 | 32 | public DecryptionFailedException(Throwable cause) { 33 | super(cause); 34 | } 35 | 36 | public DecryptionFailedException(String message, Throwable cause) { 37 | super(message, cause); 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/utilities/InvalidJoseValueException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * JOSEPH - JavaScript Object Signing and Encryption Pentesting Helper 3 | * Copyright (C) 2016 Dennis Detering 4 | *
5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later 8 | * version. 9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 | * details. 14 | *
15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package eu.dety.burp.joseph.utilities; 20 | 21 | /** 22 | * DecryptionFailedException 23 | **/ 24 | public class InvalidJoseValueException extends Exception { 25 | public InvalidJoseValueException() { 26 | } 27 | 28 | public InvalidJoseValueException(String message) { 29 | super(message); 30 | } 31 | 32 | public InvalidJoseValueException(Throwable cause) { 33 | super(cause); 34 | } 35 | 36 | public InvalidJoseValueException(String message, Throwable cause) { 37 | super(message, cause); 38 | } 39 | } -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/attacks/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later 8 | * version. 9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 | * details. 14 | *
15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package eu.dety.burp.joseph.attacks; 20 | 21 | /** 22 | * AttackPreparationFailedException 23 | *
24 | * Throw new exception if the preparation of an {@link eu.dety.burp.joseph.attacks.IAttackInfo} fails. 25 | * 26 | * @author Dennis Detering 27 | * @version 1.0 28 | */ 29 | public class AttackPreparationFailedException extends Exception { 30 | public AttackPreparationFailedException() { 31 | } 32 | 33 | public AttackPreparationFailedException(String message) { 34 | super(message); 35 | } 36 | 37 | public AttackPreparationFailedException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | public AttackPreparationFailedException(String message, Throwable cause) { 42 | super(message, cause); 43 | } 44 | } -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/attacks/BleichenbacherPkcs1/gui/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later 8 | * version. 9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 | * details. 14 | *
15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | /** 21 | * Code taken from WS-Attacker 22 | * @see https://github.com/RUB-NDS/WS-Attacker 23 | * (C) 2013 Dennis Kupser 24 | */ 25 | package eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1; 26 | 27 | import java.math.BigInteger; 28 | 29 | /** 30 | * M interval as mentioned in the Bleichenbacher paper. 31 | * 32 | * @author Christopher Meyer - christopher.meyer@rub.de 33 | * @version 0.1 May 24, 2012 34 | */ 35 | public class Interval { 36 | 37 | public BigInteger lower; 38 | 39 | public BigInteger upper; 40 | 41 | public Interval(BigInteger a, BigInteger b) { 42 | this.lower = a; 43 | this.upper = b; 44 | if (a.compareTo(b) > 0) { 45 | throw new RuntimeException("something went wrong, a cannot be greater than b"); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/gui/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later 8 | * version. 9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 | * details. 14 | *
15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package eu.dety.burp.joseph.attacks.__attack_template; 20 | 21 | import eu.dety.burp.joseph.attacks.AttackRequest; 22 | 23 | /** 24 | * Attack Template Attack Request 25 | * 26 | * @author Dennis Detering 27 | * @version 1.0 28 | */ 29 | public class AttackTemplateAttackRequest extends AttackRequest { 30 | private String payload = null; 31 | 32 | public AttackTemplateAttackRequest(byte[] request, int payloadType, String payload) { 33 | super(request, payloadType); 34 | this.setPayload(payload); 35 | } 36 | 37 | /** 38 | * Get the payload 39 | * 40 | * @return The payload as string 41 | */ 42 | public String getPayload() { 43 | return payload; 44 | } 45 | 46 | /** 47 | * Set the payload 48 | * 49 | * @param payload 50 | * The payload as string 51 | */ 52 | public void setPayload(String payload) { 53 | this.payload = payload; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/resources/JOSEPH.properties: -------------------------------------------------------------------------------- 1 | NAME=JOSEPH 2 | NAME_LONG=JavaScript Object Signing and Encryption Pentesting Helper 3 | NAME_WITH_VERSION=JOSEPH v1.0.3 4 | COPYRIGHT=\u00a9 2016 Dennis Detering 5 | HELP=Help 6 | INFO=Info 7 | REGISTERED_JWSEDITOR=JWS editor registered. 8 | REGISTERED_JWEEDITOR=JWE editor registered. 9 | REGISTERED_MAINTAB=Main tab registered. 10 | REGISTERED_CONTEXTMENU=Context menu registered. 11 | REGISTERED_HTTPLISTENER=HTTPListener registered. 12 | EXTENSION_UNLOADED=Extension JOSEPH is now unloaded. 13 | JWS=JSON Web Signature 14 | JWE=JSON Web Encryption 15 | ATTACKER=Attacker 16 | MANUAL=Manual 17 | DECODER=Decoder 18 | PREFERENCES=Preferences 19 | LOGGING_HEADLINE=Welcome to the JOSEPH attacker 20 | LOGLEVEL=Log level 21 | HIGHLIGHTING=Highlighting 22 | ADD=Add 23 | REMOVE=Remove 24 | PARAMETER_NAMES_LABEL=Parameter/HTTP header names to search for JOSE values\: 25 | SAVE_CONFIGURATION=Save Configuration 26 | SEND2JOSEPH=Send to JOSEPH 27 | ATTACKLISTLABEL=Available Attacks\: 28 | LOADBUTTON=Load 29 | ATTACKBUTTON=Attack 30 | ATTACK_PREPARATION_FAILED=Attack Preparation Failed! 31 | PROVIDE_PUBKEY=Please provide a public key! 32 | PUBKEY_FORMAT=Format of the public key\: 33 | NOT_VALID_JWK=Not a valid JWK format! 34 | NO_SUITABLE_JWK=No suitable JWK found! 35 | NOT_VALID_PEM=Not a valid PEM format! 36 | UPDATEBUTTON=Update 37 | CHOOSE_PAYLOAD=Choose Payload\: 38 | ENCODE_B64=\u25bc Encode Base64URL 39 | DECODE_B64=\u25b2 Decode Base64URL 40 | STARTATTACKBUTTON=Start Attack 41 | CANCELATTACKBUTTON=Cancel Attack 42 | RESULT_CEK=Recovered Content Encryption Key (CEK) 43 | HEX=Hex 44 | BASE64URL=Base64URL 45 | TIME_ELAPSED=Time elapsed: 46 | AMOUNT_REQUESTS=Amount requests: 47 | FOUND_S=Found s value: 48 | TEXT=Text 49 | RESULT_CONTENT=Recovered Content 50 | JOSE_INPUT_LABEL=JOSE Input 51 | INVALID_JOSE_VALUE=Invalid JOSE value! 52 | NOT_YET_SUPPORTED=Not yet supported! 53 | NOT_YET_SUPPORTED_MSG=We are sorry! This option is not yet supported... 54 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/attacks/bleichenbacher_pkcs1/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later 8 | * version. 9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 | * details. 14 | *
15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package eu.dety.burp.joseph.attacks.signature_exclusion; 20 | 21 | import eu.dety.burp.joseph.attacks.AttackRequest; 22 | 23 | /** 24 | * Signature Exclusion Attack Request 25 | *
26 | * Class extending abstract {@link AttackRequest} specifying properties of a single prepared signature exclusion attack request. 27 | * 28 | * @author Dennis Detering 29 | * @version 1.0 30 | */ 31 | public class SignatureExclusionAttackRequest extends AttackRequest { 32 | private String payload = null; 33 | 34 | public SignatureExclusionAttackRequest(byte[] request, int payloadType, String payload) { 35 | super(request, payloadType); 36 | this.setPayload(payload); 37 | } 38 | 39 | /** 40 | * Get the payload 41 | * 42 | * @return The payload as string 43 | */ 44 | public String getPayload() { 45 | return payload; 46 | } 47 | 48 | /** 49 | * Set the payload 50 | * 51 | * @param payload 52 | * The payload as string 53 | */ 54 | public void setPayload(String payload) { 55 | this.payload = payload; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/test/java/eu/dety/burp/joseph/BurpParameterMock.java: -------------------------------------------------------------------------------- 1 | /** 2 | * JOSEPH - JavaScript Object Signing and Encryption Pentesting Helper 3 | * Copyright (C) 2016 Dennis Detering 4 | *
5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later 8 | * version. 9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 | * details. 14 | *
15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package eu.dety.burp.joseph; 20 | 21 | import burp.IParameter; 22 | 23 | /** 24 | * Simple class implementing {@link IParameter} to mock Burp's behavior for parameters to be able to write according unit tests. 25 | */ 26 | public class BurpParameterMock implements IParameter { 27 | private String name; 28 | private String value; 29 | private byte type; 30 | 31 | public BurpParameterMock(String name, String value, byte type) { 32 | this.name = name; 33 | this.value = value; 34 | this.type = type; 35 | } 36 | 37 | @Override 38 | public byte getType() { 39 | return this.type; 40 | } 41 | 42 | @Override 43 | public String getName() { 44 | return this.name; 45 | } 46 | 47 | @Override 48 | public String getValue() { 49 | return this.value; 50 | } 51 | 52 | @Override 53 | public int getNameStart() { 54 | return 0; 55 | } 56 | 57 | @Override 58 | public int getNameEnd() { 59 | return this.name.length(); 60 | } 61 | 62 | @Override 63 | public int getValueStart() { 64 | return this.name.length() + 1; 65 | } 66 | 67 | @Override 68 | public int getValueEnd() { 69 | return this.name.length() + 1 + this.value.length(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /doc/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |31 | 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/AttackRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * JOSEPH - JavaScript Object Signing and Encryption Pentesting Helper 3 | * Copyright (C) 2016 Dennis Detering 4 | *
5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later 8 | * version. 9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 | * details. 14 | *
15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package eu.dety.burp.joseph.attacks; 20 | 21 | /** 22 | * Attack Request 23 | *
24 | * Abstract class specifying properties of a single prepared attack request 25 | * 26 | * @author Dennis Detering 27 | * @version 1.0 28 | */ 29 | abstract public class AttackRequest { 30 | private byte[] request = null; 31 | private int payloadType = -1; 32 | 33 | public AttackRequest(byte[] request, int payloadType) { 34 | this.setRequest(request); 35 | this.setPayloadType(payloadType); 36 | } 37 | 38 | /** 39 | * Get the request content 40 | * 41 | * @return byte array request content 42 | */ 43 | public byte[] getRequest() { 44 | return request; 45 | } 46 | 47 | /** 48 | * Set the request content 49 | * 50 | * @param request 51 | * byte array request content 52 | */ 53 | public void setRequest(byte[] request) { 54 | this.request = request; 55 | } 56 | 57 | /** 58 | * Get the payload type 59 | *
60 | * Each {@link IAttackInfo} class should implement an enum PayloadType 61 | * 62 | * @return ordinal value of payload type 63 | */ 64 | public int getPayloadType() { 65 | return payloadType; 66 | } 67 | 68 | /** 69 | * Set the payload type 70 | * 71 | * @param payloadType 72 | * ordinal value of payload type 73 | */ 74 | public void setPayloadType(int payloadType) { 75 | this.payloadType = payloadType; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/bleichenbacher_pkcs1/BleichenbacherPkcs1AttackRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * JOSEPH - JavaScript Object Signing and Encryption Pentesting Helper 3 | * Copyright (C) 2016 Dennis Detering 4 | *
5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later 8 | * version. 9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 | * details. 14 | *
15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1; 20 | 21 | import eu.dety.burp.joseph.attacks.AttackRequest; 22 | 23 | /** 24 | * Bleichenbacher PKCS1 Attack Request 25 | *
26 | * Class extending abstract {@link AttackRequest} specifying properties of a single prepared bleichenbacher pkcs1 attack request. 27 | * 28 | * @author Dennis Detering 29 | * @version 1.0 30 | */ 31 | public class BleichenbacherPkcs1AttackRequest extends AttackRequest { 32 | private byte[] vector; 33 | 34 | private String vectorName; 35 | 36 | public BleichenbacherPkcs1AttackRequest(byte[] request, int payloadType, byte[] vector, String vectorName) { 37 | super(request, payloadType); 38 | this.setVector(vector); 39 | this.setVectorName(vectorName); 40 | } 41 | 42 | /** 43 | * Get the attack vector 44 | * 45 | * @return The attack vector value 46 | */ 47 | public byte[] getVector() { 48 | return vector; 49 | } 50 | 51 | /** 52 | * Set the attack vector 53 | * 54 | * @param vector 55 | * The attack vector value 56 | */ 57 | public void setVector(byte[] vector) { 58 | this.vector = vector; 59 | } 60 | 61 | /** 62 | * Get the attack vector name 63 | * 64 | * @return The attack vector name 65 | */ 66 | public String getVectorName() { 67 | return vectorName; 68 | } 69 | 70 | /** 71 | * Set the attack name 72 | * 73 | * @param vectorName 74 | * The attack vector name 75 | */ 76 | public void setVectorName(String vectorName) { 77 | this.vectorName = vectorName; 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JOSEPH 2 |  3 | [](https://github.com/RUB-NDS/JOSEPH/releases) 4 |  5 | [](https://travis-ci.org/RUB-NDS/JOSEPH) 6 | 7 | ## JavaScript Object Signing and Encryption Pentesting Helper 8 | 9 | JOSEPH is a Burp Suite extension and has been developed as part of a master thesis by [Dennis Detering](https://github.com/merenon) at the [Ruhr-University Bochum](http://rub.de) in cooperation with the [Spike Reply GmbH](https://reply.de) (formerly [CSPi GmbH](https://www.cspi.com/)). 10 | 11 | ## Features 12 | - Recognition and marking 13 | - JWS/JWE editors 14 | - (Semi-)Automated attacks 15 | * Bleichenbacher MMA 16 | * Key Confusion (aka Algorithm Substitution) 17 | * Signature Exclusion 18 | - Base64url en-/decoder 19 | - Easy extensibility of new attacks 20 | 21 | ## Burp Suite BApp Store 22 | This Burp Suite extension can be downloaded directly from the BApp Store [JSON Web Token Attacker](https://portswigger.net/bappstore/82d6c60490b540369d6d5d01822bdf61) 23 | 24 | ## Build 25 | To compile the JOSEPH extension from source, it is necessary to have Apache Maven installed and to run the following command: 26 | ```bash 27 | $ mvn clean package 28 | ``` 29 | 30 | To skip the (unit) tests, use the following command: 31 | ```bash 32 | $ mvn clean package -DskipTests 33 | ``` 34 | 35 | ### Troubleshooting 36 | 37 | If the _Oracle JDK_ is installed, the used Bouncy Castle JCE provider dependency is not allowed to be loaded from within a newly compiled fat-JAR, as it breaks the needed signature integrity check. 38 | 39 | When performing the Bleichenbacher attack without Bouncy Castle being correctly loaded, the following error will occur: 40 | ``` 41 | [BleichenbacherPkcs1Info]: Error during key encryption: Cannot find any provider supporting RSA/NONE/NoPadding 42 | ``` 43 | 44 | If this issue arises, please perform the following step(s): 45 | 46 | - Copy the Bouncy Castle JAR-file `bcprov-jdk15on-1.54.jar` from JOSEPH's `lib` folder into the `/[PATH_TO_JVM]/jre/lib/ext` directory. 47 | 48 | - In some cases, it is necessary to additionally amend the `/[PATH_TO_JVM]/jre/lib/security/java.security` file and add the following line (preferably directly below the other provider definitions): `security.provider.9=org.bouncycastle.jce.provider.BouncyCastleProvider`. The `9` in this case specifies the priority and should be adjusted to fit into existing definitions. 49 | 50 | 51 | Alternatively, use `target/JOSEPH-1.0.3.jar` and load the `target/lib` folder to your Java Environment under `Extender/Options`. 52 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/utilities/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later 8 | * version. 9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 | * details. 14 | *
15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package eu.dety.burp.joseph.attacks.key_confusion; 20 | 21 | import eu.dety.burp.joseph.attacks.AttackRequest; 22 | 23 | /** 24 | * Key Confusion Attack Request 25 | *
26 | * Class extending abstract {@link AttackRequest} specifying properties of a single prepared key confusion attack request. 27 | * 28 | * @author Dennis Detering 29 | * @version 1.0 30 | */ 31 | public class KeyConfusionAttackRequest extends AttackRequest { 32 | private String algorithm = null; 33 | private String keyValue = null; 34 | private int keyLength = 0; 35 | 36 | public KeyConfusionAttackRequest(byte[] request, int payloadType, String algorithm, String keyValue, int keyLength) { 37 | super(request, payloadType); 38 | this.setAlgorithm(algorithm); 39 | this.setKeyValue(keyValue); 40 | this.setKeyLength(keyLength); 41 | this.setKeyValue(keyValue); 42 | } 43 | 44 | /** 45 | * Get the algorithm abbreviation 46 | * 47 | * @return The algorithm value 48 | */ 49 | public String getAlgorithm() { 50 | return algorithm; 51 | } 52 | 53 | /** 54 | * Set the algorithm 55 | * 56 | * @param algorithm 57 | * The algorithm abbreviation (as defined in JWA) 58 | */ 59 | public void setAlgorithm(String algorithm) { 60 | this.algorithm = algorithm; 61 | } 62 | 63 | /** 64 | * Get the key value 65 | * 66 | * @return String representation of the public key 67 | */ 68 | public String getKeyValue() { 69 | return keyValue; 70 | } 71 | 72 | /** 73 | * Set the public key value 74 | * 75 | * @param keyValue 76 | * String representation of the public key 77 | */ 78 | public void setKeyValue(String keyValue) { 79 | this.keyValue = keyValue; 80 | } 81 | 82 | /** 83 | * Get the key length 84 | * 85 | * @return The key length in bytes 86 | */ 87 | public int getKeyLength() { 88 | return keyLength; 89 | } 90 | 91 | /** 92 | * Set the key length 93 | * 94 | * @param keyLength 95 | * The key length in bytes 96 | */ 97 | public void setKeyLength(int keyLength) { 98 | this.keyLength = keyLength; 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/AttackLoader.java: -------------------------------------------------------------------------------- 1 | /** 2 | * JOSEPH - JavaScript Object Signing and Encryption Pentesting Helper 3 | * Copyright (C) 2016 Dennis Detering 4 | *
5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later 8 | * version. 9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 | * details. 14 | *
15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package eu.dety.burp.joseph.attacks; 20 | 21 | import burp.IBurpExtenderCallbacks; 22 | import eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1.BleichenbacherPkcs1Info; 23 | import eu.dety.burp.joseph.attacks.key_confusion.KeyConfusionInfo; 24 | import eu.dety.burp.joseph.attacks.signature_exclusion.SignatureExclusionInfo; 25 | import eu.dety.burp.joseph.utilities.Logger; 26 | 27 | import java.util.HashMap; 28 | 29 | /** 30 | * Attack Loader 31 | *
32 | * Class to manage all available attacks at one place.
33 | */
34 | public class AttackLoader {
35 | private static final Logger loggerInstance = Logger.getInstance();
36 |
37 | /**
38 | * Get new list of new instances of all registered attacks
39 | *
40 | * @param callbacks
41 | * {@link IBurpExtenderCallbacks} instance
42 | * @return HashMap with the name of the attack as string and a new instance of the attack's info class
43 | */
44 | public static HashMap
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.utilities;
20 |
21 | import burp.BurpExtender;
22 | import eu.dety.burp.joseph.gui.PreferencesPanel;
23 |
24 | import java.io.PrintWriter;
25 | import java.text.SimpleDateFormat;
26 | import java.util.Calendar;
27 | import java.util.Objects;
28 |
29 | /**
30 | * Internal logger for the extension
31 | *
32 | * @author Dennis Detering
33 | * @version 1.0
34 | */
35 | public class Logger {
36 |
37 | private static PrintWriter stdout = null;
38 | private static PrintWriter stderr = null;
39 |
40 | /**
41 | * LogLevel enum defining the log types, might be one of:
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.gui;
20 |
21 | import javax.swing.*;
22 | import java.awt.*;
23 |
24 | /**
25 | * Help tab with information about this extension
26 | *
27 | * @author Dennis Detering
28 | * @version 1.0
29 | */
30 | public class HelpPanel extends JPanel {
31 |
32 | public HelpPanel() {
33 | initComponents();
34 | }
35 |
36 | /**
37 | * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this
38 | * method is always regenerated by the Form Editor.
39 | */
40 | @SuppressWarnings("unchecked")
41 | //
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.gui.table;
20 |
21 | import javax.swing.*;
22 | import javax.swing.table.TableRowSorter;
23 | import java.awt.*;
24 | import java.awt.event.MouseAdapter;
25 | import java.awt.event.MouseEvent;
26 | import java.util.ArrayList;
27 |
28 | /**
29 | * Base class for tables.
30 | *
31 | * @author Dennis Detering
32 | * @version 1.0
33 | */
34 | public class Table extends JTable {
35 | private TableModel tableModel;
36 | private ArrayList
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1;
20 |
21 | import burp.IBurpExtenderCallbacks;
22 | import burp.IExtensionHelpers;
23 | import eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1.gui.BleichenbacherPkcs1TableEntry;
24 | import eu.dety.burp.joseph.utilities.Logger;
25 | import org.simmetrics.StringMetric;
26 | import org.simmetrics.metrics.StringMetrics;
27 |
28 | import java.util.ArrayList;
29 | import java.util.List;
30 |
31 | /**
32 | * Bleichenbacher PKCS1 Oracle
33 | *
34 | * Stores all responses and their validity according to PKCS#1 v1.5 to compare new responses based on dice distance.
35 | */
36 | public class BleichenbacherPkcs1Oracle {
37 | private static final Logger loggerInstance = Logger.getInstance();
38 | private IExtensionHelpers helpers;
39 | private static final double COMPARE_THRESHOLD = 0.9;
40 | private StringMetric metric = StringMetrics.dice();
41 |
42 | private List
7 | * This program is free software; you can redistribute it and/or modify it under
8 | * the terms of the GNU General Public License as published by the Free Software
9 | * Foundation; either version 2 of the License, or (at your option) any later
10 | * version.
11 | *
12 | * This program is distributed in the hope that it will be useful, but WITHOUT
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 | * details.
16 | *
17 | * You should have received a copy of the GNU General Public License along with
18 | * this program; if not, write to the Free Software Foundation, Inc., 51
19 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 | */
21 |
22 | import javax.swing.*;
23 | import javax.swing.table.TableRowSorter;
24 | import java.awt.*;
25 | import java.awt.event.MouseAdapter;
26 | import java.awt.event.MouseEvent;
27 | import java.util.ArrayList;
28 |
29 | /**
30 | * Base class for tables.
31 | *
32 | * @author Dennis Detering
33 | * @version 1.0
34 | */
35 | public class BleichenbacherPkcs1Table extends JTable {
36 | private BleichenbacherPkcs1TableModel tableModel;
37 | private ArrayList
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.scanner;
20 |
21 | import burp.*;
22 | import eu.dety.burp.joseph.gui.PreferencesPanel;
23 | import eu.dety.burp.joseph.utilities.Finder;
24 | import eu.dety.burp.joseph.utilities.Logger;
25 |
26 | import java.util.Objects;
27 | import java.util.ResourceBundle;
28 |
29 | /**
30 | * HTTP listener to recognize and mark JOSE parameter
31 | *
32 | * @author Dennis Detering
33 | * @version 1.0
34 | */
35 | public class Marker implements IHttpListener {
36 | private static final Logger loggerInstance = Logger.getInstance();
37 | private static final ResourceBundle bundle = ResourceBundle.getBundle("JOSEPH");
38 | private final IExtensionHelpers helpers;
39 |
40 | private static final String HIGHLIGHT_COLOR = "cyan";
41 |
42 | public Marker(IBurpExtenderCallbacks callbacks) {
43 | this.helpers = callbacks.getHelpers();
44 | }
45 |
46 | @Override
47 | public void processHttpMessage(int toolFlag, boolean messageIsRequest, IHttpRequestResponse httpRequestResponse) {
48 | // Only flag messages if highlighting option is set to true and if
49 | // sent/received by the proxy
50 | if (PreferencesPanel.getHighlighting() && toolFlag == IBurpExtenderCallbacks.TOOL_PROXY) {
51 | checkForJoseLocations(httpRequestResponse);
52 | }
53 | }
54 |
55 | /**
56 | * Checks whether given recognition pattern for JWS locations match
57 | *
58 | * @param httpRequestResponse
59 | * {@link IHttpRequestResponse} Object containing the request/response.
60 | */
61 | private void checkForJoseLocations(IHttpRequestResponse httpRequestResponse) {
62 | IRequestInfo requestInfo = helpers.analyzeRequest(httpRequestResponse);
63 |
64 | if (Finder.checkHeaderAndParameterForJwsPattern(requestInfo) != null) {
65 | markRequestResponse(httpRequestResponse, bundle.getString("JWS"));
66 | loggerInstance.log(getClass(), "JSON Web Signature found!", Logger.LogLevel.DEBUG);
67 | }
68 |
69 | if (Finder.checkHeaderAndParameterForJwePattern(requestInfo) != null) {
70 | markRequestResponse(httpRequestResponse, bundle.getString("JWE"));
71 | loggerInstance.log(getClass(), "JSON Web Encryption found!", Logger.LogLevel.DEBUG);
72 | }
73 | }
74 |
75 | /**
76 | * Highlight recognized request/response and add an informational comment
77 | *
78 | * @param httpRequestResponse
79 | * {@link IHttpRequestResponse} Object containing the request/response.
80 | * @param message
81 | * The string used as comment.
82 | */
83 | private void markRequestResponse(IHttpRequestResponse httpRequestResponse, String message) {
84 | httpRequestResponse.setHighlight(HIGHLIGHT_COLOR);
85 |
86 | // Check for existing comment and append new comment, preventing
87 | // override
88 | final String oldComment = httpRequestResponse.getComment();
89 | String comment = (oldComment != null && !oldComment.isEmpty() && !Objects.equals(oldComment, message)) ? String.format("%s, %s", oldComment, message) : message;
90 |
91 | httpRequestResponse.setComment(comment);
92 | }
93 |
94 | /**
95 | * Get highlight color
96 | *
97 | * @return Get the highlight color constant.
98 | */
99 | public static String getHighlightColor() {
100 | return HIGHLIGHT_COLOR;
101 | }
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/doc/burp/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.gui;
20 |
21 | import java.awt.*;
22 |
23 | /**
24 | * Attacker info tab with information about how to use the JOSEPH attacker
25 | *
26 | * @author Dennis Detering
27 | * @version 1.0
28 | */
29 | public class AttackerInfoPanel extends javax.swing.JPanel {
30 |
31 | public AttackerInfoPanel() {
32 | initComponents();
33 | }
34 |
35 | /**
36 | * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this
37 | * method is always regenerated by the Form Editor.
38 | */
39 | @SuppressWarnings("unchecked")
40 | //
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.attacks.__attack_template;
20 |
21 | import burp.IBurpExtenderCallbacks;
22 | import burp.IHttpRequestResponse;
23 | import burp.IHttpService;
24 | import eu.dety.burp.joseph.attacks.IAttack;
25 | import eu.dety.burp.joseph.gui.AttackerResultWindow;
26 | import eu.dety.burp.joseph.gui.table.TableEntry;
27 | import eu.dety.burp.joseph.utilities.Logger;
28 |
29 | import javax.swing.*;
30 | import java.util.ArrayList;
31 | import java.util.List;
32 | import java.util.concurrent.ExecutionException;
33 |
34 | /**
35 | * Attack Template Attack
36 | *
37 | * @author Dennis Detering
38 | * @version 1.0
39 | */
40 | public class AttackTemplate implements IAttack {
41 | private static final Logger loggerInstance = Logger.getInstance();
42 | private AttackTemplateInfo attackInfo;
43 | private IBurpExtenderCallbacks callbacks;
44 | private AttackerResultWindow attackerResultWindow;
45 | private List
72 | * Performs the actual request and updates related widgets
73 | */
74 | private class AttackExecutor extends SwingWorker
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.attacks;
20 |
21 | import burp.IBurpExtenderCallbacks;
22 | import burp.IHttpRequestResponse;
23 | import burp.IRequestInfo;
24 | import eu.dety.burp.joseph.utilities.JoseParameter;
25 | import eu.dety.burp.joseph.utilities.JoseParameter.JoseType;
26 |
27 | import javax.swing.*;
28 | import java.awt.*;
29 | import java.util.HashMap;
30 | import java.util.List;
31 |
32 | /**
33 | * Interface defining necessary methods for attack info classes
34 | *
35 | * @author Dennis Detering
36 | * @version 1.0
37 | */
38 | public interface IAttackInfo {
39 |
40 | /**
41 | * Prepare the attack by loading all necessary parameter
42 | *
43 | * @param requestResponse
44 | * {@link IHttpRequestResponse} requestResponse message
45 | * @param requestInfo
46 | * {@link IRequestInfo} analyzed request
47 | * @param parameter
48 | * {@link JoseParameter} JOSE parameter
49 | * @throws AttackPreparationFailedException
50 | * if error occurs during preparation step
51 | * @return IAttack instance of attack
52 | */
53 | IAttack prepareAttack(IBurpExtenderCallbacks callbacks, IHttpRequestResponse requestResponse, IRequestInfo requestInfo, JoseParameter parameter)
54 | throws AttackPreparationFailedException;
55 |
56 | /**
57 | * Get unique attack ID
58 | *
59 | * @return Unique identifier string
60 | */
61 | String getId();
62 |
63 | /**
64 | * Get attack name
65 | *
66 | * @return Attack name string
67 | */
68 | String getName();
69 |
70 | /**
71 | * Get attack description
72 | *
73 | * @return Attack description string
74 | */
75 | String getDescription();
76 |
77 | /**
78 | * Get the amount of requests to be performed
79 | *
80 | * @return Amount of requests needed
81 | */
82 | int getAmountRequests();
83 |
84 | /**
85 | * Get additional UI components if further data is needed to perform the attack
86 | *
87 | * @return True if attack provides extra UI elements
88 | */
89 | boolean getExtraUI(JPanel extraPanel, GridBagConstraints constraints);
90 |
91 | /**
92 | * Check whether attack is suitable based on algorithm and type values
93 | *
94 | * @param type
95 | * {@link JoseType} of the parameter
96 | * @param algorithm
97 | * JOSE header algorithm value string
98 | * @return True if attack is suitable
99 | */
100 | boolean isSuitable(JoseType type, String algorithm);
101 |
102 | /**
103 | * Get IHttpRequestResponse object used for this attack
104 | *
105 | * @return {@link burp.IHttpRequestResponse} object
106 | */
107 | IHttpRequestResponse getRequestResponse();
108 |
109 | /**
110 | * Get list of prepared {@link AttackRequest} objects
111 | *
112 | * @return List with {@link AttackRequest} objects
113 | */
114 | List extends AttackRequest> getRequests();
115 |
116 | /**
117 | * Get list of available payloads
118 | *
119 | * @return HashMap with PayloadType and explaining name
120 | */
121 | HashMap
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package burp;
20 |
21 | import eu.dety.burp.joseph.editor.JweEditor;
22 | import eu.dety.burp.joseph.editor.JwsEditor;
23 | import eu.dety.burp.joseph.gui.MainTabGroup;
24 | import eu.dety.burp.joseph.scanner.Marker;
25 | import eu.dety.burp.joseph.utilities.Logger;
26 |
27 | import java.io.PrintWriter;
28 | import java.text.SimpleDateFormat;
29 | import java.util.Calendar;
30 | import java.util.ResourceBundle;
31 |
32 | /**
33 | * The Burp Extender to register the JOSEPH extension
34 | *
35 | * @author Dennis Detering
36 | * @version 1.0
37 | */
38 |
39 | public class BurpExtender implements IBurpExtender, IExtensionStateListener {
40 | private static final String EXTENSION_NAME = "JOSEPH";
41 |
42 | private static PrintWriter stdout;
43 | private static PrintWriter stderr;
44 |
45 | private ResourceBundle bundle = ResourceBundle.getBundle("JOSEPH");
46 |
47 | /**
48 | * Set the extension name and print loading information to standard output.
49 | */
50 | public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks) {
51 | // Set extension name
52 | callbacks.setExtensionName(EXTENSION_NAME);
53 |
54 | // Obtain streams
55 | stdout = new PrintWriter(callbacks.getStdout(), true);
56 | stderr = new PrintWriter(callbacks.getStderr(), true);
57 | Logger loggerInstance = Logger.getInstance();
58 |
59 | // Get current time
60 | Calendar calObj = Calendar.getInstance();
61 | SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
62 | String time = dateFormat.format(calObj.getTime());
63 | stdout.println("+---------------------------------------------------------+");
64 | stdout.println("| JOSEPH |");
65 | stdout.println("| Version 1.0.3 |");
66 | stdout.println("| Started @ " + time + " |");
67 | stdout.println("+---------------------------------------------------------+");
68 |
69 | // Register JOSEPH tab
70 | final MainTabGroup josephMainTab = new MainTabGroup(callbacks);
71 | loggerInstance.log(getClass(), bundle.getString("REGISTERED_MAINTAB"), Logger.LogLevel.INFO);
72 |
73 | // Register Context Menu
74 | callbacks.registerContextMenuFactory(josephMainTab);
75 | loggerInstance.log(getClass(), bundle.getString("REGISTERED_CONTEXTMENU"), Logger.LogLevel.INFO);
76 |
77 | // Register HTTP listener
78 | final Marker marker = new Marker(callbacks);
79 | callbacks.registerHttpListener(marker);
80 | loggerInstance.log(getClass(), bundle.getString("REGISTERED_HTTPLISTENER"), Logger.LogLevel.INFO);
81 |
82 | // Register JWS Editor
83 | final JwsEditor jwsEditor = new JwsEditor(callbacks);
84 | callbacks.registerMessageEditorTabFactory(jwsEditor);
85 | loggerInstance.log(getClass(), bundle.getString("REGISTERED_JWSEDITOR"), Logger.LogLevel.INFO);
86 |
87 | // Register JWE Editor
88 | final JweEditor jweEditor = new JweEditor(callbacks);
89 | callbacks.registerMessageEditorTabFactory(jweEditor);
90 | loggerInstance.log(getClass(), bundle.getString("REGISTERED_JWEEDITOR"), Logger.LogLevel.INFO);
91 |
92 | }
93 |
94 | /**
95 | * Print a notification on the standard output when extension is unloaded.
96 | */
97 | @Override
98 | public void extensionUnloaded() {
99 | stdout.println(bundle.getString("EXTENSION_UNLOADED"));
100 | }
101 |
102 | /**
103 | * Get a {@link java.io.PrintWriter} to the standard output of Burp.
104 | *
105 | * @return The standard output
106 | */
107 | public static PrintWriter getStdOut() {
108 | return stdout;
109 | }
110 |
111 | /**
112 | * Get a {@link java.io.PrintWriter} to the standard error output of Burp.
113 | *
114 | * @return The standard error output
115 | */
116 | public static PrintWriter getStdErr() {
117 | return stderr;
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/src/test/java/eu/dety/burp/joseph/attacks/bleichenbacher_pkcs1/BleichenbacherPkcs1Test.java:
--------------------------------------------------------------------------------
1 | /**
2 | * JOSEPH - JavaScript Object Signing and Encryption Pentesting Helper
3 | * Copyright (C) 2016 Dennis Detering
4 | *
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1;
20 |
21 | import burp.IBurpExtenderCallbacks;
22 | import eu.dety.burp.joseph.BurpExtenderCallbacksMock;
23 | import eu.dety.burp.joseph.utilities.JoseParameter;
24 | import org.junit.Test;
25 |
26 | import static org.junit.Assert.assertFalse;
27 | import static org.junit.Assert.assertTrue;
28 |
29 | public class BleichenbacherPkcs1Test {
30 |
31 | @Test
32 | public void isSuitableWithJwsPayloadTypeAndDifferentAlgorithmsReturnsTrue() {
33 | IBurpExtenderCallbacks callbacks = new BurpExtenderCallbacksMock();
34 |
35 | BleichenbacherPkcs1Info bleichenbacherPkcs1Info = new BleichenbacherPkcs1Info(callbacks);
36 |
37 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "HS256"));
38 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "HS384"));
39 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "HS512"));
40 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "RS256"));
41 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "RS384"));
42 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "RS512"));
43 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "ES256"));
44 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "ES384"));
45 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "ES512"));
46 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "PS256"));
47 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "PS384"));
48 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "PS512"));
49 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "none"));
50 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, ""));
51 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWS, "INVALID"));
52 | }
53 |
54 | @Test
55 | public void isSuitableWithJwePayloadTypeAndDifferentAlgorithmsReturnsTrueOnRsa15Only() {
56 | IBurpExtenderCallbacks callbacks = new BurpExtenderCallbacksMock();
57 |
58 | BleichenbacherPkcs1Info bleichenbacherPkcs1Info = new BleichenbacherPkcs1Info(callbacks);
59 |
60 | assertTrue(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "RSA1_5"));
61 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "RSA-OAEP"));
62 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "RSA-OAEP-256"));
63 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "A128KW"));
64 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "A192KW"));
65 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "A256KW"));
66 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "dir"));
67 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "ECDH-ES"));
68 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "ECDH-ES+A128KW"));
69 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "ECDH-ES+A192KW"));
70 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "ECDH-ES+A256KW"));
71 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "A128GCMKW"));
72 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "A192GCMKW"));
73 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "A256GCMKW"));
74 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "PBES2-HS256+A128KW"));
75 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "PBES2-HS384+A192KW"));
76 | assertFalse(bleichenbacherPkcs1Info.isSuitable(JoseParameter.JoseType.JWE, "PBES2-HS512+A256KW"));
77 | }
78 |
79 | }
--------------------------------------------------------------------------------
/src/main/java/eu/dety/burp/joseph/gui/table/TableModel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * JOSEPH - JavaScript Object Signing and Encryption Pentesting Helper
3 | * Copyright (C) 2016 Dennis Detering
4 | *
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.gui.table;
20 |
21 | import eu.dety.burp.joseph.utilities.Logger;
22 |
23 | import javax.swing.table.AbstractTableModel;
24 | import java.util.ArrayList;
25 |
26 | /**
27 | * Helper class for the attack table.
28 | *
29 | * @author Dennis Detering
30 | * @version 1.0
31 | */
32 | public class TableModel extends AbstractTableModel {
33 | private static final Logger loggerInstance = Logger.getInstance();
34 | private ArrayList
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.attacks.key_confusion;
20 |
21 | import burp.IBurpExtenderCallbacks;
22 | import burp.IHttpRequestResponse;
23 | import burp.IHttpService;
24 | import eu.dety.burp.joseph.attacks.IAttack;
25 | import eu.dety.burp.joseph.gui.AttackerResultWindow;
26 | import eu.dety.burp.joseph.gui.table.TableEntry;
27 | import eu.dety.burp.joseph.utilities.Logger;
28 |
29 | import javax.swing.*;
30 | import java.util.ArrayList;
31 | import java.util.List;
32 | import java.util.concurrent.ExecutionException;
33 |
34 | /**
35 | * Key Confusion Attack
36 | *
37 | * Perform a key confusion attack by using an RSA public key as MAC secret.
38 | *
39 | * @author Dennis Detering
40 | * @version 1.0
41 | */
42 | public class KeyConfusion implements IAttack {
43 | private static final Logger loggerInstance = Logger.getInstance();
44 | private KeyConfusionInfo attackInfo;
45 | private IBurpExtenderCallbacks callbacks;
46 | private AttackerResultWindow attackerResultWindow;
47 | private List
74 | * Performs the actual request and updates related widgets
75 | */
76 | private class AttackExecutor extends SwingWorker
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.attacks.signature_exclusion;
20 |
21 | import burp.IBurpExtenderCallbacks;
22 | import burp.IHttpRequestResponse;
23 | import burp.IHttpService;
24 | import eu.dety.burp.joseph.attacks.IAttack;
25 | import eu.dety.burp.joseph.gui.AttackerResultWindow;
26 | import eu.dety.burp.joseph.gui.table.TableEntry;
27 | import eu.dety.burp.joseph.utilities.Logger;
28 |
29 | import javax.swing.*;
30 | import java.util.ArrayList;
31 | import java.util.List;
32 | import java.util.concurrent.ExecutionException;
33 |
34 | /**
35 | * Signature Exclusion Attack
36 | *
37 | * Perform a signature exclusion attack by changing the algorithm value of the header to the "none" algorithm and cutting away the signature
38 | * value.
39 | *
40 | * @author Dennis Detering
41 | * @version 1.0
42 | */
43 | public class SignatureExclusion implements IAttack {
44 | private static final Logger loggerInstance = Logger.getInstance();
45 | private SignatureExclusionInfo attackInfo;
46 | private IBurpExtenderCallbacks callbacks;
47 | private AttackerResultWindow attackerResultWindow;
48 | private List
75 | * Performs the actual request and updates related widgets
76 | */
77 | private class AttackExecutor extends SwingWorker
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1.gui;
20 |
21 | import burp.IBurpExtenderCallbacks;
22 | import burp.IExtensionHelpers;
23 | import burp.IHttpRequestResponse;
24 | import burp.IResponseInfo;
25 |
26 | import java.text.SimpleDateFormat;
27 | import java.util.Calendar;
28 |
29 | public class BleichenbacherPkcs1TableEntry {
30 | private boolean isValid = false;
31 |
32 | private int entryIndex = 0;
33 | private String payloadType = "";
34 | private String payload = "";
35 | private short status = 0;
36 | private String time = "";
37 | private String length = "";
38 | private IHttpRequestResponse requestResponse = null;
39 | private IExtensionHelpers helpers;
40 |
41 | /**
42 | * Construct a new table entry.
43 | *
44 | * @param payload
45 | * Payload used for the attack request
46 | * @param requestResponse
47 | * The content of the request/response.
48 | * @param callbacks
49 | * Helper provided by the Burp Suite api.
50 | */
51 | public BleichenbacherPkcs1TableEntry(int entryIndex, int payloadType, String payload, IHttpRequestResponse requestResponse, IBurpExtenderCallbacks callbacks) {
52 | this.helpers = callbacks.getHelpers();
53 |
54 | IResponseInfo responseInfo = helpers.analyzeResponse(requestResponse.getResponse());
55 |
56 | this.entryIndex = entryIndex;
57 | this.setPayloadType(payloadType);
58 | this.payload = payload;
59 | this.status = responseInfo.getStatusCode();
60 |
61 | // Get current time
62 | Calendar calObj = Calendar.getInstance();
63 | SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
64 | this.time = dateFormat.format(calObj.getTime());
65 |
66 | this.length = (new Integer(requestResponse.getResponse().length)).toString();
67 | this.requestResponse = requestResponse;
68 | }
69 |
70 | /**
71 | * Get the index of the message.
72 | *
73 | * @return Message index.
74 | */
75 | public int getEntryIndex() {
76 | return entryIndex;
77 | }
78 |
79 | /**
80 | * Get the protocol name.
81 | *
82 | * @return The protocol name.
83 | */
84 | public String getPayload() {
85 | return payload;
86 | }
87 |
88 | /**
89 | * Get the status code of the response.
90 | *
91 | * @return The status code.
92 | */
93 | public short getStatus() {
94 | return status;
95 | }
96 |
97 | /**
98 | * Get the length of the request.
99 | *
100 | * @return The length.
101 | */
102 | public String getLength() {
103 | return length;
104 | }
105 |
106 | /**
107 | * Get the time at which the entry was created.
108 | *
109 | * @return The time (XX:XX:XX).
110 | */
111 | public String getTime() {
112 | return time;
113 | }
114 |
115 | /**
116 | * Get the http message.
117 | *
118 | * @return The http message.
119 | */
120 | public IHttpRequestResponse getMessage() {
121 | return requestResponse;
122 | }
123 |
124 | /**
125 | * Get the payload type ordinal value.
126 | *
127 | * @return The payload type ordinal value.
128 | */
129 | public String getPayloadType() {
130 | return payloadType;
131 | }
132 |
133 | /**
134 | * Set the payload type hex string representation.
135 | *
136 | * @param payloadType
137 | * The hex string representation value of the payload type.
138 | */
139 | public void setPayloadType(int payloadType) {
140 | this.payloadType = (payloadType > -1) ? String.format("0x%02X", payloadType) : "";
141 | }
142 |
143 | /**
144 | * Get the isValid value
145 | *
146 | * @return The isValid boolean value
147 | */
148 | public boolean getIsValid() {
149 | return isValid;
150 | }
151 |
152 | /**
153 | * Set isValid value
154 | *
155 | * @param isValid
156 | * The boolean value wheter this request indicates a PKCS1 conform request
157 | */
158 | public void setIsValid(boolean isValid) {
159 | this.isValid = isValid;
160 | }
161 | }
162 |
--------------------------------------------------------------------------------
/src/main/java/eu/dety/burp/joseph/gui/table/TableEntry.java:
--------------------------------------------------------------------------------
1 | /**
2 | * JOSEPH - JavaScript Object Signing and Encryption Pentesting Helper
3 | * Copyright (C) 2016 Dennis Detering
4 | *
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.gui.table;
20 |
21 | import burp.IBurpExtenderCallbacks;
22 | import burp.IExtensionHelpers;
23 | import burp.IHttpRequestResponse;
24 | import burp.IResponseInfo;
25 |
26 | import java.text.SimpleDateFormat;
27 | import java.util.Calendar;
28 |
29 | /**
30 | * Table entry for the attack table.
31 | *
32 | * @author Dennis Detering
33 | * @version 1.0
34 | */
35 | public class TableEntry {
36 | private int entryIndex = 0;
37 | private String payloadType = "";
38 | private String payload = "";
39 | private short status = 0;
40 | private String time = "";
41 | private String length = "";
42 | private String comment = "";
43 | private IHttpRequestResponse requestResponse = null;
44 | private IExtensionHelpers helpers;
45 |
46 | /**
47 | * Construct a new table entry.
48 | *
49 | * @param payload
50 | * Payload used for the attack request
51 | * @param requestResponse
52 | * The content of the request/response.
53 | * @param callbacks
54 | * Helper provided by the Burp Suite api.
55 | */
56 | public TableEntry(int entryIndex, int payloadType, String payload, IHttpRequestResponse requestResponse, IBurpExtenderCallbacks callbacks) {
57 | this.helpers = callbacks.getHelpers();
58 |
59 | IResponseInfo responseInfo = helpers.analyzeResponse(requestResponse.getResponse());
60 |
61 | this.entryIndex = entryIndex;
62 | this.setPayloadType(payloadType);
63 | this.payload = payload;
64 | this.status = responseInfo.getStatusCode();
65 |
66 | // Get current time
67 | Calendar calObj = Calendar.getInstance();
68 | SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
69 | this.time = dateFormat.format(calObj.getTime());
70 |
71 | this.length = (new Integer(requestResponse.getResponse().length)).toString();
72 | this.comment = requestResponse.getComment();
73 | this.requestResponse = requestResponse;
74 | }
75 |
76 | /**
77 | * Get the index of the message.
78 | *
79 | * @return Message index.
80 | */
81 | public int getEntryIndex() {
82 | return entryIndex;
83 | }
84 |
85 | /**
86 | * Get the protocol name.
87 | *
88 | * @return The protocol name.
89 | */
90 | public String getPayload() {
91 | return payload;
92 | }
93 |
94 | /**
95 | * Get the status code of the response.
96 | *
97 | * @return The status code.
98 | */
99 | public short getStatus() {
100 | return status;
101 | }
102 |
103 | /**
104 | * Get the length of the request.
105 | *
106 | * @return The length.
107 | */
108 | public String getLength() {
109 | return length;
110 | }
111 |
112 | /**
113 | * Get the time at which the entry was created.
114 | *
115 | * @return The time (XX:XX:XX).
116 | */
117 | public String getTime() {
118 | return time;
119 | }
120 |
121 | /**
122 | * Get the comment. Stores additional data for the protocol
123 | *
124 | * @return The comment.
125 | */
126 | public String getComment() {
127 | return comment;
128 | }
129 |
130 | /**
131 | * Get the http message.
132 | *
133 | * @return The http message.
134 | */
135 | public IHttpRequestResponse getMessage() {
136 | return requestResponse;
137 | }
138 |
139 | /**
140 | * Set the comment.
141 | *
142 | * @param comment
143 | * The comment.
144 | */
145 | public void setComment(String comment) {
146 | this.comment = comment;
147 | }
148 |
149 | /**
150 | * Get the payload type ordinal value.
151 | *
152 | * @return The payload type ordinal value.
153 | */
154 | public String getPayloadType() {
155 | return payloadType;
156 | }
157 |
158 | /**
159 | * Set the payload type hex string representation.
160 | *
161 | * @param payloadType
162 | * The hex string representation value of the payload type.
163 | */
164 | public void setPayloadType(int payloadType) {
165 | this.payloadType = (payloadType > -1) ? String.format("0x%02X", payloadType) : "";
166 | }
167 | }
168 |
--------------------------------------------------------------------------------
/doc/eu/dety/burp/joseph/gui/editor/package-summary.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | * This program is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU General Public License as published by the Free Software
7 | * Foundation; either version 2 of the License, or (at your option) any later
8 | * version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 | * details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with
16 | * this program; if not, write to the Free Software Foundation, Inc., 51
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | package eu.dety.burp.joseph.attacks.__attack_template;
20 |
21 | import burp.IBurpExtenderCallbacks;
22 | import burp.IExtensionHelpers;
23 | import burp.IHttpRequestResponse;
24 | import burp.IRequestInfo;
25 | import eu.dety.burp.joseph.attacks.AttackPreparationFailedException;
26 | import eu.dety.burp.joseph.attacks.IAttackInfo;
27 | import eu.dety.burp.joseph.utilities.JoseParameter;
28 |
29 | import javax.swing.*;
30 | import java.awt.*;
31 | import java.util.ArrayList;
32 | import java.util.HashMap;
33 | import java.util.List;
34 |
35 | /**
36 | * Attack Template Attack Info
37 | *
38 | * @author Dennis Detering
39 | * @version 1.0
40 | */
41 | public class AttackTemplateInfo implements IAttackInfo {
42 | private IExtensionHelpers helpers;
43 | private IHttpRequestResponse requestResponse;
44 | private JoseParameter parameter;
45 |
46 | // Unique identifier for the attack class
47 | private static final String id = "attack_template";
48 |
49 | // Full name of the attack
50 | private static final String name = "Attack Template";
51 |
52 | // Attack description
53 | private static final String description = "The Attack Template attack description...";
54 |
55 | // Hashmap of available payloads with a verbose name (including the
56 | // PayloadType)
57 | private static final HashMapDeprecated API
66 | Contents
67 | Constant Field Values
66 | Contents
67 | Class Hierarchy
73 |
74 |
80 |
76 |
78 | Package burp
66 |
69 |
87 |
71 |
85 |
73 |
76 |
77 | Class
74 | Description
75 |
78 |
83 |
84 | BurpExtender
79 |
80 |
82 | Hierarchy For Package eu.dety.burp.joseph.scanner
66 | Package Hierarchies:
67 |
68 |
70 | Class Hierarchy
73 |
74 |
80 |
76 |
78 | Hierarchy For Package eu.dety.burp.joseph
66 | Package Hierarchies:
67 |
68 |
70 | Class Hierarchy
73 |
74 |
81 |
76 |
79 | Hierarchy For Package eu.dety.burp.joseph.exceptions
66 | Package Hierarchies:
67 |
68 |
70 | Class Hierarchy
73 |
74 |
88 |
76 |
86 |
78 |
84 |
80 |
82 | Package eu.dety.burp.joseph.scanner
66 |
69 |
87 |
71 |
85 |
73 |
76 |
77 | Class
74 | Description
75 |
78 |
83 |
84 | Marker
79 |
80 |
82 | Package eu.dety.burp.joseph.gui.editor
66 |
69 |
87 |
71 |
85 |
73 |
76 |
77 | Class
74 | Description
75 |
78 |
83 |
84 | UISourceViewer
79 |
80 |
82 | Package eu.dety.burp.joseph.exceptions
66 |
69 |
87 |
71 |
85 |
73 |
76 |
77 | Exception
74 | Description
75 |
78 |
83 |
84 | AttackPreparationFailedException
79 |
80 |
82 | Package eu.dety.burp.joseph.editor
66 | Hierarchy For Package eu.dety.burp.joseph.gui.editor
66 | Package Hierarchies:
67 |
68 |
70 | Class Hierarchy
73 |
74 |
96 |
76 |
94 |
78 |
92 |
80 |
90 |
82 |
88 |
84 |
86 | Package eu.dety.burp.joseph
66 |
69 |
94 |
71 |
92 |
73 |
76 |
77 | Class
74 | Description
75 |
78 |
84 | BurpExtenderCallbacksMock
79 |
80 |
83 | IBurpExtenderCallbacks to mock Burp's behavior for extender callbacks to be able to write according
81 | unit tests.
85 |
90 |
91 | BurpParameterMock
86 |
87 |
89 | IParameter to mock Burp's behavior for parameters to be able to write according unit tests.