Completed

AES Decryption Regex, Then Encryption With MITMPROXY

This project was successfully completed by ankurs13 for $30 USD in a day.

Get free quotes for a project like this
Employer working
Project Budget
$10 - $30 USD
Completed In
1 day
Total Bids
1
Project Description

Need Help creating a Python Script to be used with Mitmproxy / Mitmdump ( [url removed, login to view] )

command switch as mitmproxy -s /home/user/[url removed, login to view]

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:

[url removed, login to view] (Auto detects, but it should be Rijndael-128 / ECB / with Base64)

[url removed, login to view] (Rijndael-128 / ECB / with Base64)

[url removed, login to view] (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 [url removed, login to view]("[url removed, login to view]"):"

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 [url removed, login to view] ( pip install mitmproxy==[url removed, login to view] ) 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.

Completed by:
Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online