Skip to content
Merged
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
2 changes: 1 addition & 1 deletion scanners/wpscan/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: A Helm chart for the WordPress security scanner that integrates wit
type: application
# version - gets automatically set to the secureCodeBox release version when the helm charts gets published
version: v3.1.0-alpha1
appVersion: "v3.8.28"
appVersion: "v4.0.0"
kubeVersion: ">=v1.11.0-0"
annotations:
versionApi: https://api.github.com/repos/wpscanteam/wpscan/releases/latest
Expand Down
2 changes: 1 addition & 1 deletion scanners/wpscan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 'WPScan'
category: 'scanner'
type: "CMS"
state: "released"
appVersion: "v3.8.28"
appVersion: "v4.0.0"
usecase: "Wordpress Vulnerability Scanner"
---

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{
"banner": {
"description": "WordPress Security Scanner",
"version": "4.0.0",
"sponsor": "An Automattic endeavor"
},
"start_time": 1781277493,
"start_memory": 55910400,
"command_line": "wpscan -o /home/securecodebox/wpscan-results.json -f json --url old-wordpress.demo-targets.svc",
"hostname": "scan-wpscan-old-wordpress-no-opt-6lx6g-4xgtr",
"target_url": "http://old-wordpress.demo-targets.svc/",
"target_ip": "10.96.236.51",
"effective_url": "http://old-wordpress.demo-targets.svc/",
"interesting_findings": [
{
"url": "http://old-wordpress.demo-targets.svc/",
"to_s": "Headers",
"type": "headers",
"found_by": "Headers (Passive Detection)",
"confidence": 100,
"confirmed_by": {

},
"references": {

},
"interesting_entries": [
"Server: Apache/2.4.25 (Debian)",
"X-Powered-By: PHP/7.2.12"
]
},
{
"url": "http://old-wordpress.demo-targets.svc/xmlrpc.php",
"to_s": "XML-RPC seems to be enabled: http://old-wordpress.demo-targets.svc/xmlrpc.php",
"type": "xmlrpc",
"found_by": "Direct Access (Aggressive Detection)",
"confidence": 100,
"confirmed_by": {

},
"references": {
"url": [
"http://codex.wordpress.org/XML-RPC_Pingback_API"
],
"metasploit": [
"auxiliary/scanner/http/wordpress_ghost_scanner",
"auxiliary/dos/http/wordpress_xmlrpc_dos",
"auxiliary/scanner/http/wordpress_xmlrpc_login",
"auxiliary/scanner/http/wordpress_pingback_access"
]
},
"interesting_entries": [

]
},
{
"url": "http://old-wordpress.demo-targets.svc/readme.html",
"to_s": "WordPress readme found: http://old-wordpress.demo-targets.svc/readme.html",
"type": "readme",
"found_by": "Direct Access (Aggressive Detection)",
"confidence": 100,
"confirmed_by": {

},
"references": {

},
"interesting_entries": [

]
},
{
"url": "http://old-wordpress.demo-targets.svc/wp-cron.php",
"to_s": "The external WP-Cron seems to be enabled: http://old-wordpress.demo-targets.svc/wp-cron.php",
"type": "wp_cron",
"found_by": "Direct Access (Aggressive Detection)",
"confidence": 60,
"confirmed_by": {

},
"references": {
"url": [
"https://www.iplocation.net/defend-wordpress-from-ddos",
"https://github.com/wpscanteam/wpscan/issues/1299"
]
},
"interesting_entries": [

]
}
],
"version": {
"number": "4.9.8",
"release_date": "2018-08-02",
"status": "insecure",
"found_by": "Emoji Settings (Passive Detection)",
"confidence": 100,
"interesting_entries": [
"http://old-wordpress.demo-targets.svc/, Match: 'wp-includes\\/js\\/wp-emoji-release.min.js?ver=4.9.8'"
],
"confirmed_by": {
"Meta Generator (Passive Detection)": {
"confidence": 60,
"interesting_entries": [
"http://old-wordpress.demo-targets.svc/, Match: 'WordPress 4.9.8'"
]
}
},
"vulnerabilities": [

]
},
"main_theme": null,
"vuln_api": {
"error": "No WPScan API Token given, as a result vulnerability data has not been output.\nYou can get a free API token with 25 daily requests by registering at https://wpscan.com/register"
},
"stop_time": 1781277495,
"elapsed": 1,
"requests_done": 27,
"cached_requests": 4,
"response_status_codes": {
"200": 16,
"301": 8,
"302": 2,
"403": 1
},
"response_status_codes_warning": false,
"response_status_codes_warnings": [

],
"data_sent": 7177,
"data_sent_humanised": "7.009 KB",
"data_received": 334517,
"data_received_humanised": "326.677 KB",
"used_memory": 148590592,
"used_memory_humanised": "141.707 MB"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: the secureCodeBox authors

SPDX-License-Identifier: Apache-2.0
71 changes: 41 additions & 30 deletions scanners/wpscan/parser/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,43 @@
//
// SPDX-License-Identifier: Apache-2.0

/**
* convert pugings
*/
function transformPlugins(plugins) {
const pluginVulnerabilities = Object.values(report.plugins).flatMap(
(plugin) =>
plugin.vulnerabilities.map((vulnerability) => {
// Create a flattened array of references with their types
const references = Object.entries(vulnerability.references).flatMap(
([key, elements]) =>
elements.map((element) => ({
type: key.toUpperCase(),
value: element,
})),
);
// Return the plugin vulnerabilities object for the current plugin and vulnerability
return {
name: `WordPress finding: vulnerability in '${plugin["slug"]}'`,
description: vulnerability["title"],
category: "WordPress Plugin",
location: plugin["location"],
osi_layer: "APPLICATION",
severity: "HIGH",
references: references.length > 0 ? references : null,
attributes: {
hostname: targetUrl,
confidence: plugin["confidence"],
wp_interesting_entries: plugin["interesting_entries"],
wp_found_by: plugin["found_by"],
wp_confirmed_by: plugin["confirmed_by"],
},
};
}),
);
return pluginVulnerabilities;
}

/**
* Convert the WPScan file / json into secureCodeBox Findings
*/
Expand Down Expand Up @@ -81,37 +118,11 @@
},
);

