snapchat-decrypt icon indicating copy to clipboard operation
snapchat-decrypt copied to clipboard

IOError: [Errno 2] No such file or directory: 'encrypted_bananas_file'

Open abhishakemitra opened this issue 11 years ago • 39 comments

Hi

This is the output I got when I tried the script. I have a rooted device.

8.0.0 Traceback (most recent call last): File "decrypt_photos.py", line 140, in decrypt_bananas_file() File "decrypt_photos.py", line 80, in decrypt_bananas_file with open("encrypted_bananas_file") as encrypted_bananas: IOError: [Errno 2] No such file or directory: 'encrypted_bananas_file'

abhishakemitra avatar Nov 20 '14 01:11 abhishakemitra

Hi, can you tell me what Snapchat version are you running? Because the script works only for versions 5.0.34.X or 5.0.38.X. You can check your version under the Settings->Application Manager->Snapchat tab. If your running any of those versions, try closing the application before running the script.

Joaquín

xeroxnir avatar Nov 20 '14 16:11 xeroxnir

It got upgraded to version 8.0.0 on 17th November. Is there any hack for that?

abhishakemitra avatar Nov 20 '14 16:11 abhishakemitra

I'll have to look into the new update, i'll probably take a few days to check how the learn how new version encrypts images. Thanks for reporting this.

xeroxnir avatar Nov 20 '14 16:11 xeroxnir

please let me know if you find a hack. it's urgent. need to submit a report in 3 weeks

abhishakemitra avatar Nov 20 '14 16:11 abhishakemitra

