secubox-openwrt/package/secubox/luci-app-secubox-p2p/htdocs/luci-static/resources/view/secubox-p2p/peers.js
CyberMind-FR e58f479cd4 feat(waf): Update WAF scenarios with 2024-2025 CVEs and OWASP threats
Add detection patterns for latest actively exploited vulnerabilities:
- CVE-2025-55182 (React2Shell, CVSS 10.0)
- CVE-2025-8110 (Gogs RCE), CVE-2025-53770 (SharePoint)
- CVE-2025-52691 (SmarterMail), CVE-2025-40551 (SolarWinds)
- CVE-2024-47575 (FortiManager), CVE-2024-21887 (Ivanti)
- CVE-2024-3400, CVE-2024-0012, CVE-2024-9474 (PAN-OS)

New attack categories based on OWASP Top 10 2025:
- HTTP Request Smuggling (TE.CL/CL.TE conflicts)
- AI/LLM Prompt Injection (ChatML, instruction markers)
- WAF Bypass techniques (Unicode normalization, double encoding)
- Supply Chain attacks (CI/CD poisoning, dependency confusion)
- Extended SSTI (Jinja2, Freemarker, Velocity, Thymeleaf)
- API Abuse (BOLA/IDOR, mass assignment)

CrowdSec scenarios split into 11 separate files for reliability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 05:02:57 +01:00

100 lines
2.6 KiB
JavaScript

"use strict";
"require view";
"require ui";
"require rpc";
"require secubox/kiss-theme";
var callGetPeers = rpc.declare({
object: "luci.secubox-p2p",
method: "get_peers",
expect: { peers: [] }
});
return view.extend({
peers: [],
load: function() {
var self = this;
return callGetPeers().then(function(result) {
// Handle RPC expect extraction: result IS the peers array
self.peers = Array.isArray(result) ? result : (result.peers || []);
return {};
}).catch(function(err) {
console.error("P2P Peers error:", err);
return {};
});
},
render: function() {
var self = this;
var rows = [];
rows.push(E("tr", { "class": "tr table-titles" }, [
E("th", { "class": "th" }, "Name"),
E("th", { "class": "th" }, "Address"),
E("th", { "class": "th" }, "Status"),
E("th", { "class": "th" }, "Actions")
]));
if (this.peers && this.peers.length > 0) {
this.peers.forEach(function(peer) {
rows.push(E("tr", { "class": "tr" }, [
E("td", { "class": "td" }, peer.name || peer.id),
E("td", { "class": "td" }, peer.address || "Unknown"),
E("td", { "class": "td" }, E("span", {
"style": "color: " + (peer.status === "online" ? "#10b981" : "#ef4444")
}, peer.status || "unknown")),
E("td", { "class": "td" }, [
E("button", {
"class": "cbi-button cbi-button-remove",
"click": function() { self.removePeer(peer.id); }
}, "Remove")
])
]));
});
} else {
rows.push(E("tr", { "class": "tr" }, [
E("td", { "class": "td", "colspan": "4", "style": "text-align:center" },
"No peers found. Click Discover to find peers.")
]));
}
var content = E("div", { "class": "cbi-map" }, [
E("h2", {}, "P2P Peers"),
E("div", { "class": "cbi-section" }, [
E("div", { "style": "margin-bottom: 1em;" }, [
E("button", {
"class": "cbi-button cbi-button-action",
"click": function() { self.discoverPeers(); }
}, "Discover Peers"),
E("button", {
"class": "cbi-button",
"style": "margin-left: 0.5em;",
"click": function() { self.addPeerManually(); }
}, "Add Peer")
]),
E("table", { "class": "table" }, rows)
])
]);
return KissTheme.wrap(content, 'admin/secubox/mirrorbox/peers');
},
discoverPeers: function() {
ui.addNotification(null, E("p", "Discovering peers..."), "info");
location.reload();
},
addPeerManually: function() {
ui.addNotification(null, E("p", "Manual add not implemented yet"), "info");
},
removePeer: function(peerId) {
ui.addNotification(null, E("p", "Remove not implemented yet"), "info");
},
handleSaveApply: null,
handleSave: null,
handleReset: null
});