Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions xml/http_servers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
<param pos="0" name="apache.variant" value="Oracle"/>
</fingerprint>

<fingerprint pattern="^Oracle-HTTP-Server(?:(?:-(?:\d{2}[cg]\/?)?([\d.]+)?(?:\/[\d.]+)?)?(?:.{0,512}\([TF]?[HSUGMN]?(?:;max-age=\d+(?:\+\d+)?)?(?:;age=\d+)?;ecid=[^)]+\))?)?$">
<fingerprint pattern="^Oracle-HTTP-Server(?:(?:-(?:\d{2}[cg]\/?)?([\d.]+)?(?:\/[\d.]+)?)?(?:.{0,512}\([TF]?[HSUGMN]?(?:;max-age=\d+(?:\+\d*))?(?:;age=\d+)?;ecid=[^)]+\))?)?$">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This change is not semantically equivalent. (?:\+\d+)? (optional: + followed by one-or-more digits) is different than (?:\+\d*) (required: + followed by zero-or-more digits - no outer ?).

If a server sends max-age=1800 without +<value>, the old regex will still capture it, while the new one will not match, causing the full (?:;max-age=...) outer group to fail.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Also, is this change necessary? I'm wondering if the original regex causes a warning using ruby 3.3.8:

ruby -e 'Regexp.new(/^Oracle-HTTP-Server(?:(?:-(?:\d{2}[cg]\/?)?([\d.]+)?(?:\/[\d.]+)?)?(?:.{0,512}\([TF]?[HSUGMN]?(?:;max-age=\d+(?:\+\d+)?)?(?:;age=\d+)?;ecid=[^)]+\))?)?$/)'

<description>Oracle HTTP Server</description>
<example>Oracle-HTTP-Server</example>
<example>Oracle-HTTP-Server-11g</example>
Expand Down Expand Up @@ -935,7 +935,7 @@
<param pos="0" name="service.cpe23" value="cpe:/a:acme:mini_httpd:-"/>
</fingerprint>

<fingerprint pattern="^LiteSpeed\/?([\d.]+)?(?: \S+)?">
<fingerprint pattern="^LiteSpeed\/?([\d.]*)(?: \S+)?">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same here, it looks like no warning is returned with this regex:

ruby -e 'Regexp.new("^LiteSpeed\/?([\d.]+)?(?: \S+)?")'

I checked the other changes and none of them seems to produce a warning. Please, can you check if these changes are really necessary?

<description>LiteSpeed</description>
<example>LiteSpeed</example>
<example service.version="5.2.8">LiteSpeed/5.2.8 Enterprise</example>
Expand All @@ -954,7 +954,7 @@
<param pos="1" name="service.version"/>
</fingerprint>

<fingerprint pattern="^openresty\/?([\d.]+)?$">
<fingerprint pattern="^openresty\/?([\d.]*)$">
<description>OpenResty OpenResty</description>
<example>openresty</example>
<example service.version="1.13.6.2">openresty/1.13.6.2</example>
Expand Down Expand Up @@ -1065,7 +1065,7 @@
<param pos="0" name="service.cpe23" value="cpe:/a:varnish_cache_project:varnish_cache:-"/>
</fingerprint>

<fingerprint pattern="^Tengine\/?([\d.]+)?$">
<fingerprint pattern="^Tengine\/?([\d.]*)$">
<description>Tengine</description>
<example>Tengine</example>
<example service.version="2.0.0">Tengine/2.0.0</example>
Expand Down Expand Up @@ -1558,7 +1558,7 @@
<param pos="0" name="service.cpe23" value="cpe:/a:f5:nginx:-"/>
</fingerprint>

<fingerprint pattern="^nginx\/?([\d.]+)?">
<fingerprint pattern="^nginx\/?([\d.]*)">
<description>nginx with version info and/or mods</description>
<example service.version="0.8.53">nginx/0.8.53 + Phusion Passenger 3.0.0 (mod_rails/mod_rack)</example>
<example service.version="0.8.53">nginx/0.8.53</example>
Expand Down Expand Up @@ -2769,7 +2769,7 @@
<param pos="1" name="service.version"/>
</fingerprint>

<fingerprint pattern="^Embedthis-(?:Appweb|http)\/?([\d.]+)?$">
<fingerprint pattern="^Embedthis-(?:Appweb|http)\/?([\d.]*)$">
<description>Embedthis AppWeb</description>
<example service.version="3.2.3">Embedthis-Appweb/3.2.3</example>
<example>Embedthis-http</example>
Expand Down Expand Up @@ -3490,7 +3490,7 @@
<param pos="0" name="os.device" value="Router"/>
</fingerprint>

<fingerprint pattern="^UPnP/Tomato ([\d\.]+)?[\w\s\.-]{1,30} UPnP/[\d\.]+ MiniUPnPd/([\d\.]+)$">
<fingerprint pattern="^UPnP/Tomato ([\d\.]*)[\w\s\.-]{1,30} UPnP/[\d\.]+ MiniUPnPd/([\d\.]*)$">
<description>TomatoUSB UPnP Server</description>
<example os.version="1.28.9014" service.version="1.8">UPnP/Tomato 1.28.9014 MIPSR2-RAF-v1.3g K26 UPnP/1.1 MiniUPnPd/1.8</example>
<example os.version="1.28.0000" service.version="1.9">UPnP/Tomato 1.28.0000 MIPSR2-132 K26 USB VPN UPnP/1.1 MiniUPnPd/1.9</example>
Expand Down
4 changes: 2 additions & 2 deletions xml/operating_system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- Windows begin -->

<fingerprint pattern="(?i)^(?:Microsoft )?(Windows (?:[a-z]+\s[a-z]+\s|[a-z]+\s)?Server (?:\d{4} R2|\d{4}))(?:,\s|\s)?([a-z]+)?(?: Evaluation)?(?: Edition)?(?:\s|\swith(?:out)? Hyper-V\s)?(SP\d|SP \d|Service Pack \d)?$">
<fingerprint pattern="(?i)^(?:Microsoft )?(Windows (?:[a-z]+\s[a-z]+\s|[a-z]+\s)?Server (?:\d{4} R2|\d{4}))(?:,\s|\s)?([a-z]*)(?: Evaluation)?(?: Edition)?(?:\s|\swith(?:out)? Hyper-V\s)?(SP\d|SP \d|Service Pack \d)?$">
<description>Windows Server 2003 and later</description>
<example os.product="Windows Compute Cluster Server 2003">Windows Compute Cluster Server 2003</example>
<example os.product="Windows Server 2003" os.edition="Standard">Windows Server 2003, Standard Edition</example>
Expand Down Expand Up @@ -729,4 +729,4 @@

<!-- Network equipment end -->

</fingerprints>
</fingerprints>
4 changes: 2 additions & 2 deletions xml/smb_native_os.xml
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@
<param pos="0" name="hw.vendor" value="Apple"/>
</fingerprint>

<fingerprint pattern="^EMC-SNAS:T([\d\.]+)?$">
<fingerprint pattern="^EMC-SNAS:T([\d\.]*)$">
<description>EMC Celerra</description>
<example service.version="7.1.80.7" os.version="7.1.80.7">EMC-SNAS:T7.1.80.7</example>
<param pos="0" name="service.vendor" value="EMC"/>
Expand Down Expand Up @@ -865,4 +865,4 @@
<param pos="0" name="service.cpe23" value="cpe:/a:samba:samba:-"/>
</fingerprint>

</fingerprints>
</fingerprints>