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

41 lines
1.2 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:
- 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: 4a0a004730450221009a460623dfe3b876809643208d5dd756b39b08e0ba9a8040ec11f6f68c5ab7d402206a5c54e7c9ac8346d85da302a7ca144a4ad8982dede08376aff972041af6d629:922c64590222798bb761d5b6d8e72950