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

Add check for SSH passwords #512

Merged
merged 12 commits into from
Sep 14, 2023
Merged

Add check for SSH passwords #512

merged 12 commits into from
Sep 14, 2023

Conversation

anna1492
Copy link
Contributor

@anna1492 anna1492 commented Sep 4, 2023

No description provided.

@anna1492 anna1492 requested a review from kazet September 4, 2023 08:03
@anna1492 anna1492 linked an issue Sep 4, 2023 that may be closed by this pull request
@anna1492 anna1492 marked this pull request as draft September 4, 2023 08:04
@anna1492 anna1492 marked this pull request as ready for review September 4, 2023 08:04
@kazet
Copy link
Member

kazet commented Sep 4, 2023

so far it's a good direction, please fix license check and add tests/autoreport

@anna1492 anna1492 changed the title [WIP] Add check for SSH passwords Add check for SSH passwords Sep 11, 2023
@@ -26,6 +26,7 @@ class Severity(str, Enum):
ReportType("exposed_configuration_file"): Severity.HIGH,
ReportType("exposed_sql_dump"): Severity.HIGH,
ReportType("exposed_log_file"): Severity.HIGH,
ReportType("exposed_log_file"): Severity.HIGH,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate

if not task_result["status"] == "INTERESTING":
return []

if not isinstance(task_result["result"], SSHBruterResult):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when deserializing from db, it wouldn't be a SSHBruterResult instance, but a dict

@@ -0,0 +1,26 @@
{% if "exposed_ssh_with_easy_password" in data.contains_type %}
<li>{% trans %}The following address contains SSH server where simple login/password pair allows logging in:{% endtrans %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default we have plural in these messages (addresses contain SSH servers...)

"The following address contains SSH server where simple login/password "
"pair allows logging in:"
msgstr ""
"Na następującym adresie uruchomiony jest serwer SSH przez który można się"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"na który", not "przez który"


#: artemis/reporting/modules/ssh_bruter/template_exposed_ssh_with_easy_password.jinja2:10
msgid "username"
msgstr "użytkownikowi"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jak piszesz "Poniższe dane umożliwiają zalogowanie się" to potem w zdaniu przypadek musi się zgadzać: "nazwą użytkwonika ... i hasłem"

from artemis.reporting.base.templating import build_message_template
from artemis.reporting.export.translations import install_translations

environment = Environment(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO if we have multiple reporting test, we may factor the common code into something called BaseReportingTest, so that lines 15-22 don't duplicate with bruter

"The following addresses contain SSH server where simple login/password "
"pair allows logging in:"
msgstr ""
"Na następującym adresie uruchomiony jest serwer SSH na który można się "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you made the original plural, not the tanslated version

@@ -0,0 +1,25 @@
#: artemis/reporting/modules/ssh_bruter/template_exposed_ssh_with_easy_password.jinja2:2
msgid ""
"The following addresses contain SSH server where simple login/password "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ssh server -> ssh servers

msgid "empty password"
msgstr ""

#~ msgid "username"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nuke these commented translations

#: artemis/reporting/modules/ssh_bruter/template_exposed_ssh_with_easy_password.jinja2:11
#, fuzzy
msgid "and "
msgstr "i"
Copy link
Member

@kazet kazet Sep 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not use fuzzy matches if they aren't needed, and besides here you translate and with space to "i" without space - that's asking for trouble ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

polish version returns "ihasłem", so you need to preserve the space, preferably outside of translation

"The following addresses contain SSH servers where simple login/password "
"pair allows logging in:"
msgstr ""
"Na następujących adresach uruchomione są serwery SSH do których można się"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pewnie lepiej "pod następującymi adresami" niż "na"

kazet
kazet previously approved these changes Sep 14, 2023
@kazet kazet merged commit 23c0981 into main Sep 14, 2023
@kazet kazet deleted the bruter-ssh branch September 14, 2023 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a check for easy ssh passwords
3 participants