Page 1 of 1

Passworded RAR's and using password file

Posted: January 6th, 2013, 4:09 pm
by opentoe
I created a password file. Put the password in that file. Set this in the folders section. When I select the NZB to download it starts to download, but then tells me there is a password and stops downloading. Is that what the password file is for, SAB will go out and try the password(s) listed in that file?

Re: Passworded RAR's and using password file

Posted: January 6th, 2013, 4:31 pm
by AutomaticCoding
Based off JDownloader's password file (Which, considering it's a PASSWORD FILE, I assume is the exact same) all it does is when it receives a RAR file with a password, it'll loop through each password (Most likely separated by a \n) and attempt it on the rar file. However, if you REALLY want access to the file, it's probably better just to use something like unrar along with John The Ripper.

Oh, and here's a .txt I found from a minutes worth of googling including common rar passwords:-
http://pastebin.com/4apy6HKP

Re: Passworded RAR's and using password file

Posted: January 6th, 2013, 4:37 pm
by opentoe
AutomaticCoding wrote:Based off JDownloader's password file (Which, considering it's a PASSWORD FILE, I assume is the exact same) all it does is when it receives a RAR file with a password, it'll loop through each password (Most likely separated by a \n) and attempt it on the rar file. However, if you REALLY want access to the file, it's probably better just to use something like unrar along with John The Ripper.

Oh, and here's a .txt I found from a minutes worth of googling including common rar passwords:-
http://pastebin.com/4apy6HKP
I already know the password of the unrar. It has been confirmed. If the correct password is in the password file why isn't SAB able to sucessfully download and unrar the set? I wasn't looking for a password file or asking what the password is to the set.

Re: Passworded RAR's and using password file

Posted: January 6th, 2013, 5:23 pm
by AutomaticCoding
opentoe wrote:
AutomaticCoding wrote:Based off JDownloader's password file (Which, considering it's a PASSWORD FILE, I assume is the exact same) all it does is when it receives a RAR file with a password, it'll loop through each password (Most likely separated by a \n) and attempt it on the rar file. However, if you REALLY want access to the file, it's probably better just to use something like unrar along with John The Ripper.

Oh, and here's a .txt I found from a minutes worth of googling including common rar passwords:-
http://pastebin.com/4apy6HKP
I already know the password of the unrar. It has been confirmed. If the correct password is in the password file why isn't SAB able to sucessfully download and unrar the set? I wasn't looking for a password file or asking what the password is to the set.
Oh, errm.... {About 10 minutes later}

After a lot of fiddling around in a language I don't understand (Never learnt python) I can finally say:-
It's a definite maybe.

Basically, after looking in the following files for ~ a minute per, I can guess that pausing/failing on detected RAR password does not determine if one of your passwords are legitimate, you have to download the full file to test that:-
.\sabnzbd\assembler.py::check_encrypted_rar
.\sabnzbd\utils\rarfile.py::_parse
.\sabnzbd\newsunpack.py::rar_extract

It seems as though check_encrypted (What's called when a file is being checked for a password, before it's download... I think. I've lost track, I don't like python, also, I'm tired. Been up for ~ 15 hours with no caffeine products) just checks if the flag 'RAR_MAIN_PASSWORD' is part of h.flags (Header's flags, I presume. There's a limit to how far I follow a source) or if another file contains the word 'password', however, the rar_extract feature (What's called upon completion) runs:-

Code: Select all

for password in passwords:
        if password:
            logging.debug('Trying unrar with password "%s"', password)
            msg = T('Trying unrar with password "%s"') % unicoder(password)
            nzo.fail_msg = msg
            nzo.set_unpack_info('Unpack', msg)
        fail, new_files, rars = rar_extract_core(rarfile, numrars, one_folder, nzo, setname, extraction_path, password)
        if fail != 2:
            break
However, I could be wrong. Once again, 15 hours, no caffeine, language I don't know, lots of guesses.

Re: Passworded RAR's and using password file

Posted: January 6th, 2013, 5:51 pm
by sander
opentoe wrote:I created a password file. Put the password in that file. Set this in the folders section. When I select the NZB to download it starts to download, but then tells me there is a password and stops downloading. Is that what the password file is for, SAB will go out and try the password(s) listed in that file?
It stops downloading? I would say that means you have to check your setup:

Questions:

1) is your setup correct and is SABnzbd actually using the password file you've set up? You can check your sabnzb.log:

If you find lines with "INFO", do you also see lines like "Read the passwords file /home/sander/.sabnzbd/some-passwords.txt"
If you have DEBUG on you will find lines with "DEBUG". If so, do you see line like "Running unrar ['/usr/bin/unrar', 'x', '-idp', '-tsm-', '-o-', '-or', '-ppassword'," ... so with "p" and then the password?

If you don't see that, I would say you have to re-check your setup for the rar password setting.

2) If you answer Yes to the above, how are you sure the password you try is correct? If you manually unrar on the rar files, and unrar it with the password?


EDIT:

There is an easier way to check if SABnzbd applied any password on your file:

In the History, on the failed job, on the left site, click on it. That should open a Popup. In the Popup, at Unpack you should see something like:

... Unpacking failed, archive requires a password
Trying unrar with password "hello"
Trying unrar with password "test"
Trying unrar with password "password"
Trying unrar with password "secret"

If that is not there, your rar password setup is not correct

Re: Passworded RAR's and using password file

Posted: January 6th, 2013, 7:42 pm
by opentoe
Thanks for the numerous responses. It did prompt me to re-check everything further. I eventually found out that for some very odd reason the password file that I had set in the folders options was all botched up. It was almost like a binary file when I opened it. I don't know what happened to it. So I restored the file from one of my crashplan backups and it all started working like it should. At least so far it is working ok. Thanks!