Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7-zip compressor issue ? #49

Closed
DoNck opened this issue Sep 20, 2021 · 4 comments
Closed

7-zip compressor issue ? #49

DoNck opened this issue Sep 20, 2021 · 4 comments

Comments

@DoNck
Copy link

DoNck commented Sep 20, 2021

Hi,

I encounter issues opening dfir-orc crafted 7z archives using py7z python library.
According to @miurahr from py7z, something is wrong on the dfir-orc side, see: issue 359 at py7zr.
Could you please have a look a the problem ? Test cases are attached to the issue.

Best regards

@sc-anssi
Copy link

Hi,
Just to let you know that we are still investigating the issue.
In the mean time, a workaround can be to use libraries which rely on the 7z binary (like patool) or to write the wrapping code yourself.
We'll come back to you when we have more news about the matter.
Regards

@fabienfl-orc
Copy link
Collaborator

Hello, this is fixed with the fresh 10.0.22 release. It will be also working with upcoming 10.1.0-rc8.

FYI the issue with 7z library is that it expects NULL stream for empty files but we processed empty files like the others.

@amaulave
Copy link

amaulave commented Dec 6, 2021

Hello @fabienfl-orc @sc-anssi

I downloaded 10.0.22 release and unfortunately I still have an error when I tried to extract the 7z archive with py7zr:

$ py7zr x Collect_Full_DESKTOP-S3MCBR3_20211202_181230_System.7z out
Traceback (most recent call last):
  File "/usr/local/bin/py7zr", line 8, in <module>
    sys.exit(main())
  File "/home/user/.local/lib/python3.8/site-packages/py7zr/__main__.py", line 25, in main
    return cli.Cli().run()
  File "/home/user/.local/lib/python3.8/site-packages/py7zr/cli.py", line 99, in run
    return args.func(args)
  File "/home/user/.local/lib/python3.8/site-packages/py7zr/cli.py", line 356, in run_extract
    a.extractall(path=args.odir, callback=cb)
  File "/home/user/.local/lib/python3.8/site-packages/py7zr/py7zr.py", line 948, in extractall
    self._extract(path=path, return_dict=False, callback=callback)
  File "/home/user/.local/lib/python3.8/site-packages/py7zr/py7zr.py", line 604, in _extract
    self.worker.extract(
  File "/home/user/.local/lib/python3.8/site-packages/py7zr/py7zr.py", line 1198, in extract
    if not any([self.target_filepath.get(f.id, None) for f in folders[i].files]):
TypeError: 'NoneType' object is not iterable


$ py7zr t Collect_Full_DESKTOP-S3MCBR3_20211202_181230_System.7z
Testing archive: Collect_Full_DESKTOP-S3MCBR3_20211202_181230_System.7z
--
Path = Collect_Full_DESKTOP-S3MCBR3_20211202_181230_System.7z
Type = 7z
Phisical Size = 173442461
Headers Size = 1108
Method = LZMA2
Solid = +
Blocks = 44

Bad 7zip file

If I uncompress then recompress the archive using 7-Zip tool without modification to files, the new archive can be proceed without issues:

$ py7zr t Collect_Full_DESKTOP-S3MCBR3_20211202_181230_System_repaired.7z
Testing archive: Collect_Full_DESKTOP-S3MCBR3_20211202_181230_System_repaired.7z
--
Path = Collect_Full_DESKTOP-S3MCBR3_20211202_181230_System_repaired.7z
Type = 7z
Phisical Size = 173337431
Headers Size = 1004
Method = LZMA2
Solid = +
Blocks = 1

Everything is Ok


$ py7zr x Collect_Full_DESKTOP-S3MCBR3_20211202_181230_System_repaired.7z out2
$ echo $?
0

@sc-anssi
Copy link

Hi @amaulave,
Your error seems to be a different problem: please open a new issue with all the info we need to reproduce it (including the sample archive triggering the bug and DFIR-ORC's configuration)

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants