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

CPE Updates #267

Merged
merged 4 commits into from
Jun 3, 2020
Merged

CPE Updates #267

merged 4 commits into from
Jun 3, 2020

Conversation

tsellers-r7
Copy link
Contributor

Description

This PR:

  • Updates the CPE data per the instructions found here: https://github.com/rapid7/recog/blob/master/CONTRIBUTING.md#updating-cpes

    • The CPE mapping file was updated so there are improvements
    • I fixed a few duplicate values in fingerprints which allowed those fingerprint databases to be processed.
    • Note: The script will remove any CPE that hasn't actually been issued by NIST or that can't be constructed using Vendor/Product. The CPE mapping file assists where needed.
  • Manually adjusts the description of a Ubuntu and Debian MySQL banners to be a bit more consistent.

Motivation and Context

Improved CPE output.

How Has This Been Tested?

rspec
rake tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Content updates

Checklist:

  • I have updated the documentation accordingly (or changes are not required).
  • I have added tests to cover my changes (or new tests are not required).
  • All new and existing tests passed.

@tsellers-r7 tsellers-r7 requested a review from gwiseman-r7 May 27, 2020 16:59
@tsellers-r7
Copy link
Contributor Author

FYI @hdm I've changed quite a bit here...

<param pos="0" name="service.family" value="Pi-hole"/>
<param pos="0" name="service.product" value="Pi-hole"/>
<param pos="1" name="service.version"/>
<param pos="0" name="service.cpe23" value="cpe:/a:pi-hole:pi-hole:{service.version}"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI @brudis-r7 - This fingerprint has changed quite a bit.

<param pos="0" name="service.family" value="NetScaler"/>
<param pos="0" name="service.device" value="Network Management Device"/>
<param pos="0" name="service.product" value="NetScaler"/>
<param pos="0" name="service.cpe23" value="cpe:/a:citrix:netscaler:-"/>
</fingerprint>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI @brudis-r7 - This fingerprint has changed quite a bit.

Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably assert os/hw like the rest of them

<param pos="0" name="service.device" value="Network Management Device"/>
<param pos="0" name="service.product" value="NetScaler"/>
<param pos="1" name="service.version"/>
<param pos="0" name="service.cpe23" value="cpe:/a:citrix:netscaler:{service.version}"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI @brudis-r7 - This fingerprint has changed quite a bit.

Copy link
Contributor

Choose a reason for hiding this comment

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

OS fields need to be re-added. Add service too, but we can't remove OS without breaking things.

<param pos="2" name="os.arch"/>
<param pos="3" name="os.version"/>
<param pos="0" name="os.cpe23" value="cpe:/o:freebsd:freebsd:{os.version}"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI @brudis-r7 - This fingerprint has changed quite a bit.

@tsellers-r7
Copy link
Contributor Author

@hdm I can fix that. It does pass tests, etc.

cpe-remap.yaml Outdated Show resolved Hide resolved
<param pos="0" name="os.family" value="NetScaler"/>
<param pos="0" name="os.device" value="Network Management Device"/>
<param pos="0" name="os.product" value="NetScaler"/>
<param pos="0" name="service.vendor" value="Citrix"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

This removes the OS assert, it should not. This should probably assert HW too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can assert that as FreeBSD

Copy link
Contributor

Choose a reason for hiding this comment

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

It should be asserted as what it was before, not FreeBSD (its a custom OS)

Copy link
Contributor

Choose a reason for hiding this comment

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

This one in particular is a big deal, as we use the os and hw fields to set the device type and hardware type. Folks trying to find their possibly-exploitable NetScalers need this fingerprint to remain how it was (from our perspective).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, I can definitely sort this out. I'll try to review everywhere Netscaler exists and try to make it consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hdm - I'm going to sort this out this morning. RE: hardware assertions - there are virtual Netscalers. I'm not sure if we have an established policy on how to handle hw.* vs virtual machines. I'm leaning towards going ahead an using it here. Any thoughts?

</fingerprint>

Copy link
Contributor

Choose a reason for hiding this comment

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

Line breaks between fingerprints makes them much more readable, I guess you disagree?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The automation removes it.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, we can address in a future PR to auto-newline after each fingerprint, and update the automation to match, if yall agree.

Copy link
Contributor Author

@tsellers-r7 tsellers-r7 May 27, 2020

Choose a reason for hiding this comment

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

I've no issues with adding line breaks.

xml/ntp_banners.xml Outdated Show resolved Hide resolved
<param pos="2" name="os.version"/>
<param pos="0" name="os.product" value="NetScaler"/>
<param pos="1" name="os.version"/>
<param pos="2" name="os.version.version"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hdm @gwiseman-r7 - FYI, I've changed this fingerprint so as to return os.version that is consistent with other Netscaler fingerprints that return that same value. In doing so, I've made the fingerprint more specific by adding NS in ^NetScaler NS. In my surveys I don't see a banner without that NS.
The build number being captured in os.version.version should match what is found here: https://support.citrix.com/article/CTX121840#NS13

Any objections?

@hdm
Copy link
Contributor

hdm commented Jun 3, 2020

This all looks good here, thanks!

Copy link
Contributor

@gwiseman-r7 gwiseman-r7 left a comment

Choose a reason for hiding this comment

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

lgtm

@tsellers-r7 tsellers-r7 merged commit 41a57bf into rapid7:master Jun 3, 2020
@tsellers-r7 tsellers-r7 deleted the fixup_post_264 branch June 3, 2020 18:42
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.

3 participants