├── 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 | 3 | 4 | CUSTOM-license:format 5 | license:format 6 | 7 | license:format 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /doc/package-list: -------------------------------------------------------------------------------- 1 | burp 2 | eu.dety.burp.joseph 3 | eu.dety.burp.joseph.attacks 4 | eu.dety.burp.joseph.attacks.__attack_template 5 | eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1 6 | eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1.gui 7 | eu.dety.burp.joseph.attacks.key_confusion 8 | eu.dety.burp.joseph.attacks.signature_exclusion 9 | eu.dety.burp.joseph.editor 10 | eu.dety.burp.joseph.gui 11 | eu.dety.burp.joseph.gui.table 12 | eu.dety.burp.joseph.scanner 13 | eu.dety.burp.joseph.utilities 14 | -------------------------------------------------------------------------------- /doc/burp/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | burp 7 | 8 | 9 | 10 | 11 |

burp

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | ============ 2 | 2020-06-06 3 | ============ 4 | 5 | 1.0.3 6 | Additional signature exclusion test cases, where the original signature is _not_ removed. 7 | Issue: https://github.com/RUB-NDS/JOSEPH/issues/14 8 | 9 | OpenJDK11 support for automated TravisCI tests. Refactoring converter test setup to not need manual security provider configuration. 10 | 11 | 12 | ============ 13 | 2019-01-09 14 | ============ 15 | 16 | 1.0.2 17 | Fixing double base64 encoding bug for the signature value within the manual tab. 18 | Issue: https://github.com/RUB-NDS/JOSEPH/issues/20 19 | 20 | 21 | ============ 22 | 2017-11-14 23 | ============ 24 | 25 | 1.0.1 26 | Additional key confusion public key transformation added. 27 | 28 | 29 | ============ 30 | 2016-11-28 31 | ============ 32 | 33 | 1.0.0 34 | Initial release of version 1.0.0 (BETA) 35 | -------------------------------------------------------------------------------- /license_header.txt: -------------------------------------------------------------------------------- 1 | JOSEPH - JavaScript Object Signing and Encryption Pentesting Helper 2 | Copyright (C) ${year} ${owner} 3 |

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 | eu.dety.burp.joseph.scanner 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.scanner

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/gui/editor/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.gui.editor 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.gui.editor

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/exceptions/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.exceptions 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.exceptions

12 |
13 |

Exceptions

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/editor/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.editor 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.editor

12 |
13 |

Classes

14 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph

12 |
13 |

Classes

14 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/gui/table/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.gui.table 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.gui.table

12 |
13 |

Classes

14 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/attacks/KeyConfusion/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.attacks.key_confusion 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.attacks.key_confusion

12 |
13 |

Classes

14 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/IAttack.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 | * 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 | eu.dety.burp.joseph.attacks.__attack_template 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.attacks.__attack_template

12 |
13 |

Classes

14 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/attacks/__attack_template/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.attacks.__attack_template 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.attacks.__attack_template

12 |
13 |

Classes

14 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/attacks/SignatureExclusion/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.attacks.signature_exclusion 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.attacks.signature_exclusion

12 |
13 |

Classes

14 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/attacks/key_confusion/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.attacks.key_confusion 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.attacks.key_confusion

12 |
13 |

Classes

14 | 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/attacks/signature_exclusion/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.attacks.signature_exclusion 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.attacks.signature_exclusion

12 |
13 |

Classes

14 | 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/utilities/DecryptionFailedException.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 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 | eu.dety.burp.joseph.attacks 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.attacks

12 |
13 |

Interfaces

14 | 18 |

Classes

19 | 23 |

Exceptions

24 | 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/AttackPreparationFailedException.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 | * 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 | eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1.gui 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1.gui

12 |
13 |

Classes

14 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/attacks/bleichenbacher_pkcs1/gui/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1.gui 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1.gui

12 |
13 |

Classes

14 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/bleichenbacher_pkcs1/Interval.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 | 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 | eu.dety.burp.joseph.gui 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.gui

12 |
13 |

Classes

14 | 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/attacks/BleichenbacherPkcs1/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1

12 |
13 |

Classes

14 | 21 |

Enums

22 | 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/__attack_template/AttackTemplateAttackRequest.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.__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 | eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1

12 |
13 |

Classes

14 | 22 |

Enums

23 | 26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/signature_exclusion/SignatureExclusionAttackRequest.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.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 | Overview List 7 | 8 | 9 | 10 | 11 |

All Classes
12 |
13 |

Packages

