Busindre / dumpzilla

Extract all forensic interesting information of Firefox, Iceweasel and Seamonkey browsers
http://www.dumpzilla.org
130 stars 28 forks source link

LZ4 block error #3

Open JurgenG opened 6 years ago

JurgenG commented 6 years ago

When trying to run the code, I'm getting an error:

Traceback (most recent call last):
  File "dumpzilla.py", line 2684, in <module>
    app = Dumpzilla(sys.argv)
  File "dumpzilla.py", line 2522, in __init__
    self.show_search_engines(dir)
  File "dumpzilla.py", line 1160, in show_search_engines
    jdata = json.loads(self.decompressLZ4(fo))
  File "dumpzilla.py", line 328, in decompressLZ4
    return lz4.block.decompress(file.read())
AttributeError: module 'lz4' has no attribute 'block'
onehdev commented 6 years ago

Hi, It seems that your lz4-python library has no lz4.block sub-package. I don't know how you can fix it, maybe you need to update the package to a newer version?

imagen

Here is the package specification -> http://python-lz4.readthedocs.io/en/stable/lz4.html

I'm trying to check the version installed on my system but only works the deprecated way:

imagen

JurgenG commented 6 years ago

Hi, I checked those things. My lz4version is 10801 It seems to work if I explicitly import lz4.block though...

$ python3
Python 3.6.3 (default, Oct  3 2017, 21:45:48) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import lz4
&gt;&gt;&gt; lz4.block
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'lz4' has no attribute 'block'
&gt;&gt;&gt; lz4.library_version_string()
'1.8.1'
&gt;&gt;&gt; lz4.lz4version()
10801
>>> import lz4.block
>>> lz4.block
<module 'lz4.block' from '/home/jurgen/.local/lib/python3.6/site-packages/lz4/block/__init__.py'>
>>> lz4.lz4version()
10801
>>>import lz4.block
>>> lz4.version
<module 'lz4.version' from '/home/jurgen/.local/lib/python3.6/site-packages/lz4/version.py'>
>>> lz4.block.compress(b'1234')
b'\x04\x00\x00\x00@1234'
>>>
JurgenG commented 6 years ago

After tweaking this in the code (import lz4.block instead of lz4), the code seams to work, but there still are a few errors. Not sure if this needs a new issue report or not, as I'm not much of a Python expert. Here are my new error messages:

$ python3 dumpzilla.py  ~/.mozilla/firefox/XXXX.default/ >output.txt
[ERROR] Error decoding passwords: libnss not found (libnss3.so)
[ERROR] <class 'UnicodeDecodeError'> 'ascii' codec can't decode byte 0xe2 in position 6659: ordinal not in range(128). Please check locale settings to verify UTF-8 is set!
[ERROR] Sessions database: Can't process file sessionstore.js: <class 'AttributeError'>
[ERROR] <class 'UnicodeDecodeError'> 'ascii' codec can't decode byte 0xe2 in position 63529: ordinal not in range(128). Please check locale settings to verify UTF-8 is set!
[ERROR] Sessions database: Can't process file sessionstore-backups/upgrade.js-20170919185010: <class 'AttributeError'>

The first error is probably me failing to install the NSS library. I do think I did install it though. I installed the following 4: libnss3 libnss3-dbg libnss3-dev libnss3-tools I figured out that I had to manually copy libnss3.so to the same path as the script... Now this part works...

Error Nr.2... (and probably Nr. 4): I think I have the right locale. Maybe you need to specify exactly what locale parameter needs to be UTF-8... Here's is my locale:

$ locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC=nl_BE.UTF-8
LC_TIME=nl_BE.UTF-8
LC_COLLATE="POSIX"
LC_MONETARY=nl_BE.UTF-8
LC_MESSAGES="POSIX"
LC_PAPER=nl_BE.UTF-8
LC_NAME=nl_BE.UTF-8
LC_ADDRESS=nl_BE.UTF-8
LC_TELEPHONE=nl_BE.UTF-8
LC_MEASUREMENT=nl_BE.UTF-8
LC_IDENTIFICATION=nl_BE.UTF-8
LC_ALL=
arjunskumar commented 1 year ago

@JurgenG import lz4.block solved my issue