Repository navigation
Conversation
…ASP#1945) The \;version:\1 and \;confidence suffixes are Wappalyzer syntax, not part of the match, so these fingerprints could not match real responses. Strip the suffix from 20 entries (Nginx and the entries with $ before the suffix) and add tests for each.
Contributor
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Contribution validation failed:
|
|
Contribution validation failed:
|
|
Contribution validation failed:
|
12 of 19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1945 (first batch)
Proposed change
Many regexes in
nettacker/modules/scan/web_technologies.yamlstill carry Wappalyzer's version-extraction suffix (\;version:\1,\;confidence:NN). In a Python regex\;is a literal;, so the pattern also requires the text;version:in the response, which real servers never send. The fingerprint therefore cannot match. This PR removes the suffix from 20 lines: the NginxServerregex (it only matches if the response contains;version:) and 19 entries where an unescaped$sits right before the suffix, which makes a match impossible. Only the suffix text is removed from those lines; everything else is unchanged (20 insertions, 20 deletions, 238 characters removed). Versions are not reported; this is detection only.Not in this PR:
confidence:0made it a weak fingerprint, and stripping it would make it over-broad. CodeIgniter: stripping changes nothing. FancyBox and Inveon: content patterns where$means the end of the body.$(for example Apache and Python's SimpleHTTP; I confirmed both are missed on real containers). I would send those in later batches if you agree.Verification
Real containers on an isolated Docker network with no published ports,
web_technologies_scan, technologies reported on upstream/master (2f23fab) and on this branch:Server: nginx/1.30.4server_tokens offServer: nginxX-Powered-By: EasyEngine v4X-Powered-PublicCMS: V6Server: Warp/3.4.21on/version;GET /returns 405kbn-versionon/,/loginor/api/statusServer: Apache/2.4.71 (Unix)Server: CaddyServer: SimpleHTTP/0.6 Python/3.11.16Apart from the intended new detections (Nginx, EasyEngine, Public CMS) the two states are identical. Apache and Python are missed in both states because they carry the suffix without
$(not in this batch).I also ran the Nginx case myself on the official nginx container (
Server: nginx/1.30.4, port 8081, real CLI:python nettacker.py -i 127.0.0.1 -m web_technologies_scan -g 8081 -t 1 -M 1 --skip-service-discovery).Before, upstream master (61bab4e): no technology reported, only the generic status row.
After, this branch: "Nginx Found".
Real software: Nginx, EasyEngine (v4.15.0) and Public CMS (V6) are detected on this branch and not on master. The Nginx run I did myself; the others were run by Claude Code against pinned images on an isolated network, and I reviewed the captured headers. Warp's real header matches the edited regex, but the pandoc server I could run answers
GET /with 405, so the module cannot see it. Kibana 8.19.23 does not sendkbn-versionat all, so that fingerprint is stale for current Kibana (the edit is still correct; it just cannot fire there). I did not run Shopware (1.6 GB); from its source the two headers are not sent onGET /. The remaining entries are covered only by unit tests with sample responses built from each product's source or documentation (links in the test file): several are SaaS or proprietary (Oracle Commerce Cloud, Shopfa, SharePoint), and the others (Kooboo, Umbraco, Neos, Sulu, CppCMS, Aegea, PHPFusion, Arastta) need a source build or a database, or have no maintained image. Where I found no vendor documentation (Aegea, Arastta, Kooboo, Oracle Commerce Cloud, PHPFusion, Shopfa) the sample comes from the webappanalyzer fingerprint, so it is not verified against the real product.Tests:
tests/unit/test_web_technologies_scan.py(233 tests) runs each edited entry throughTemplateLoaderandresponse_conditions_matched, the same path the module uses. It checks a positive sample, a negative sample, eight neutral server responses, that the suffix is gone, and that no edited regex matches the empty string.tests/unit/test_yaml_schema_and_regex.pystill passes (134 passed, 6 skipped).Limits and questions
add_headerthat may drop the header), Public CMS only on/after the install, Kibana only in setup mode without Elasticsearch, and Warp only where/is not 200. Some unit test samples are older than what the real products send (Kibana 4.5kbn-version, EasyEngine 2.2.3, Public CMS V5); the real responses also match the regexes, except Kibana 8, which sends nokbn-version. Other entries: the Public CMS header format and the Shopware headers onGET /are unconfirmed.AI tools were used in preparing this PR. I reviewed the diff and the tests and can explain every change.
Type of change
Checklist
make pre-commitand confirm it didn't generate any warnings/changesmake testand I confirm all tests passed locallydocs/folder (no user-facing behavior or description text changed)