let pluginVulnerabilities = [];
// Add plugin vulnerabilities as HIGH
const pluginVulnerabilities = Object.values(report.plugins).flatMap(
(plugin) =>
plugin.vulnerabilities.map((vulnerability) => {
// Create a flattened array of references with their types
const references = Object.entries(vulnerability.references).flatMap(
([key, elements]) =>
elements.map((element) => ({
type: key.toUpperCase(),
value: element,
})),
);
// Return the plugin vulnerabilities object for the current plugin and vulnerability
return {
name: `WordPress finding: vulnerability in '${plugin["slug"]}'`,
description: vulnerability["title"],
category: "WordPress Plugin",
location: plugin["location"],
osi_layer: "APPLICATION",
severity: "HIGH",
references: references.length > 0 ? references : null,
attributes: {
hostname: targetUrl,
confidence: plugin["confidence"],
wp_interesting_entries: plugin["interesting_entries"],
wp_found_by: plugin["found_by"],
wp_confirmed_by: plugin["confirmed_by"],
},
};
}),
);
if (report.plugin) {
const pluginVulnerabilities = transformPlugins(report.plugin);

Check warning on line 124 in scanners/wpscan/parser/parser.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this useless assignment to variable "pluginVulnerabilities".

See more on https://sonarcloud.io/project/issues?id=secureCodeBox_secureCodeBox&issues=AZ7LAIzdXn7w6DfE9ueC&open=AZ7LAIzdXn7w6DfE9ueC&pullRequest=3655

Check warning on line 124 in scanners/wpscan/parser/parser.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the declaration of the unused 'pluginVulnerabilities' variable.

See more on https://sonarcloud.io/project/issues?id=secureCodeBox_secureCodeBox&issues=AZ7LAIzdXn7w6DfE9ueB&open=AZ7LAIzdXn7w6DfE9ueB&pullRequest=3655
}

// Combine all findings and return
return [summaryFinding, ...interestingFindings, ...pluginVulnerabilities];
Expand Down
Loading
Loading