AES Decryption Regex, Then Encryption With MITMPROXY
$10-30 USD
Terminado
Publicado hace más de 7 años
$10-30 USD
Pagado a la entrega
Need Help creating a Python Script to be used with Mitmproxy / Mitmdump ( [login to view URL] )
command switch as mitmproxy -s /home/user/[login to view URL]
In this script i need it to do the following:
get the servers Response or Request and be able to decrypt them via AES / Rijndael-128 / ECB / with Base64 Encoding, Then Edit those Responses and Request via RE (Regex) and then Encrypt Them back with the same Key (Provided via a variable).
I have tried this a few time myself with little luck, but I don't know py very well.
The hard part is to get the decrytion and encryption correct!
To test and make sure it does it the way i need, the Script MUST encrypt and decrypt at these sites:
[login to view URL] (Auto detects, but it should be Rijndael-128 / ECB / with Base64)
[login to view URL] (Rijndael-128 / ECB / with Base64)
[login to view URL] (Rijndael-128 / ECB / with Base64)
so to test your work, please make sure you get the same input and out put as those sites.
The Response and Request will NOT be all plaintext, most of the time it's JASON, so this will need to support this. (another issue i ran into).
Here is an Example of a Key I use and what part of a reply might look like, to test with:
key = '3te0Lszj'
encrypteddate = '9qSBmNW40COlkSHaRz/Vw0XB3x2GYzWZUZs0mQgOaKTqKRw65Ki0ngYAu0o6P+1FDlc572BAiMRySEy9ISli6P9xGw0KeIRLShONFQZB/98='
Decrypted data = '{"N3hB0CwE":"10002","9GIvAQC2":"5","1Fa7rL5R":"22:504100030:2:90"},'
*And reverse.
BUT i will need to pull this encrypted area from the Response or Request first. cause most of the time it will come in like this:
{"Home":{"Place":"274968","s4hB1Y01":"22JBaFbe"},"Cable":{"wrZcBc51":"'9qSBmNW40COlkSHaRz/Vw0XB3x2GYzWZUZs0mQgOaKTqKRw65Ki0ngYAu0o6P+1FDlc572BAiMRySEy9ISli6P9xGw0KeIRLShONFQZB/98="}}
and I only want to Decrypt 9qSBmNW40COlkSHaRz/Vw0XB3x2GYzWZUZs0mQgOaKTqKRw65Ki0ngYAu0o6P+1FDlc572BAiMRySEy9ISli6P9xGw0KeIRLShONFQZB/98=
Then Regex that Decrypted JSON
Then Re-Encrypt it using the same Key as I provide to Decrypt it
Then put it back where I pulled it from.
This script needs to get and output the info through mitmproxy, i would only like to edit my regex and the key after each "if [login to view URL]("[login to view URL]"):"
I'll upload what script i use today that works, but does have AES; which i mainly all i need added.
The versions of MITMPROXY use a little different code.
I would prefer the older versions code, as i will share the script i use for that one.
Version 0.16 ( pip install mitmproxy==0.16 ) with py version 2.7
*Ii wouldn't mind if you used the newest release and py version 3.x (as next version they will force Py 3.x)
Thank you.