I am using gFTP with bookmarks. I have several FTP sites, but there is one password in gFTP that I need to decrypt, I found the following site:
http://www.g-loaded.eu/2009/05/07/de...-using-python/
I copied the python code and saved it as gftp.py and made it executable with chmod 755:
Code:
def gftp_descrable_password(password):
"""gftp password descrambler
This code has been released in the Public Domain by the original author.
"""
if not password.startswith('$'):
return password
newpassword = []
pwdparts = map(ord, password)
for i in range(1, len(pwdparts), 2):
if ((pwdparts[i] & 0xc3) != 0x41 or
(pwdparts[i+1] & 0xc3) != 0x41):
return password
newpassword.append(chr(((pwdparts[i] & 0x3c) << 2) +
((pwdparts[i+1] & 0x3c) >> 2)))
return "".join(newpassword)
However I do not know how to use the script. If I go to ~/.gFTP bookmarks and copy and paste the password I get a python error:
./gftp.py $hgugujhvjhvvhgv
./gftp.py: line 1: syntax error near unexpected token `('
./gftp.py: line 1: `def gftp_descrable_password(password):'
If I start script with python at a terminal e.g.
python gftp.py $njknjkbjhvjhvbjhv
There is no error but no password is displayed.
The password texts are random characters not a saved password.
Thanks in advance for help on this.