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

Create separate finding for Microsoft RDP port #3882

Merged
merged 31 commits into from
Nov 28, 2024

Conversation

stephanie0x00
Copy link
Contributor

@stephanie0x00 stephanie0x00 commented Nov 25, 2024

Changes

This PR updates the findings DB and tweaks the bit for port classification such that when a Microsoft RDP port is detected, a separate finding is created for this. From a security perspective it is good to know if this point is present in the attack surface.

If an open RDP port is detected, the finding is given a 'medium' severity, as there is no immediate risk per se. A recommendation severity would also be possible, however RDP is often the root cause for ransomware attacks, thus that feels a bit low. Other ideas for an appropriate severity are welcome.

Issue link

Partial solution for #3837

Demo

image

QA notes

  • Perform a nmap scan against a server with an open RDP port, e.g. run nc -l 3389 locally or use the IP from the screenshot (this is a Google server).
  • Perform nmap tcp scan against the IP.
  • Somehow the finding Type didn't resolve properly, thus the finding remained pending. This can be resolved by triggering the Finding type boefje manually.

Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue.
  • I have written unit tests for the changes or fixes I made.
  • I have checked the documentation and made changes where necessary.
  • I have performed a self-review of my code and refactored it to the best of my abilities.
  • Tickets have been created for newly discovered issues.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • I have included comments in the code to elaborate on what is not self-evident from the code itself, including references to issues and discussions online, or implicit behavior of an interface.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@stephanie0x00 stephanie0x00 requested a review from a team as a code owner November 25, 2024 11:58
@stephanie0x00 stephanie0x00 self-assigned this Nov 25, 2024
@noamblitz
Copy link
Contributor

I think its a good idea to add this to the Question as well since all other port configs are also asked there. For the rest this looks good!

@stephanie0x00
Copy link
Contributor Author

I've updated the Question schema 👍

Copy link
Contributor

@ammar92 ammar92 left a comment

Choose a reason for hiding this comment

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

Nice work! Just a few tiny things to complete this PR:

  • Since one of the recommendation strings has been updated; it affected the test_port_classification_tcp_22 test in Octopoes. Meaning "should not be open" should be changed to "should possibly not be open."
  • Format error in the JSON file, can be fixed by running pre-commit

@Rieven
Copy link
Contributor

Rieven commented Nov 27, 2024

Checklist for QA:

  • I have checked out this branch, and successfully ran a fresh make reset.
  • I confirmed that there are no unintended functional regressions in this branch:
    • I have managed to pass the onboarding flow
    • Objects and Findings are created properly
    • Tasks are created and completed properly
  • I confirmed that the PR's advertised feature or hotfix works as intended.
  • I checked the logs for errors and/or warnings and made issues where necessary

What works:

It works

@noamblitz
Copy link
Contributor

Checklist for QA:

  • I have checked out this branch, and successfully ran a fresh make reset.

  • I confirmed that there are no unintended functional regressions in this branch:

    • I have managed to pass the onboarding flow
    • Objects and Findings are created properly
    • Tasks are created and completed properly
  • I confirmed that the PR's advertised feature or hotfix works as intended.

  • I checked the logs for errors and/or warnings and made issues where necessary

What works:

It works

I love this. "What works?" "IT works."

underdarknl
underdarknl previously approved these changes Nov 27, 2024
Copy link

sonarcloud bot commented Nov 28, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
38.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@underdarknl underdarknl merged commit dad9c3d into main Nov 28, 2024
31 of 33 checks passed
@underdarknl underdarknl deleted the fix/add-separate-rdp-finding branch November 28, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants