diff --git a/opencanary/modules/httpproxy.py b/opencanary/modules/httpproxy.py index f7ca0d2..51e2fd1 100644 --- a/opencanary/modules/httpproxy.py +++ b/opencanary/modules/httpproxy.py @@ -70,7 +70,7 @@ def logAuth(self): atype, token = auth_arr if atype == "Basic": try: - username, password = b64decode(token).split(":") + username, password = b64decode(token).decode("utf-8").split(":", 1) except: # noqa: E722 pass elif atype == "NTLM": diff --git a/opencanary/test/test_httpproxy.py b/opencanary/test/test_httpproxy.py index 7ee6154..fe21c5b 100644 --- a/opencanary/test/test_httpproxy.py +++ b/opencanary/test/test_httpproxy.py @@ -47,3 +47,5 @@ def test_httpproxy_auth_attempt_is_logged(): assert log["logtype"] == LoggerBase.LOG_HTTPPROXY_LOGIN_ATTEMPT assert "USERNAME" in log["logdata"] assert "PASSWORD" in log["logdata"] + assert log["logdata"]["USERNAME"] == "test_user" + assert log["logdata"]["PASSWORD"] == "test_pass"