GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - vcsi/SMB: SMB powershell script

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
Get-SMBversion.ps1
Get-SMBversion.ps1
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
capture1.png
capture1.png
 
 
capture2.png
capture2.png
 
 
capture3.png
capture3.png
 
 

Repository files navigation

SMB

A full powershell SMB scanner
Also Useful to get last reboot date/time
The first time, I am trying to play with Tcpclient and SMB.
Tested in production with Windows and no Windows targets.

.DESCRIPTION

Get higher SMB dialect and signing setting from a given computer name.

No authentication required
TCP port 445 must be reachable
Not additional powershell module required
Tested on windows 7, 10 and windows 2012 R2
Use same dialect list as Windows 10.

Function used:
    PushToTcpPort
    GetOutput

.PARAMETER

-ComputerName   : Computer name or IP
-TrustedDomain  : FQDN Domain Name (not used to query only to output reference)
-SMBV1          : Query SMBV1 only
-Verbose        : To display response packet to negotiate query

.EXAMPLE

# SMBV2 and SMBV1 =================
.\Get-SMBversion.ps1  (default current computer)

.\Get-SMBversion.ps1 -ComputerName W2012R2SRV -TrustedDomain contoso.com
Negotiating SMBV2 dialect on:  W2012R2SRV
 SMBV2 Negotiated Dialect   :  SMB 3.2
Negotiating SMBV1 dialect on:  W2012R2SRV
 SMBV1 Negotiated Dialect   :  NT LM 0.12

Domain            : contoso.com
Host              : W2012R2SRV
IsSmbV1           : True
DialectSmbV1      : NT LM 0.12
IsSmbV2           : True
DialectSmbv2      : 3.2
Signing           : 0001
ServerStartupTime : 11/5/2018 2:21:40 PM

# SMBV2 and SMBV1 to host supporting only SMBV2 
.\Get-SMBversion.ps1 -ComputerName smbv2onlyhost  -TrustedDomain contoso.com
Negotiating SMBV2 dialect on:  smbv2onlyhost
 SMBV2 Negotiated Dialect   :  SMB 3.11
Negotiating SMBV1 dialect on:  smbv2onlyhost
 Not any requested dialects found on this host. Timeout: True

Domain            : contos0.com
Host              : smbv2onlyhost
IsSmbV1           : False
DialectSmbV1      : na
IsSmbV2           : True
DialectSmbv2      : 3.11
Signing           : 0001
ServerStartupTime : 10/8/2018 2:53:16 PM

# SMBV1 only ======================
.\Get-SMBversion.ps1 -ComputerName W2012R2SRV -TrustedDomain contoso.com -smbv1 
Negotiating SMB dialect on:  W2012R2SRVT
Negotiated Dialect        :  NT LM 0.12

Domain       : contoso.com
Host         : W2012R2SRV
IsSmbV1      : True
DialectSmbV1 : NT LM 0.12

# Do not support pipeline option but you can use a server array
$server = get-content .\myserverlist.txt
$server | foreach {.\Get-SMBversion.ps1 -computername $_}

Reference:
    https://msdn.microsoft.com/en-us/library/cc246482.aspx
    https://msdn.microsoft.com/en-us/library/cc246561.aspx

Screenshot

Screenshot

Screenshot

Screenshot

About

SMB powershell script

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.