File: test_shell_ssh.py

package info (click to toggle)
weevely 4.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,336 kB
  • sloc: python: 7,732; php: 1,035; sh: 53; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 674 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from core import modules
from core.sessions import SessionURL
from tests.base_test import BaseTest
from tests.config import su_user, su_passwd


class ShellSsh(BaseTest):
    def setUp(self):
        self.session = SessionURL(self.url, self.password, volatile = True)
        modules.load_modules(self.session)

        self.vector_list = modules.loaded['shell_ssh'].vectors.get_names()
        self.run_argv = modules.loaded['shell_ssh'].run_argv

    def test_param_vector(self):
        for vect in self.vector_list:
            output = self.run_argv(['-vector', vect, f'{su_user}@localhost', su_passwd, 'whoami'])
            self.assertEqual(output.rstrip(), su_user)