From 5ae1f5942ca8bd3e582f95f97db2b00133b74487 Mon Sep 17 00:00:00 2001 From: James Hilliard Date: Wed, 27 May 2020 04:44:09 -0600 Subject: [PATCH] Add icontrol PGP decryption key --- src/binwalk/plugins/pgp.py | 69 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/src/binwalk/plugins/pgp.py b/src/binwalk/plugins/pgp.py index f38ee2fbf..a8d8e0633 100644 --- a/src/binwalk/plugins/pgp.py +++ b/src/binwalk/plugins/pgp.py @@ -132,12 +132,72 @@ class PgpDecryptor(binwalk.core.plugin.Plugin): ecT8nfMlydQ9WigmtkOPXCU19J2RlPSKt37ZC3VB51oqu1BSi+q5ObmaXSVUfX0y KjN9HiHVNBWJakFTAcTsDrCVm3WpTKZkDLS0IQTps/eB46vF7V97AIQ6 =UtFV +-----END PGP PRIVATE KEY BLOCK-----""" + + _6F6BE91DF2D929B6_KEY = """-----BEGIN PGP PRIVATE KEY BLOCK----- + +lQOYBE8fGU8BCACjfpRQ5T//ZGS5yHCMx4sktUxW2VQD0sknLJihOuQTX7IsNsTe +qvYY1C7GoGRX147CSYpteW1/nWnrTSncqjGaYNgbbJz43dIrPfJPJT4rH2YyaPxJ +jyayeS+/zZBtkS2MIQ+G6MwxH2BgY/w9anSgpkgsfwX8YZ2cJbJEhXUm7trZQa2Q +ctUuiNm3/s4WN9ZhIRlBYG0UkdGrDn4ietfU+Am5fRrkRtkN3sRSkTrtth1TS7Bk +kFkrS6Ncw3FXnrQW8Y0Cktblb4EN82DIyTgFX5e7b0FLXMriTBnUzFNB6zuAZphF +donc5duPsuI/oZJuya/Dq8TPha6zf6ftTDqhABEBAAEAB/4lH8SrUsbzpbb2dZRS +7yuB+BXfwaUBYj9RQR/eOmpYGNpzDjOpUP4lGKcPbJOkW5q7tKm1XoV13QdUSfb3 +t4Cgap2fqovBOdMzhPMstAr4DT7uMucYh+QUUg682X9SVc0XHNmy+1EEVXjToliA +FJhrcx5/1g8EpiC8+FVQmFJ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/HK5uZkEyuI0vDDAG6yR5wuLk8FZeCUiL0fC+V +DWISkqrP13cfgvloMD8hmSGFhkwYRrquAtuqSfFU6GccURsIA9wv97QPRwEhnSsq +578lH5m79jG9y81Ok8kAXii4Rw4ow1C/BACsaR07Cyt16KXmzq3zSEHcg0EEHbpm +pSb/AgdBoBJ9HBmRxInl3bAtYEY8Ikwo5XYFQ5NeAlkSLf1Pw02AlCU/R5iGR070 +T07tQTsxYASlZZHxRjFYGQfb48OJ7F+2mVBxPpouTeNUGG1E8tQG+djZbcBNWLOI +foxV9fRfnvvdfDpqiQEfBBgBAgAJBQJPHxlPAhsMAAoJEL5VIeHXUGonoGoH/RsH +m/M3uy1aZU6ke1wNiJaQAKF4BUGhvsfeGfHmUhXVN2bsWjxcN+3ECyfB04x08N5S +EZ+iVCG3Wqe1xrzFCLac+KiGeqJxSFrWaN3eYlchRk9ZKUX9rgBfwCzEE1NEWrkJ +nd8yGbCfC2XpbNbBfJoDsVyrfkAP0nT24UHK3BAAUp2glhguKtlXZme9oFy8AtOY +w2H5LPbdUkM/00bkbNPeiRDDw26dQ/BB/PNC1KXBSM0d8dCgzBF+L3cSAK3NrpcW +fYalnt/6kLvkRZzYqO2lUSkVTeTpZ9CdnEjZG6H3M9NeL3wtrktHbAW3gWuI9Vql +ZKRdu7NkEp9EYhvl/vM= +=vnXr -----END PGP PRIVATE KEY BLOCK-----""" EDDA2E82EDC7030C_SIGNATURE_DESCRIPTION = "PGP RSA encrypted session key - keyid: EDDA2E82 EDC7030C RSA".lower() F18B47DF3F881C75_SIGNATURE_DESCRIPTION = "PGP RSA encrypted session key - keyid: F18B47DF 3F881C75 RSA".lower() + _6F6BE91DF2D929B6_SIGNATURE_DESCRIPTION = "PGP RSA encrypted session key - keyid: 6F6BE91D F2D929B6 RSA".lower() + def init(self): if GPG is None: self.enabled = False @@ -155,6 +215,10 @@ def init(self): regex="^%s" % self.F18B47DF3F881C75_SIGNATURE_DESCRIPTION, extension="gpg", cmd=self._decrypt_and_extract_F18B47DF3F881C75) + self.module.extractor.add_rule(txtrule=None, + regex="^%s" % self._6F6BE91DF2D929B6_SIGNATURE_DESCRIPTION, + extension="gpg", + cmd=self._decrypt_and_extract_6F6BE91DF2D929B6) def _decrypt_and_extract_EDDA2E82EDC7030C(self, fname): return self._decrypt_and_extract(fname, self.EDDA2E82EDC7030C_KEY) @@ -162,6 +226,9 @@ def _decrypt_and_extract_EDDA2E82EDC7030C(self, fname): def _decrypt_and_extract_F18B47DF3F881C75(self, fname): return self._decrypt_and_extract(fname, self.F18B47DF3F881C75_KEY) + def _decrypt_and_extract_6F6BE91DF2D929B6(self, fname): + return self._decrypt_and_extract(fname, self._6F6BE91DF2D929B6_KEY) + def _decrypt_and_extract(self, fname, key): ''' This does the extraction (e.g., it decrypts the image and writes it to a new file on disk). @@ -202,3 +269,5 @@ def scan(self, result): result.description += ", Verizon BHR4 " elif result.description.lower().startswith(self.F18B47DF3F881C75_SIGNATURE_DESCRIPTION) is True: result.description += ", Verizon BHR4 " + elif result.description.lower().startswith(self._6F6BE91DF2D929B6_SIGNATURE_DESCRIPTION) is True: + result.description += ", iControl Touchscreen (Upgrade) "