!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/pmb/weevely3/tests/   drwxr-xr-x
Free 13.03 GB of 57.97 GB (22.48%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     test_file_ls.py (1.74 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
from testfixtures import log_capture
from tests.base_test import BaseTest
from tests import config
from weevely.core.sessions import SessionURL
from weevely.core import modules
from weevely import utils
from weevely.core import messages
import subprocess
import os

def setUpModule():
    subprocess.check_output("""
BASE_FOLDER="{config.base_folder}/test_file_ls/"
rm -rf "$BASE_FOLDER"

mkdir -p "$BASE_FOLDER/dir1/dir2/dir3/dir4"
chmod 0 "$BASE_FOLDER/dir1/dir2/dir3/dir4"
""".format(
config = config
), shell=True)

class FileLs(BaseTest):

    folders = [ os.path.join(config.base_folder, f) for f in (
        'test_file_ls/dir1',
        'test_file_ls/dir1/dir2',
        'test_file_ls/dir1/dir2/dir3',
        'test_file_ls/dir1/dir2/dir3/dir4',
    ) ]

    def setUp(self):
        self.session = SessionURL(
                    self.url,
                    self.password,
                    volatile = True
                    )

        modules.load_modules(self.session)

        self.run_argv = modules.loaded['file_ls'].run_argv

    def test_ls(self):

        # ls [0]
        self.assertEqual(self.run_argv([ self.folders[0] ]), [ '.', '..', os.path.split(self.folders[1])[1]])

        # ls [-1]
        self.assertEqual(self.run_argv([ self.folders[-1] ]), [ ] )

        # ls [1]/.././[1]/./
        new = self.folders[1]
        self.assertEqual(self.run_argv([ '%s/.././%s/./' % (new, os.path.split(new)[-1]) ]), [ '.', '..', os.path.split(self.folders[2])[1]])

        # ls bogus
        self.assertEqual(self.run_argv([ 'bogus' ]), [ ] )

        # ls [2]/.././[2]/../
        new = self.folders[2]
        self.assertEqual(self.run_argv([ '%s/.././////////%s/../' % (new, os.path.split(new)[-1]) ]), [ '.', '..', os.path.split(self.folders[2])[1]])

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0066 ]--