Hi, I just tested the script with the new version and it appeared to work. Did you close the application before running the script? are you running adb shell as root from start? (You should have # instead of $ when running adb shell). Remember the script only works for images so far, since it's a poc.

xeroxnir avatar Nov 20 '14 17:11 xeroxnir

the app was closed but i think i missed the adb part.. so to summarise, please confirm if this is what i need to do:-- $ adb shell #su

python decrypt_images.py

the script is saved on the Desktop currently

abhishakemitra avatar Nov 20 '14 17:11 abhishakemitra

Hi, plese install adbd Insecure from Chainfire to make adb run as root from the start. Otherwise the script won't work because adb pull command can't pull files from internal memory.

xeroxnir avatar Nov 20 '14 17:11 xeroxnir

but i am doing a forensic analysis currently by extracting the whole image and i have used adb pull and did not need to install any of those. But still could you please provide a link to those?

abhishakemitra avatar Nov 20 '14 17:11 abhishakemitra

Hi, sure, download from http://forum.xda-developers.com/showthread.php?t=1687590. The problem is using adb pull to extract something from /data/data/ folder, you need adb running as root to do that.

xeroxnir avatar Nov 20 '14 17:11 xeroxnir

Thanks mate.. Will have a look and update my findings!!

Cheers!

abhishakemitra avatar Nov 20 '14 17:11 abhishakemitra

I installed chainfire and then ran the script again.. And got the following error:--

$ python decrypt_photos.py 8.0.0 b4d975402fe47bbd Traceback (most recent call last): File "decrypt_photos.py", line 141, in decrypt_images() File "decrypt_photos.py", line 105, in decrypt_images if len(json_bananas) < len( os.listdir("encrypted_received_image_snaps") ): OSError: [Errno 2] No such file or directory: 'encrypted_received_image_snaps'

abhishakemitra avatar Nov 20 '14 18:11 abhishakemitra

Can you check if you check if you have the folder "received_image_snaps" under /data/data/com.snapchat.android/cache folder? Unloaded images are cached inside this folder when closing the application.

xeroxnir avatar Nov 20 '14 18:11 xeroxnir

yes i do Uploading Screenshot from 2014-11-20 18:53:20.png . . .

abhishakemitra avatar Nov 20 '14 18:11 abhishakemitra

screenshot from 2014-11-20 18 53 20

abhishakemitra avatar Nov 20 '14 18:11 abhishakemitra

The folder is empty, apparently you have no unseen images. You must open the chat so the images are downloaded and then close the application so it's cached inside that folder. Try checking if there are images files inside that folder before running the script.

xeroxnir avatar Nov 20 '14 19:11 xeroxnir

screenshot_2014-11-23-18-14-39 screenshot_2014-11-23-18-14-48 screenshot from 2014-11-23 18 59 00 screenshot from 2014-11-23 18 59 14

As you can see from the screenshots, I have opened the image and viewed it. Now, in the last 2 screenshots, you can see that the Received images folder is empty. But it is really interesting to see that there are some .nomedia files under cache/stories/received/thumbnail. Are the pics being stored in this new location now? Is that why the script is failing?

abhishakemitra avatar Nov 23 '14 19:11 abhishakemitra

Hi, did you check the received images folder after you viewed the image? I checked last night the script with two accounts and it seemed to work properly with the last Snapchat version. Are you checking /data/data/com.snapchat.android/cache (internal memory for the application) or the cache folders stored in the sdcard?

xeroxnir avatar Nov 25 '14 15:11 xeroxnir

I am checking the internal memory of the phone. I am taking the whole image of /data. Please see the screenshot of the received images folder above

Also, when you said to close the app, did you mean to use the "force stop" function?

abhishakemitra avatar Nov 25 '14 19:11 abhishakemitra

No, force stop stops the app abruptly and doesn't give the application a chance to save the keys for the image in the bananas file and unloaded images can't be decrypted. You need to close it the normal way (press home screen and swipe gesture closing the app).

xeroxnir avatar Nov 25 '14 20:11 xeroxnir

I did that. But still no snaps are being stored in the /data/com.snapchat.android/cache/received_image_snaps folder. I checked this from the extracted image of the device. Is there any particular reason that you could think of why this is happening?

abhishakemitra avatar Nov 29 '14 22:11 abhishakemitra

also could you also confirm your version no please?

abhishakemitra avatar Nov 29 '14 23:11 abhishakemitra

I got this to work today by manually installing the snapchat APK with version 5.0.38.1. Hope that helps.

pedelman avatar Dec 02 '14 04:12 pedelman

No I need to work on it on the latest one. The other guy said it works for him. Do you also face the same issue as me?

Regards Abhishek Mitra On 2 Dec 2014 04:25, "Patrick Edelman" [email protected] wrote:

I got this to work today by manually installing the snapchat APK with version 5.0.38.1. Hope that helps.

— Reply to this email directly or view it on GitHub https://github.com/programa-stic/snapchat-decrypt/issues/5#issuecomment-65181698 .

abhishakemitra avatar Dec 02 '14 05:12 abhishakemitra

@zerokes

Did you try running it on the version 8.x?

abhishakemitra avatar Dec 02 '14 05:12 abhishakemitra

Yes, I did. It appeared to be working properly. No changes where made to the classes mentioned in the README file in 8.x from what i've seen.

xeroxnir avatar Dec 02 '14 19:12 xeroxnir

Now I am getting this error suddenly:--

Traceback (most recent call last): File "decrypt_photos.py", line 135, in VERSION = get_version() File "decrypt_photos.py", line 64, in get_version print p.findall(version)[0].strip() IndexError: list index out of range

abhishakemitra avatar Dec 02 '14 19:12 abhishakemitra

The script is supposed to be a POC, changes could be made to make it more stable. For example, not having to run adb as root. Sometimes keys for images are lost because you received the image, then forced stoped the application (being unable to update the bananas key file). Cleaning the application data and reloading the unseen image may fix the issue.

The error you're seing comes from the script not being able to obtain the app version using the command adb shell dumpsys package com.snapchat.android, change the script to return "8.0.0" in getVersion() if you're sure to be running that version.

xeroxnir avatar Dec 02 '14 19:12 xeroxnir

ok.. let me try.. thanks!!

abhishakemitra avatar Dec 02 '14 19:12 abhishakemitra

ok.. since there are no files or folders under received_image_snaps, I changed the code in line nos 86 and 108. Look at attached screenshot. But still the script throws an error :-- Traceback (most recent call last): File "decrypt_photos.py", line 144, in decrypt_images() File "decrypt_photos.py", line 108, in decrypt_images if len(json_bananas) < len( os.listdir("received_image_snaps") ): OSError: [Errno 2] No such file or directory: 'received_image_snaps'

I tried this on two devices now, Samsung Galaxy Fame and Samsung Galaxy Note. Both yielded the same result

screenshot from 2014-12-04 20 23 44

abhishakemitra avatar Dec 04 '14 20:12 abhishakemitra

The script is not running in the device. It runs on the folder from where it is saved on the computer. Could you please share your email id or any other contact details so that I can contact you with more details?

abhishakemitra avatar Dec 04 '14 21:12 abhishakemitra