Merge pull request #9561 from Puben/smb-detect-linux-and-windows

Smb detect linux and windows
This commit is contained in:
Dhiyaneshwaran
2024-06-05 14:09:04 +05:30
committed by GitHub
3 changed files with 41 additions and 63 deletions

View File

@@ -0,0 +1,41 @@
id: samba-detect
info:
name: Samba - Detection
author: pussycat0x
severity: info
description: |
Samba allows file and print sharing between computers running Microsoft Windows and computers running Unix. It is an implementation of dozens of services and a dozen protocols, including: NetBIOS over TCP/IP (NBT) SMB (known as CIFS in some versions)
metadata:
max-request: 1
shodan-query: "port:445"
tags: js,network,samba,detect,linux
javascript:
- code: |
let m = require("nuclei/smb");
let c = new m.SMBClient();
let response = c.ConnectSMBInfoMode(Host, Port);
const conditionsMet = (response.SupportV1 === true && response.Version.VerString === "SMB 1.0");
if (conditionsMet) {
if (response.NTLM === "") {
printedValue = "Samba detected";
} else {
printedValue = response.NTLM;
}
}
else {
process.exit(1);
}
args:
Host: "{{Host}}"
Port: 445
extractors:
- type: dsl
dsl:
- response