epinna/weevely3

:file_edit functionality broken

mihkelraba opened this issue · 4 comments

Bug description:

:file_edit functionality works only with new files.
When executing :file_edit on file, that does not exists, everything works as supposed, when editing the same file again, error "Error, module execution triggered error 'binary mode doesn't take an encoding argument'" is given

Version:

weevely 4.0.1 / latest Kali 2020.2 rolling

From terminal:

$ ls -l aa.txt
ls: cannot access 'aa.txt': No such file or directory
$ :file_edit aa.txt
True
$ cat aa.txt

test file content
$ :file_edit aa.txt
Error, module execution triggered error 'binary mode doesn't take an encoding argument'
$

Good catch, thanks.

Hi @epinna

I have the impression that the bug is back. I'm having the same problem as @mihkelraba

I can create and edit a file.

But I can't edit an existing file.

 $ file_edit /var/www/html/app/index.txt
True
 $ file_edit /var/www/html/app/index.php
Error, module execution triggered error 'binary mode doesn't take an encoding argument'

Weevely : 4.0.1
Kali linux 2023.2

On the target :

PHP 7.4.3
Ubuntu 20.04.1

Did anyone have solution for this issue guys. Thanks in advance!!!

Did anyone have solution for this issue guys. Thanks in advance!!!

Tested with github version and this bug seems to be fixed
PHP 8.2.12
Python 3.11.8