Skip to content

Commit

Permalink
Test fix, one more Nuclei template (#802)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazet committed Feb 21, 2024
1 parent 4ef7bbf commit 0fa944c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions artemis/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ class Nuclei:
"http/misconfiguration/springboot/springboot-threaddump.yaml",
"http/misconfiguration/springboot/springboot-trace.yaml",
"http/vulnerabilities/generic/basic-xss-prober.yaml",
"http/vulnerabilities/generic/xss-fuzz.yaml",
]
),
cast=decouple.Csv(str),
Expand Down
8 changes: 7 additions & 1 deletion artemis/modules/nuclei.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ def _scan(self, templates: List[str], targets: List[str]) -> List[Dict[str, Any]
else str(int(0)),
] + additional_configuration

# The `-it` flag will include the templates provided in NUCLEI_ADDITIONAL_TEMPLATES even if
# they're marked with as tag such as `fuzz` which prevents them from being executed by default.
for template in Config.Modules.Nuclei.NUCLEI_ADDITIONAL_TEMPLATES:
command.append("-it")
command.append(template)

for target in targets:
command.append("-target")
command.append(target)
Expand Down Expand Up @@ -169,7 +175,7 @@ def run_multiple(self, tasks: List[Task]) -> None:

if messages:
status = TaskStatus.INTERESTING
status_reason = ", ".join(messages)
status_reason = ", ".join(sorted(messages))
else:
status = TaskStatus.OK
status_reason = None
Expand Down
2 changes: 1 addition & 1 deletion test/modules/test_nuclei.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_simple(self) -> None:
self.assertEqual(call.kwargs["status"], TaskStatus.INTERESTING)
self.assertEqual(
call.kwargs["status_reason"],
"[high] http://test-phpmyadmin-easy-password:80: phpMyAdmin - Default Login phpMyAdmin contains a default login vulnerability. An attacker can obtain access to user accounts and access sensitive information, modify data, and/or execute unauthorized operations.",
"[high] http://test-phpmyadmin-easy-password:80: phpMyAdmin - Default Login phpMyAdmin contains a default login vulnerability. An attacker can obtain access to user accounts and access sensitive information, modify data, and/or execute unauthorized operations., [info] http://test-phpmyadmin-easy-password:80: phpMyAdmin Panel - Detect phpMyAdmin panel was detected.",
)

def test_links(self) -> None:
Expand Down

0 comments on commit 0fa944c

Please sign in to comment.