Open guestofhonor3000 opened 4 years ago
It seems that Instagram changed their login request method..
In the past it was a json containing user and password..
Now it's a form_data and the password goes in a variable "enc_password". It looks like it had some kind of a encryption on it: enc_password: #PWD_INSTAGRAM_BROWSER:10:1595532093:ASxQAHEUCEkXhA/kAjPsp3blL5vYRG+HaY+9MSPe4ISIvHlrbUDLo7s5I50eDVf1+ioOVp1aPuBSY7QWlowgYP+Wr0PcWmkNlpO58qHj/PonaYV5xiX6lOW01x5ZXqAyVS00WWOPT/tRjpS4ACY=
:(
There appears to be a change in the sent authentication request. Instagram is now using the password string in the "enc_password" key. The encryption is evp_aes_256_gcm. Someone has to write a method to generate the enc_password string
I'm trying to implements the encryptation algorithm. I'm struggling with the AES GMC python implementation .. cause if you see how instagram implemented their encryption , it's something like this:
A.subtle.encrypt(p, t, h.buffer);
Where:
p = { "additionalData":"1596161418", "name":AES-GMC", "tagLen":16 }
t= Instance of CriptoKey
h= byte array of your password.
In Python the package Crypto.Cipher has and implementation of AES-GMC.. but there's no way to pass the additionalData do the encrypt_and_digest method.
Checking the javascript documentation : https://developer.mozilla.org/en-US/docs/Web/API/AesGcmParams
additionalData Optional A BufferSource. This contains additional data that will not be encrypted but will be authenticated along with the encrypted data. If additionalData is given here then the same data must be given in the corresponding call to decrypt(): if the data given to the decrypt() call does not match the original data, the decryption will throw an exception. This gives you a way to authenticate associated data without having to encrypt it.
Even though it's not used in the encryption, it's used with the autentication of the data .. so I'm trying to find a implementation in Python that provides additionalData as part of the encryption.
Having the same login error... Tried different bots with different accounts. It's always the same:
loginResponse = login.json() File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
just got the same error. is it fixable ?
same error here, any solution?
Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])
Select one:
Environment
Operating System? (include version)
Linux instanceig 5.3.0-1029-gcp #31~18.04.1-Ubuntu SMP Mon Jun 22 15:24:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Python Version Requirement
Exact Python Version?
Python 3.6.9
Pip Version?
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
Instabot Version?
Installed version 0.6.0
How you use the instabot
Description of your issue
Config
Traceback (most recent call last): File "/home/puscasu_and/.local/bin/neo-instabot", line 11, in
sys.exit(main())
File "/home/puscasu_and/.local/lib/python3.6/site-packages/instabot/main.py", line 330, in main
bot = InstaBot(config=config)
File "/home/puscasu_and/.local/lib/python3.6/site-packages/instabot/bot.py", line 198, in init
self.login()
File "/home/puscasu_and/.local/lib/python3.6/site-packages/instabot/bot.py", line 301, in login
loginResponse = login.json()
File "/home/puscasu_and/.local/lib/python3.6/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)