14 | 29 |
30 |

 

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 | ![licence](https://img.shields.io/badge/License-GPLv2-brightgreen.svg) 3 | [![release](https://img.shields.io/badge/Release-v1.0.3-blue.svg)](https://github.com/RUB-NDS/JOSEPH/releases) 4 | ![status](https://img.shields.io/badge/Status-beta-yellow.svg) 5 | [![travis](https://travis-ci.org/RUB-NDS/JOSEPH.svg?branch=master)](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 | eu.dety.burp.joseph.utilities 7 | 8 | 9 | 10 | 11 |

eu.dety.burp.joseph.utilities

12 |
13 |

Classes

14 | 27 |

Enums

28 | 33 |

Exceptions

34 | 38 |
39 | 40 | 41 | -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Generated Documentation (Untitled) 7 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | <noscript> 68 | <div>JavaScript is disabled on your browser.</div> 69 | </noscript> 70 | <h2>Frame Alert</h2> 71 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/key_confusion/KeyConfusionAttackRequest.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.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 getRegisteredAttackInstances(IBurpExtenderCallbacks callbacks) { 45 | HashMap registeredAttackInstances = new HashMap<>(); 46 | 47 | /* Signature Exclusion Attack */ 48 | SignatureExclusionInfo signatureExclusionInfo = new SignatureExclusionInfo(callbacks); 49 | registeredAttackInstances.put(signatureExclusionInfo.getName(), signatureExclusionInfo); 50 | loggerInstance.log(AttackLoader.class, "Attack registered: Signature Exclusion", Logger.LogLevel.INFO); 51 | 52 | /* Key Confusion Attack (aka. Algorithm Substitution) */ 53 | KeyConfusionInfo keyConfusionInfo = new KeyConfusionInfo(callbacks); 54 | registeredAttackInstances.put(keyConfusionInfo.getName(), keyConfusionInfo); 55 | loggerInstance.log(AttackLoader.class, "Attack registered: Key Confusion", Logger.LogLevel.INFO); 56 | 57 | /* Bleichenbacher Attack on RSA PKCS#1 v1.5 */ 58 | BleichenbacherPkcs1Info bleichenbacherPkcs1Info = new BleichenbacherPkcs1Info(callbacks); 59 | registeredAttackInstances.put(bleichenbacherPkcs1Info.getName(), bleichenbacherPkcs1Info); 60 | loggerInstance.log(AttackLoader.class, "Attack registered: Bleichenbacher PKCS#1 v1.5", Logger.LogLevel.INFO); 61 | 62 | /* Attack Template Attack */ 63 | // AttackTemplateInfo attackTemplateInfo = new AttackTemplateInfo(callbacks); 64 | // registeredAttackInstances.put(attackTemplateInfo.getName(), attackTemplateInfo); 65 | // loggerInstance.log(AttackLoader.class, "Attack registered: Attack Template", Logger.LogLevel.INFO); 66 | 67 | return registeredAttackInstances; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/utilities/Logger.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 | 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:

  • {@link #ERROR}
  • 42 | * {@link #INFO}
  • {@link #DEBUG}
  • 43 | */ 44 | public enum LogLevel { 45 | ERROR, 46 | INFO, 47 | DEBUG 48 | } 49 | 50 | private Logger() { 51 | stdout = BurpExtender.getStdOut(); 52 | stderr = BurpExtender.getStdErr(); 53 | } 54 | 55 | /** 56 | * Singleton pattern to ensure a single instance 57 | */ 58 | private static class SingletonHolder { 59 | private static final Logger INSTANCE = new Logger(); 60 | } 61 | 62 | /** 63 | * Get the Instance of the Logger. 64 | * 65 | * @return Logger instance. 66 | */ 67 | public static Logger getInstance() { 68 | return SingletonHolder.INSTANCE; 69 | } 70 | 71 | /** 72 | * Log a specific message on a logging level. 73 | * 74 | * @param callingClass 75 | * The calling class. 76 | * @param message 77 | * The message to log. 78 | * @param logType 79 | * The logging type. 80 | */ 81 | public void log(Class callingClass, String message, LogLevel logType) { 82 | // Get current time 83 | Calendar calObj = Calendar.getInstance(); 84 | SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); 85 | String time = dateFormat.format(calObj.getTime()); 86 | 87 | // Choose correct output stream 88 | PrintWriter outputStream; 89 | outputStream = (Objects.equals(logType, LogLevel.ERROR)) ? stderr : stdout; 90 | 91 | // Check if message should be logged based on current log level 92 | // preference 93 | if (outputStream != null && logType.ordinal() <= PreferencesPanel.getLogLevel()) { 94 | String logTypeName = logType.name(); 95 | 96 | // Print log message 97 | String logOutput = String.format("[%s] %s - [%s]: %s ", logTypeName, time, callingClass.getSimpleName(), message); 98 | outputStream.println(logOutput); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /doc/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Deprecated List 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
    22 | 23 | 24 | 25 | 26 | 35 |
    36 | 63 | 64 |
    65 |

    Deprecated API

    66 |

    Contents

    67 |
    68 | 69 |
    70 | 71 | 72 | 73 | 74 | 83 |
    84 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/gui/HelpPanel.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; 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 | // //GEN-BEGIN:initComponents 43 | private void initComponents() { 44 | 45 | headlineLabel = new javax.swing.JLabel(); 46 | descriptionLabel = new javax.swing.JLabel(); 47 | copyrightLabel = new javax.swing.JLabel(); 48 | 49 | headlineLabel.setFont(new java.awt.Font("Lucida Grande", Font.BOLD, 18)); // NOI18N 50 | java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("JOSEPH"); // NOI18N 51 | headlineLabel.setText(bundle.getString("NAME_WITH_VERSION")); // NOI18N 52 | 53 | descriptionLabel.setText(bundle.getString("NAME_LONG")); // NOI18N 54 | 55 | copyrightLabel.setText(bundle.getString("COPYRIGHT")); // NOI18N 56 | 57 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); 58 | this.setLayout(layout); 59 | layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( 60 | layout.createSequentialGroup() 61 | .addContainerGap() 62 | .addGroup( 63 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(headlineLabel) 64 | .addComponent(descriptionLabel).addComponent(copyrightLabel)).addContainerGap(24, Short.MAX_VALUE))); 65 | layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 66 | .addGroup( 67 | layout.createSequentialGroup().addContainerGap().addComponent(headlineLabel) 68 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(descriptionLabel) 69 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(copyrightLabel) 70 | .addContainerGap(228, Short.MAX_VALUE))); 71 | }// //GEN-END:initComponents 72 | 73 | // Variables declaration - do not modify//GEN-BEGIN:variables 74 | private javax.swing.JLabel copyrightLabel; 75 | private javax.swing.JLabel descriptionLabel; 76 | private javax.swing.JLabel headlineLabel; 77 | // End of variables declaration//GEN-END:variables 78 | } 79 | -------------------------------------------------------------------------------- /doc/constant-values.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Constant Field Values 7 | 8 | 9 | 10 | 11 | 17 |

    JavaScript is disabled on your browser.
    19 | 20 | 21 |
    22 | 23 | 24 | 25 | 26 | 35 |
    36 | 63 | 64 |
    65 |

    Constant Field Values

    66 |

    Contents

    67 |
    68 | 69 |
    70 | 71 | 72 | 73 | 74 | 83 |
    84 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/gui/table/Table.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 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 tableEntries; 37 | 38 | /** 39 | * Create a new Table. 40 | * 41 | * @param tableModel 42 | * The helper to organise the table entries. 43 | */ 44 | public Table(TableModel tableModel) { 45 | super(tableModel); 46 | this.tableModel = tableModel; 47 | this.tableEntries = tableModel.getTableEntries(); 48 | 49 | // Add mouseListener to select row on mouse click 50 | final Table parent = this; 51 | this.addMouseListener(new MouseAdapter() { 52 | public void mouseReleased(MouseEvent event) { 53 | // selects the row at which point the mouse is clicked 54 | Point point = event.getPoint(); 55 | int currentRow = parent.rowAtPoint(point); 56 | parent.setRowSelectionInterval(currentRow, currentRow); 57 | } 58 | }); 59 | 60 | // Enable sorting 61 | TableRowSorter sorter = new TableRowSorter<>(); 62 | sorter.setModel(this.getModel()); 63 | this.setRowSorter(sorter); 64 | this.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); 65 | } 66 | 67 | /** 68 | * Get the {@link TableModel}. 69 | * 70 | * @return The {@link TableModel} related to the table. 71 | */ 72 | public TableModel getTableModel() { 73 | return tableModel; 74 | } 75 | 76 | /** 77 | * Get all {@link TableEntry}s 78 | * 79 | * @return Get a list of table entries 80 | */ 81 | public ArrayList getTableList() { 82 | return tableEntries; 83 | } 84 | 85 | /** 86 | * Update the table the full history. 87 | * 88 | * @param entry 89 | * {@link TableEntry} 90 | */ 91 | public void addEntry(TableEntry entry) { 92 | tableModel.addRow(entry); 93 | } 94 | 95 | /** 96 | * Get the {@link TableEntry} at specific index. 97 | * 98 | * @param index 99 | * The index. 100 | * @return {@link TableEntry} 101 | */ 102 | public TableEntry getEntry(int index) { 103 | return tableEntries.get(index); 104 | } 105 | 106 | /** 107 | * Get the {@link TableEntry} by row index. 108 | * 109 | * @param index 110 | * The row index. 111 | * @return {@link TableEntry} 112 | */ 113 | public TableEntry getEntryByRow(int index) { 114 | return tableEntries.get(convertRowIndexToModel(index)); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/bleichenbacher_pkcs1/BleichenbacherPkcs1Oracle.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 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 validResponses = new ArrayList<>(); 43 | 44 | public enum Result { 45 | VALID, 46 | INVALID 47 | } 48 | 49 | public BleichenbacherPkcs1Oracle(final IBurpExtenderCallbacks callbacks, List responseCandidates) { 50 | this.helpers = callbacks.getHelpers(); 51 | 52 | buildResponseList(responseCandidates); 53 | } 54 | 55 | /** 56 | * Build a list of responses indicating PKCS1 correctness 57 | * 58 | * @param responseCandidates 59 | * List of {@link BleichenbacherPkcs1TableEntry} selected by the user as candidates 60 | */ 61 | private void buildResponseList(List responseCandidates) { 62 | outerloop: for (BleichenbacherPkcs1TableEntry entry : responseCandidates) { 63 | 64 | double tempScore; 65 | for (String validResponse : validResponses) { 66 | tempScore = metric.compare(helpers.bytesToString(entry.getMessage().getResponse()), validResponse); 67 | 68 | // If entry score is higher than threshold, don't add new entry 69 | if (COMPARE_THRESHOLD <= tempScore) { 70 | continue outerloop; 71 | } 72 | } 73 | 74 | validResponses.add(helpers.bytesToString(entry.getMessage().getResponse())); 75 | } 76 | } 77 | 78 | /** 79 | * Check wheter the given response is valid or not according to the current oracle 80 | * 81 | * @param response 82 | * Byte array with the response 83 | * @return {@link Result} status 84 | */ 85 | public Result getResult(byte[] response) { 86 | for (String validResponse : validResponses) { 87 | if (metric.compare(helpers.bytesToString(response), validResponse) >= COMPARE_THRESHOLD) { 88 | loggerInstance.log(getClass(), "Considered PKCS conform - Score: " + metric.compare(helpers.bytesToString(response), validResponse), 89 | Logger.LogLevel.INFO); 90 | return Result.VALID; 91 | } 92 | } 93 | 94 | return Result.INVALID; 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/gui/AttackerInfoPanel.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |

    4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/gui/HelpPanel.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/bleichenbacher_pkcs1/gui/BleichenbacherPkcs1Table.java: -------------------------------------------------------------------------------- 1 | package eu.dety.burp.joseph.attacks.bleichenbacher_pkcs1.gui; 2 | 3 | /** 4 | * JOSEPH - JavaScript Object Signing and Encryption Pentesting Helper 5 | * Copyright (C) 2016 Dennis Detering 6 | *

    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 tableEntries; 38 | 39 | /** 40 | * Create a new Table. 41 | * 42 | * @param tableModel 43 | * The helper to organise the table entries. 44 | */ 45 | public BleichenbacherPkcs1Table(BleichenbacherPkcs1TableModel tableModel) { 46 | super(tableModel); 47 | this.tableModel = tableModel; 48 | this.tableEntries = tableModel.getTableEntries(); 49 | 50 | // Add mouseListener to select row on mouse click 51 | final BleichenbacherPkcs1Table parent = this; 52 | this.addMouseListener(new MouseAdapter() { 53 | public void mouseReleased(MouseEvent event) { 54 | // selects the row at which point the mouse is clicked 55 | Point point = event.getPoint(); 56 | int currentRow = parent.rowAtPoint(point); 57 | parent.setRowSelectionInterval(currentRow, currentRow); 58 | } 59 | }); 60 | 61 | // Enable sorting 62 | TableRowSorter sorter = new TableRowSorter<>(); 63 | sorter.setModel(this.getModel()); 64 | this.setRowSorter(sorter); 65 | this.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); 66 | } 67 | 68 | /** 69 | * Get the {@link BleichenbacherPkcs1TableModel}. 70 | * 71 | * @return The {@link BleichenbacherPkcs1TableModel} related to the table. 72 | */ 73 | public BleichenbacherPkcs1TableModel getTableModel() { 74 | return tableModel; 75 | } 76 | 77 | /** 78 | * Get all {@link BleichenbacherPkcs1TableEntry}s 79 | * 80 | * @return Get a list of table entries 81 | */ 82 | public ArrayList getTableList() { 83 | return tableEntries; 84 | } 85 | 86 | /** 87 | * Update the table the full history. 88 | * 89 | * @param entry 90 | * {@link BleichenbacherPkcs1TableEntry} 91 | */ 92 | public void addEntry(BleichenbacherPkcs1TableEntry entry) { 93 | tableModel.addRow(entry); 94 | } 95 | 96 | /** 97 | * Get the {@link BleichenbacherPkcs1TableEntry} at specific index. 98 | * 99 | * @param index 100 | * The index. 101 | * @return {@link BleichenbacherPkcs1TableEntry} 102 | */ 103 | public BleichenbacherPkcs1TableEntry getEntry(int index) { 104 | return tableEntries.get(index); 105 | } 106 | 107 | /** 108 | * Get the {@link BleichenbacherPkcs1TableEntry} by row index. 109 | * 110 | * @param index 111 | * The row index. 112 | * @return {@link BleichenbacherPkcs1TableEntry} 113 | */ 114 | public BleichenbacherPkcs1TableEntry getEntryByRow(int index) { 115 | return tableEntries.get(convertRowIndexToModel(index)); 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/scanner/Marker.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.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 | 6 | burp Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 |

    JavaScript is disabled on your browser.
    19 | 20 | 21 |
    22 | 23 | 24 | 25 | 26 | 35 |
    36 | 63 | 64 |
    65 |

    Hierarchy For Package burp

    66 | Package Hierarchies: 67 | 70 |
    71 |
    72 |

    Class Hierarchy

    73 |
      74 |
    • java.lang.Object 75 |
        76 |
      • burp.BurpExtender (implements burp.IBurpExtender, burp.IExtensionStateListener)
      • 77 |
      78 |
    • 79 |
    80 |
    81 | 82 |
    83 | 84 | 85 | 86 | 87 | 96 |
    97 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/gui/AttackerInfoPanel.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; 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 | // //GEN-BEGIN:initComponents 42 | private void initComponents() { 43 | 44 | attackerInfoHeadlineLabel = new javax.swing.JLabel(); 45 | jSeparator1 = new javax.swing.JSeparator(); 46 | attackerInfoContentLabel = new javax.swing.JLabel(); 47 | 48 | attackerInfoHeadlineLabel.setFont(new java.awt.Font("Lucida Grande", Font.BOLD, 13)); // NOI18N 49 | java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("JOSEPH"); // NOI18N 50 | attackerInfoHeadlineLabel.setText(bundle.getString("LOGGING_HEADLINE")); // NOI18N 51 | attackerInfoHeadlineLabel.setName("attackerInfoHeadlineLabel"); // NOI18N 52 | 53 | attackerInfoContentLabel 54 | .setText("How to:

    • Navigate to the PROXY tab
    • Right click on a (marked) request with a JOSE value
    • Click \"Send to JOSEPH\"
    • "); 55 | 56 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); 57 | this.setLayout(layout); 58 | layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( 59 | javax.swing.GroupLayout.Alignment.TRAILING, 60 | layout.createSequentialGroup() 61 | .addContainerGap() 62 | .addGroup( 63 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 64 | .addComponent(attackerInfoContentLabel) 65 | .addGroup(javax.swing.GroupLayout.Alignment.LEADING, 66 | layout.createSequentialGroup().addComponent(attackerInfoHeadlineLabel).addGap(0, 173, Short.MAX_VALUE)) 67 | .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING)).addContainerGap())); 68 | layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( 69 | layout.createSequentialGroup().addContainerGap().addComponent(attackerInfoHeadlineLabel) 70 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 71 | .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) 72 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 73 | .addComponent(attackerInfoContentLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) 74 | .addContainerGap(156, Short.MAX_VALUE))); 75 | }// //GEN-END:initComponents 76 | 77 | // Variables declaration - do not modify//GEN-BEGIN:variables 78 | private javax.swing.JLabel attackerInfoContentLabel; 79 | private javax.swing.JLabel attackerInfoHeadlineLabel; 80 | private javax.swing.JSeparator jSeparator1; 81 | // End of variables declaration//GEN-END:variables 82 | } 83 | -------------------------------------------------------------------------------- /doc/burp/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | burp 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
      22 | 23 | 24 | 25 | 26 | 35 |
      36 | 63 | 64 |
      65 |

      Package burp

      66 |
      67 |
      68 |
        69 |
      • 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 82 | 83 | 84 |
        Class Summary 
        ClassDescription
        BurpExtender 80 |
        The Burp Extender to register the JOSEPH extension
        81 |
        85 |
      • 86 |
      87 |
      88 | 89 |
      90 | 91 | 92 | 93 | 94 | 103 |
      104 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/__attack_template/AttackTemplate.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.__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 responses = new ArrayList<>(); 46 | private IHttpService httpService; 47 | 48 | public AttackTemplate(IBurpExtenderCallbacks callbacks, AttackTemplateInfo attackInfo) { 49 | this.callbacks = callbacks; 50 | this.attackInfo = attackInfo; 51 | this.httpService = this.attackInfo.getRequestResponse().getHttpService(); 52 | } 53 | 54 | @Override 55 | public void performAttack() { 56 | // Create attacker result window 57 | attackerResultWindow = new AttackerResultWindow(attackInfo.getName(), callbacks); 58 | 59 | // Add original message to result table 60 | attackerResultWindow.addEntry(new TableEntry(0, -1, "", attackInfo.getRequestResponse(), callbacks)); 61 | 62 | // Create new AttackExecutor thread for each prepared request 63 | for (AttackTemplateAttackRequest attackRequest : this.attackInfo.getRequests()) { 64 | AttackExecutor attackRequestExecutor = new AttackExecutor(attackRequest); 65 | attackRequestExecutor.execute(); 66 | } 67 | } 68 | 69 | /** 70 | * Attack Executor 71 | *

      72 | * Performs the actual request and updates related widgets 73 | */ 74 | private class AttackExecutor extends SwingWorker { 75 | private AttackTemplateAttackRequest attackRequest; 76 | 77 | AttackExecutor(AttackTemplateAttackRequest attackRequest) { 78 | this.attackRequest = attackRequest; 79 | } 80 | 81 | @Override 82 | // Fire prepared request and return responses as IHttpRequestResponse 83 | protected IHttpRequestResponse doInBackground() { 84 | return callbacks.makeHttpRequest(httpService, attackRequest.getRequest()); 85 | } 86 | 87 | @Override 88 | // Add response to response list, add new entry to attacker result 89 | // window table and update process bar 90 | protected void done() { 91 | IHttpRequestResponse requestResponse; 92 | try { 93 | requestResponse = get(); 94 | } catch (InterruptedException | ExecutionException e) { 95 | loggerInstance.log(AttackTemplate.class, "Failed to get request result: " + e.getMessage(), Logger.LogLevel.ERROR); 96 | return; 97 | } 98 | 99 | // Add response to response list 100 | responses.add(requestResponse); 101 | 102 | // Add new entry to result table 103 | attackerResultWindow.addEntry(new TableEntry(responses.size(), attackRequest.getPayloadType(), attackRequest.getPayload(), requestResponse, 104 | callbacks)); 105 | 106 | // Update the progress bar 107 | attackerResultWindow.setProgressBarValue(responses.size(), attackInfo.getAmountRequests()); 108 | 109 | loggerInstance.log(getClass(), "Attack done, amount responses: " + String.valueOf(responses.size()), Logger.LogLevel.DEBUG); 110 | } 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/IAttackInfo.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 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 getRequests(); 115 | 116 | /** 117 | * Get list of available payloads 118 | * 119 | * @return HashMap with PayloadType and explaining name 120 | */ 121 | HashMap getPayloadList(); 122 | 123 | /** 124 | * Get HashMap with modified header, payload, signature values 125 | * 126 | * @param payloadType 127 | * The payload type identifier 128 | * @param header 129 | * The header JSON string 130 | * @param payload 131 | * The payload JSON string 132 | * @param signature 133 | * The signature base64url string 134 | * @throws AttackPreparationFailedException 135 | * if error occurs during preparation step 136 | * @return HashMap with modified header, payload, signature values 137 | */ 138 | HashMap updateValuesByPayload(Enum payloadType, String header, String payload, String signature) throws AttackPreparationFailedException; 139 | 140 | } 141 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/scanner/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.scanner Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 |

      JavaScript is disabled on your browser.
      19 | 20 | 21 |
      22 | 23 | 24 | 25 | 26 | 35 |
      36 | 63 | 64 |
      65 |

      Hierarchy For Package eu.dety.burp.joseph.scanner

      66 | Package Hierarchies: 67 | 70 |
      71 |
      72 |

      Class Hierarchy

      73 |
        74 |
      • java.lang.Object 75 |
          76 |
        • eu.dety.burp.joseph.scanner.Marker (implements burp.IHttpListener)
        • 77 |
        78 |
      • 79 |
      80 |
      81 | 82 |
      83 | 84 | 85 | 86 | 87 | 96 |
      97 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /src/main/java/burp/BurpExtender.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 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 tableEntries; 35 | private String[] columnName = { "#", "Payload type", "Payload", "Status", "Length", "Time", "Comment" }; 36 | 37 | /** 38 | * Construct a new table helper 39 | * 40 | * @param tableEntries 41 | * A list of table entries. 42 | */ 43 | public TableModel(ArrayList tableEntries) { 44 | this.tableEntries = tableEntries; 45 | } 46 | 47 | /** 48 | * Get the tableEntries list. 49 | * 50 | * @return The list of {@link TableEntry}. 51 | */ 52 | public ArrayList getTableEntries() { 53 | return tableEntries; 54 | } 55 | 56 | /** 57 | * Add a row to the tableEntries list. 58 | * 59 | * @param entry 60 | * The new table row. 61 | * @return True if successful, false otherwise. 62 | */ 63 | public boolean addRow(TableEntry entry) { 64 | try { 65 | int row = tableEntries.size(); 66 | tableEntries.add(entry); 67 | fireTableRowsInserted(row, row); 68 | } catch (Exception e) { 69 | return false; 70 | } 71 | return true; 72 | } 73 | 74 | /** 75 | * Remove all entries from the tableEntries list. 76 | * 77 | * @return True if all entries cleared, false otherwise. 78 | */ 79 | public boolean clear() { 80 | try { 81 | tableEntries.clear(); 82 | fireTableDataChanged(); 83 | } catch (Exception e) { 84 | return false; 85 | } 86 | return true; 87 | } 88 | 89 | /** 90 | * Get the number of rows. 91 | * 92 | * @return Number of rows. 93 | */ 94 | @Override 95 | public int getRowCount() { 96 | return tableEntries.size(); 97 | } 98 | 99 | /** 100 | * Get the number of columns 101 | * 102 | * @return Number of columns. 103 | */ 104 | @Override 105 | public int getColumnCount() { 106 | return columnName.length; 107 | } 108 | 109 | /** 110 | * Get the name of the column at a specific index. 111 | * 112 | * @param columnIndex 113 | * Index of the column. 114 | * @return The name of the column. 115 | */ 116 | @Override 117 | public String getColumnName(int columnIndex) { 118 | try { 119 | return columnName[columnIndex]; 120 | } catch (Exception e) { 121 | loggerInstance.log(getClass(), e.getMessage(), Logger.LogLevel.ERROR); 122 | return ""; 123 | } 124 | } 125 | 126 | /** 127 | * Get the value at a position. 128 | * 129 | * @param rowIndex 130 | * The row. 131 | * @param columnIndex 132 | * The column. 133 | * @return Value for the specified entry. Null if not found. 134 | */ 135 | @Override 136 | public Object getValueAt(int rowIndex, int columnIndex) { 137 | TableEntry entry = tableEntries.get(rowIndex); 138 | 139 | switch (columnIndex) { 140 | case 0: 141 | return entry.getEntryIndex(); 142 | case 1: 143 | return entry.getPayloadType(); 144 | case 2: 145 | return entry.getPayload(); 146 | case 3: 147 | return entry.getStatus(); 148 | case 4: 149 | return entry.getLength(); 150 | case 5: 151 | return entry.getTime(); 152 | case 6: 153 | return entry.getComment(); 154 | default: 155 | return null; 156 | } 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/key_confusion/KeyConfusion.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.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 responses = new ArrayList<>(); 48 | private IHttpService httpService; 49 | 50 | public KeyConfusion(IBurpExtenderCallbacks callbacks, KeyConfusionInfo attackInfo) { 51 | this.callbacks = callbacks; 52 | this.attackInfo = attackInfo; 53 | this.httpService = this.attackInfo.getRequestResponse().getHttpService(); 54 | } 55 | 56 | @Override 57 | public void performAttack() { 58 | // Create attacker result window 59 | attackerResultWindow = new AttackerResultWindow(attackInfo.getName(), callbacks); 60 | 61 | // Add original message to result table 62 | attackerResultWindow.addEntry(new TableEntry(0, -1, "", attackInfo.getRequestResponse(), callbacks)); 63 | 64 | // Create new AttackExecutor thread for each prepared request 65 | for (KeyConfusionAttackRequest attackRequest : this.attackInfo.getRequests()) { 66 | AttackExecutor attackRequestExecutor = new AttackExecutor(attackRequest); 67 | attackRequestExecutor.execute(); 68 | } 69 | } 70 | 71 | /** 72 | * Attack Executor 73 | *

      74 | * Performs the actual request and updates related widgets 75 | */ 76 | private class AttackExecutor extends SwingWorker { 77 | private KeyConfusionAttackRequest attackRequest; 78 | 79 | AttackExecutor(KeyConfusionAttackRequest attackRequest) { 80 | this.attackRequest = attackRequest; 81 | } 82 | 83 | @Override 84 | // Fire prepared request and return responses as IHttpRequestResponse 85 | protected IHttpRequestResponse doInBackground() { 86 | return callbacks.makeHttpRequest(httpService, attackRequest.getRequest()); 87 | } 88 | 89 | @Override 90 | // Add response to response list, add new entry to attacker result 91 | // window table and update process bar 92 | protected void done() { 93 | 94 | IHttpRequestResponse requestResponse; 95 | try { 96 | requestResponse = get(); 97 | } catch (InterruptedException | ExecutionException e) { 98 | loggerInstance.log(KeyConfusion.class, "Failed to get request result: " + e.getMessage(), Logger.LogLevel.ERROR); 99 | return; 100 | } 101 | 102 | // Add response to response list 103 | responses.add(requestResponse); 104 | 105 | // Add new entry to result table 106 | String payload = "Alg: " + attackRequest.getAlgorithm() + " KeyLen: " + attackRequest.getKeyLength(); 107 | attackerResultWindow.addEntry(new TableEntry(responses.size(), attackRequest.getPayloadType(), payload, requestResponse, callbacks)); 108 | 109 | // Update the progress bar 110 | attackerResultWindow.setProgressBarValue(responses.size(), attackInfo.getAmountRequests()); 111 | 112 | loggerInstance.log(getClass(), "Attack done, amount responses: " + String.valueOf(responses.size()), Logger.LogLevel.DEBUG); 113 | } 114 | 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 |

      JavaScript is disabled on your browser.
      19 | 20 | 21 |
      22 | 23 | 24 | 25 | 26 | 35 |
      36 | 63 | 64 |
      65 |

      Hierarchy For Package eu.dety.burp.joseph

      66 | Package Hierarchies: 67 | 70 |
      71 |
      72 |

      Class Hierarchy

      73 | 81 |
      82 | 83 |
      84 | 85 | 86 | 87 | 88 | 97 |
      98 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/signature_exclusion/SignatureExclusion.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.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 responses = new ArrayList<>(); 49 | private IHttpService httpService; 50 | 51 | public SignatureExclusion(IBurpExtenderCallbacks callbacks, SignatureExclusionInfo attackInfo) { 52 | this.callbacks = callbacks; 53 | this.attackInfo = attackInfo; 54 | this.httpService = this.attackInfo.getRequestResponse().getHttpService(); 55 | } 56 | 57 | @Override 58 | public void performAttack() { 59 | // Create attacker result window 60 | attackerResultWindow = new AttackerResultWindow(attackInfo.getName(), callbacks); 61 | 62 | // Add original message to result table 63 | attackerResultWindow.addEntry(new TableEntry(0, -1, "", attackInfo.getRequestResponse(), callbacks)); 64 | 65 | // Create new AttackExecutor thread for each prepared request 66 | for (SignatureExclusionAttackRequest attackRequest : this.attackInfo.getRequests()) { 67 | AttackExecutor attackRequestExecutor = new AttackExecutor(attackRequest); 68 | attackRequestExecutor.execute(); 69 | } 70 | } 71 | 72 | /** 73 | * Attack Executor 74 | *

      75 | * Performs the actual request and updates related widgets 76 | */ 77 | private class AttackExecutor extends SwingWorker { 78 | private SignatureExclusionAttackRequest attackRequest; 79 | 80 | AttackExecutor(SignatureExclusionAttackRequest attackRequest) { 81 | this.attackRequest = attackRequest; 82 | } 83 | 84 | @Override 85 | // Fire prepared request and return responses as IHttpRequestResponse 86 | protected IHttpRequestResponse doInBackground() { 87 | return callbacks.makeHttpRequest(httpService, attackRequest.getRequest()); 88 | } 89 | 90 | @Override 91 | // Add response to response list, add new entry to attacker result 92 | // window table and update process bar 93 | protected void done() { 94 | IHttpRequestResponse requestResponse; 95 | try { 96 | requestResponse = get(); 97 | } catch (InterruptedException | ExecutionException e) { 98 | loggerInstance.log(SignatureExclusion.class, "Failed to get request result: " + e.getMessage(), Logger.LogLevel.ERROR); 99 | return; 100 | } 101 | 102 | // Add response to response list 103 | responses.add(requestResponse); 104 | 105 | // Add new entry to result table 106 | attackerResultWindow.addEntry(new TableEntry(responses.size(), attackRequest.getPayloadType(), "Alg: " + attackRequest.getPayload(), 107 | requestResponse, callbacks)); 108 | 109 | // Update the progress bar 110 | attackerResultWindow.setProgressBarValue(responses.size(), attackInfo.getAmountRequests()); 111 | 112 | loggerInstance.log(getClass(), "Attack done, amount responses: " + String.valueOf(responses.size()), Logger.LogLevel.DEBUG); 113 | } 114 | } 115 | 116 | } 117 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/exceptions/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.exceptions Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 |

      JavaScript is disabled on your browser.
      19 | 20 | 21 |
      22 | 23 | 24 | 25 | 26 | 35 |
      36 | 63 | 64 |
      65 |

      Hierarchy For Package eu.dety.burp.joseph.exceptions

      66 | Package Hierarchies: 67 | 70 |
      71 |
      72 |

      Class Hierarchy

      73 |
        74 |
      • java.lang.Object 75 |
          76 |
        • java.lang.Throwable (implements java.io.Serializable) 77 | 84 |
        • 85 |
        86 |
      • 87 |
      88 |
      89 | 90 |
      91 | 92 | 93 | 94 | 95 | 104 |
      105 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/scanner/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.scanner 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
      22 | 23 | 24 | 25 | 26 | 35 |
      36 | 63 | 64 |
      65 |

      Package eu.dety.burp.joseph.scanner

      66 |
      67 |
      68 |
        69 |
      • 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 82 | 83 | 84 |
        Class Summary 
        ClassDescription
        Marker 80 |
        HTTP listener to recognize and mark JOSE parameter
        81 |
        85 |
      • 86 |
      87 |
      88 | 89 |
      90 | 91 | 92 | 93 | 94 | 103 |
      104 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/bleichenbacher_pkcs1/gui/BleichenbacherPkcs1TableEntry.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.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 | 6 | eu.dety.burp.joseph.gui.editor 7 | 8 | 9 | 10 | 11 | 17 |

      JavaScript is disabled on your browser.
      19 | 20 | 21 |
      22 | 23 | 24 | 25 | 26 | 35 |
      36 | 63 | 64 |
      65 |

      Package eu.dety.burp.joseph.gui.editor

      66 |
      67 |
      68 |
        69 |
      • 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 82 | 83 | 84 |
        Class Summary 
        ClassDescription
        UISourceViewer 80 |
        Source Viewer.
        81 |
        85 |
      • 86 |
      87 |
      88 | 89 |
      90 | 91 | 92 | 93 | 94 | 103 |
      104 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/exceptions/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.exceptions 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
      22 | 23 | 24 | 25 | 26 | 35 |
      36 | 63 | 64 |
      65 |

      Package eu.dety.burp.joseph.exceptions

      66 |
      67 |
      68 |
        69 |
      • 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 82 | 83 | 84 |
        Exception Summary 
        ExceptionDescription
        AttackPreparationFailedException 80 |
        AttackPreparationFailedException
        81 |
        85 |
      • 86 |
      87 |
      88 | 89 |
      90 | 91 | 92 | 93 | 94 | 103 |
      104 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /src/main/java/eu/dety/burp/joseph/attacks/__attack_template/AttackTemplateInfo.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.__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 HashMap payloads = new HashMap<>(); 58 | static { 59 | /* 60 | * ADD YOUR ATTACK PAYLOADS HERE 61 | */ 62 | } 63 | 64 | // Amount of requests needed 65 | private static final int amountRequests = 0; 66 | 67 | // Types of payload variation 68 | enum PayloadType { 69 | /* 70 | * ADD YOUR PAYLOAD TYPES HERE 71 | */ 72 | } 73 | 74 | // List of AttackTemplateAttackRequest objects holding prepared attack 75 | // requests 76 | private List requests = new ArrayList<>(); 77 | 78 | public AttackTemplateInfo(IBurpExtenderCallbacks callbacks) { 79 | this.helpers = callbacks.getHelpers(); 80 | } 81 | 82 | @Override 83 | public AttackTemplate prepareAttack(IBurpExtenderCallbacks callbacks, IHttpRequestResponse requestResponse, IRequestInfo requestInfo, 84 | JoseParameter parameter) throws AttackPreparationFailedException { 85 | this.requestResponse = requestResponse; 86 | this.parameter = parameter; 87 | 88 | this.requests.clear(); 89 | 90 | try { 91 | /* 92 | * ADD YOUR ATTACK PREPARATION LOGIC HERE 93 | */ 94 | } catch (Exception e) { 95 | throw new AttackPreparationFailedException("Attack preparation failed. Message: " + e.getMessage()); 96 | } 97 | 98 | return new AttackTemplate(callbacks, this); 99 | } 100 | 101 | @Override 102 | public String getId() { 103 | return id; 104 | } 105 | 106 | @Override 107 | public String getName() { 108 | return name; 109 | } 110 | 111 | @Override 112 | public String getDescription() { 113 | return description; 114 | } 115 | 116 | @Override 117 | public int getAmountRequests() { 118 | return amountRequests; 119 | } 120 | 121 | @Override 122 | public boolean getExtraUI(JPanel extraPanel, GridBagConstraints constraints) { 123 | /* 124 | * CHANGE IF EXTRA UI IS NEEDED 125 | */ 126 | return false; 127 | } 128 | 129 | @Override 130 | public boolean isSuitable(JoseParameter.JoseType type, String algorithm) { 131 | /* 132 | * CHANGE TO CHECK SUITABILITY 133 | */ 134 | return true; 135 | } 136 | 137 | @Override 138 | public IHttpRequestResponse getRequestResponse() { 139 | return this.requestResponse; 140 | } 141 | 142 | @Override 143 | public List getRequests() { 144 | return this.requests; 145 | } 146 | 147 | @Override 148 | public HashMap getPayloadList() { 149 | return payloads; 150 | } 151 | 152 | @Override 153 | public HashMap updateValuesByPayload(Enum payloadTypeId, String header, String payload, String signature) { 154 | HashMap result = new HashMap<>(); 155 | 156 | /* 157 | * ADD YOUR ATTACK PAYLOAD LOGIC HERE 158 | */ 159 | 160 | return result; 161 | } 162 | 163 | } 164 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/editor/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.editor 7 | 8 | 9 | 10 | 11 | 17 |

      JavaScript is disabled on your browser.
      19 | 20 | 21 |
      22 | 23 | 24 | 25 | 26 | 35 |
      36 | 63 | 64 |
      65 |

      Package eu.dety.burp.joseph.editor

      66 |
      67 |
      68 |
        69 |
      • 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 82 | 83 | 84 | 85 | 88 | 89 | 90 |
        Class Summary 
        ClassDescription
        JweEditor 80 |
        JSON Web Encryption (JWE) Editor.
        81 |
        JwsEditor 86 |
        JSON Web Signature (JWS) Editor.
        87 |
        91 |
      • 92 |
      93 |
      94 | 95 |
      96 | 97 | 98 | 99 | 100 | 109 |
      110 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/gui/editor/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph.gui.editor Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
      22 | 23 | 24 | 25 | 26 | 35 |
      36 | 63 | 64 |
      65 |

      Hierarchy For Package eu.dety.burp.joseph.gui.editor

      66 | Package Hierarchies: 67 | 70 |
      71 |
      72 |

      Class Hierarchy

      73 |
        74 |
      • java.lang.Object 75 |
          76 |
        • java.awt.Component (implements java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable) 77 |
            78 |
          • java.awt.Container 79 |
              80 |
            • javax.swing.JComponent (implements java.io.Serializable) 81 |
                82 |
              • javax.swing.JPanel (implements javax.accessibility.Accessible) 83 |
                  84 |
                • eu.dety.burp.joseph.gui.editor.UISourceViewer (implements burp.ITextEditor)
                • 85 |
                86 |
              • 87 |
              88 |
            • 89 |
            90 |
          • 91 |
          92 |
        • 93 |
        94 |
      • 95 |
      96 |
      97 | 98 |
      99 | 100 | 101 | 102 | 103 | 112 |
      113 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /doc/eu/dety/burp/joseph/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eu.dety.burp.joseph 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
      22 | 23 | 24 | 25 | 26 | 35 |
      36 | 63 | 64 |
      65 |

      Package eu.dety.burp.joseph

      66 |
      67 |
      68 |
        69 |
      • 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 83 | 84 | 85 | 86 | 89 | 90 | 91 |
        Class Summary 
        ClassDescription
        BurpExtenderCallbacksMock 80 |
        Simple class implementing IBurpExtenderCallbacks to mock Burp's behavior for extender callbacks to be able to write according 81 | unit tests.
        82 |
        BurpParameterMock 87 |
        Simple class implementing IParameter to mock Burp's behavior for parameters to be able to write according unit tests.
        88 |
        92 |
      • 93 |
      94 |
      95 | 96 |
      97 | 98 | 99 | 100 | 101 | 110 |
      111 | 138 | 139 | 140 | 141 | --------------------------------------------------------------------------------