epinna / weevely3

Weaponized web shell
GNU General Public License v3.0
3.21k stars 606 forks source link

Fix `:file_tar` compatibility with PHP8 #167

Closed ZanyMonk closed 1 year ago

ZanyMonk commented 1 year ago

The file_tar module uses an old PHP lib called EasyTar.class. It's not to be found online and it is incompatible with PHP8, so it would be nice to replace it with a cleaner solution to compress/decompress tar files.

It appears to be possible with the native PHP class Phar:

// decompress from gz
$p = new PharData('files.tar.gz');
$p->decompress(); // creates files.tar

// unarchive from the tar
$phar = new PharData('files.tar');
$phar->extractTo('new_dir');

Let's try this !