nuclei-templates/javascript/enumeration/smb/smb2-server-time.yaml

44 lines
1.3 KiB
YAML

id: smb2-server-time
info:
name: SMB2 Server Time - Detection
author: DhiyaneshDK
severity: info
description: |
Trying to retrieve the present date of the system along with the initiation date of an SMB2 server.
reference:
- https://nmap.org/nsedoc/scripts/smb2-time.html
metadata:
verified: true
max-request: 1
shodan-query: "port:445"
product: dionaea
vendor: dionaea
tags: js,network,smb,enum
javascript:
- pre-condition: |
isPortOpen(Host,Port);
code: |
var m = require("nuclei/smb");
var c = m.SMBClient();
var response = c.ConnectSMBInfoMode(Host,Port);
var systemTime = new Date(response.NegotiationLog.SystemTime * 1000).toISOString();
var serverstartTime = new Date(response.NegotiationLog.ServerStartTime * 1000).toISOString();
var result = "SystemTime: " + systemTime + " ServerStartTime: " + serverstartTime;
result
args:
Host: "{{Host}}"
Port: "445"
matchers:
- type: dsl
dsl:
- success
extractors:
- type: dsl
dsl:
- response
# digest: 4a0a00473045022013006e9d06b0b532467ee26837a9b73a8860f68b0a9273b3a86432011dc6a703022100a0e955c3bdf25e5b8d0ceb05347c41d56971f7378e4dae09307c768ddf8aa980:922c64590222798bb761d5b6d8e72950