Created
July 12, 2019 12:52
-
-
Save nvssks/5c2bc4e9ebcf013ef8cf3282a29fb8d8 to your computer and use it in GitHub Desktop.
Revisions
-
nvssks created this gist
Jul 12, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ from burp import IBurpExtender import random import string #Java Imports from javax.crypto import Cipher from javax.crypto.spec import SecretKeySpec #Imports for run external import subprocess class BurpExtender(IBurpExtender): key="[REDACTED]" def run_external(self, payload): #https://github.com/externalist/aes-encrypt-decrypt-burp-extender-plugin-example proc = subprocess.Popen(['python','./encrypt.py', self.key, payload],stdout=subprocess.PIPE) output = proc.stdout.read().strip() proc.stdout.close() return output def run_java_encrypt(self, payload): #https://parsiya.net/blog/2018-12-24-cryptography-in-python-burp-extensions/#aes-cfb-nopadding aesKey = SecretKeySpec(self.key, "AES") cipher = Cipher.getInstance("AES/CBC/NOPADDING") cipher.init(Cipher.ENCRYPT_MODE, aesKey) encrypted = cipher.doFinal(payload) return encrypted