Skip to content

Latest commit

 

History

History
18 lines (16 loc) · 929 Bytes

SMB.md

File metadata and controls

18 lines (16 loc) · 929 Bytes

SMB version check

#!/bin/sh #Description:

Requires root or enough permissions to use tcpdump

Will listen for the first 7 packets of a null login

and grab the SMB Version

#Notes:

Will sometimes not capture or will print multiple

lines. May need to run a second time for success.

if [ -z $1 ]; then echo "Usage: ./smbver.sh RHOST {RPORT}" && exit; else rhost=$1; fi if [ ! -z $2 ]; then rport=$2; else rport=139; fi tcpdump -s0 -n -i tap0 src $rhost and port $rport -A -c 7 2>/dev/null | grep -i "samba|s.a.m" | tr -d '.' | grep -oP 'UnixSamba.*[0-9a-z]' | tr -d '\n' & echo -n "$rhost: " & echo "exit" | smbclient -L $rhost 1>/dev/null 2>/dev/null sleep 0.5 && echo ""

SMB nmap Scripting Engine Vulnerability scan

nmap -p 139,445 10.11.1.115 -vv --script=smb-vuln-cve2009-3103.nse,smb-vuln-ms06-025.nse,smb-vuln-ms07-029.nse,smb-vuln-ms08-067.nse,smb-vuln-ms10-054.nse,smb-vuln-ms10-061.nse,smb-vuln-ms17-010.nse