Code Monkey home page Code Monkey logo

smb's Introduction

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

smb's People

Contributors

duckjibe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.