Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.4.3 test failure in tests/test_exploit_scenarios.py::test_exploit_timeout_response[Exploit111] #821

Closed
anthraxx opened this issue May 20, 2024 · 0 comments · Fixed by #824
Labels

Comments

@anthraxx
Copy link

Steps to Reproduce (for bugs)

I'm trying to upgrade the Arch Linux package of routersploit to 3.4.3, where we are running the tests to ensure not shipping regressions.
During packaging, we call make test or python3 -m pytest -n16 tests/core/ tests/test_exploit_scenarios.py tests/test_module_info.py which results in one test failure. In doubt we have an archlinux docker container as test environment.

Your Environment

  • RouterSploit Version used: 3.4.3
  • Operating System and version: Arch Linux
  • Python Version: ( python3 --version ) 3.12.3
  • Python Environment:
  • Python 3.12.3, pytest-8.2.1, pluggy-1.5.0
  • typeguard-4.2.1, forked-1.6.0, xdist-3.5.0, Faker-24.14.1
  • future 1.0.0 requests 2.31.0 paramiko 3.4.0 pycryptodomex 3.20.0 pysnmp 6.1.2

Current Behavior

============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.2.1, pluggy-1.5.0
rootdir: /build/routersploit/src/routersploit-3.4.3
plugins: typeguard-4.2.1, forked-1.6.0, xdist-3.5.0, Faker-24.14.1
created: 16/16 workers
16 workers [1033 items]

........................................................................ [  6%]
........................................................................ [ 13%]
........................................................................ [ 20%]
........................................................................ [ 27%]
........................................................................ [ 34%]
........................................................................ [ 41%]
........................................................................ [ 48%]
........................................................................ [ 55%]
........................................................................ [ 62%]
........................................................................ [ 69%]
........................................................................ [ 76%]
........................................................................ [ 83%]
........................................................................ [ 90%]
........................................................................ [ 97%]
..............s.F........                                                [100%]
=================================== FAILURES ===================================
__________________ test_exploit_timeout_response[Exploit111] ___________________
[gw6] linux -- Python 3.12.3 /usr/bin/python3

timeout_target = HttpScenarioService(host='127.0.0.1', port=39301)
module = <class 'routersploit.modules.exploits.routers.netgear.rax30_rce.Exploit'>

    @pytest.mark.parametrize("module", iter_modules(directory))
    def test_exploit_timeout_response(timeout_target, module):
        exploit = module()
        exploit.target = timeout_target.host
        exploit.port = timeout_target.port

>       assert exploit.check() in [True, False, None]

tests/test_exploit_scenarios.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
routersploit/core/exploit/exploit.py:187: in wrapper
    return fn(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <routersploit.modules.exploits.routers.netgear.rax30_rce.Exploit object at 0x7bb2f0b90c80>

    @mute
    def check(self):
        response = self.http_request(
            method="GET",
            path="/"
        )

>       if "WWW-Authenticate" in response.headers.keys() and \
          'Basic realm="RAX30"' in response.headers["WWW-Authenticate"]:
E         AttributeError: 'NoneType' object has no attribute 'headers'

routersploit/modules/exploits/routers/netgear/rax30_rce.py:56: AttributeError
=============================== warnings summary ===============================
routersploit/resources/wordlists/__init__.py:1: 16 warnings
  /build/routersploit/src/routersploit-3.4.3/routersploit/resources/wordlists/__init__.py:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources

routersploit/core/exploit/shell.py:2: 16 warnings
  /build/routersploit/src/routersploit-3.4.3/routersploit/core/exploit/shell.py:2: DeprecationWarning: 'telnetlib' is deprecated and slated for removal in Python 3.13
    import telnetlib

tests/test_exploit_scenarios.py::test_exploit_trash_response[Exploit119]
tests/test_exploit_scenarios.py::test_exploit_empty_response[Exploit119]
tests/test_exploit_scenarios.py::test_exploit_redirect_response[Exploit119]
tests/test_exploit_scenarios.py::test_exploit_error_response[Exploit119]
tests/test_exploit_scenarios.py::test_exploit_not_found_response[Exploit119]
  /usr/lib/python3.12/site-packages/pysnmp/hlapi/asyncio/sync/cmdgen.py:97: DeprecationWarning: There is no current event loop
    loop = asyncio.get_event_loop()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_exploit_scenarios.py::test_exploit_timeout_response[Exploit111]

Expected Behavior

test should pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants