packing-box / docker-packing-box

Docker image gathering packers and tools for making datasets of packed executables and training machine learning models for packing detection
GNU General Public License v3.0
49 stars 10 forks source link

`FileNotFoundError` using `pakkero` packer #21

Closed smarbal closed 1 year ago

smarbal commented 1 year ago

When creating an ELF dataset without choosing a specific packer, the following issue occurs :

00:00:10.643 [DEBUG   ] dataset            - handling /usr/bin/whoami...
00:00:11.648 [DEBUG   ] pakkero-compressed - pakkero --file '/home/user/.packing-box/datasets/elf-all-dataset/files/4bff6a2b2b537d818b83689b1d47b4a76ece01c80b89c45412fdfe40d88e6bb0' -o '/home/user/.packing-box/datasets/elf-all-dataset/files/4bff6a2b2b537d818b83689b1d47b4a76ece01c80b89c45412fdfe40d88e6bb0' -c
00:00:14.329 [ERROR   ] pakkero-compressed - failed to execute command /home/user/.local/bin/upx /home/user/.packing-box/datasets/elf-all-dataset/files/4bff6a2b2b537d818b83689b1d47b4a76ece01c80b89c45412fdfe40d88e6bb0: exit status 1
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2022
UPX 4.0.1       Markus Oberhumer, Laszlo Molnar & John Reiser   Nov 16th 2022

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
upx: /home/user/.packing-box/datasets/elf-all-dataset/files/4bff6a2b2b537d818b83689b1d47b4a76ece01c80b89c45412fdfe40d88e6bb0: CantPackException: span unexpected NULL pointer; take care!

Packed 1 file: 0 ok, 1 error.
00:00:14.330 [DEBUG   ] pakkero-compressed - not packed (failed to execute command /home/user/.local/bin/upx exit status 1
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2022
UPX 4.0.1       Markus Oberhumer, Laszlo Molnar & John Reiser   Nov 16th 2022

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
upx: CantPackException: span unexpected NULL pointer; take care!

Packed 1 file: 0 ok, 1 error.)
Traceback (most recent call last):
  File "/home/user/.opt/tools/dataset", line 150, in <module>
    getattr(ds, args.command)(**vars(args))
  File "/home/user/.local/lib/python3.10/site-packages/pbox/common/utils.py", line 153, in _wrapper
    return f(s, *a, **kw)
  File "/home/user/.local/lib/python3.10/site-packages/pbox/common/dataset.py", line 436, in make
    dest.chmod(0o400)
  File "/home/user/.local/lib/python3.10/site-packages/pathlib2/__init__.py", line 1644, in chmod
    self._accessor.chmod(self, mode)
  File "/home/user/.local/lib/python3.10/site-packages/pathlib2/__init__.py", line 646, in wrapped
    return strfunc(str(pathobj), *args)
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.packing-box/datasets/elf-all-dataset/files/4bff6a2b2b537d818b83689b1d47b4a76ece01c80b89c45412fdfe40d88e6bb0'
  5%|███████████▌                                                                                                                                                                                                                          | 2/40 [00:03<01:14,  1.96s/executable]
dhondta commented 1 year ago

@smarbal this error shows a trace of UPX 4.01 while being handling Pakkero, meaning that this last one relies on UPX and does not support its latest version. I opened an issue here. Conclusion: Pakkero is broken ; I will disable it in packers.yml