Giter VIP home page Giter VIP logo

poshnmap's Introduction

PoshNmap

PSGallery PSGalleryDL

ADO GHRelease

ADOvNext GHPreRelease


This project's goal is to deliver an effective wrapper around the Nmap Network Discovery tool, providing Powershell-y behavior and sensible autocomplete as well as formatting output into usable, parseable Powershell objects for better filtering and analysis than trying to use the nmap raw text or XML output formats.

Why

People are constantly trying to reinvent the wheel on network discovery in Powershell, via Test-Netconnection, Test-Connection, ping sweep scripts. Immediately they realize the timeout issues with these options make them slow, slow, slow. Nmap is an extremely well optimized and mature tool for this purpose, and available everywhere Powershell Core is. However, its syntax is obtuse, and its default output does not lend itself well to parsing and analytics by other tools. PoshNmap aims to solve those problems by providing a friendly Powershell interface to the tool.

Features

  • PS 5.1 and Core Compatible
  • Powershell Cmdlet to interact with Nmap in a friendly way.
  • Intellisense and Tab Autocomplete for relevant parameters (-Preset, -OutFormat, etc.)
  • Power users can do advanced scans with -ArgumentList parameter
  • Real time status updates via Write-Progress including percent complete and ETA
  • Default output is a friendly list of Powershell objects representing scanned hosts
  • Multiple output format options: Raw Nmap, XML, JSON, PSObject, Hashtable
  • Detailed Verbose output including the underlying nmap command line that was run

Demo

Simple Scan

Simple Scan with Custom Arguments (nmap-style)

Scan of Home Router using QuickPlus Preset (Includes OS/Service Fingerprinting)

Scan using various output formats

Installation

Visit the Powershell Gallery for installation options.

You must also have Nmap already installed and in your path. Visit nmap.org for various install options. It is usually available in Various package managers, and is available in Chocolatey for windows with choco install nmap

Output Notes

Currently all outputs but the default PoshNmap output can be considered "stable" and used as input to other scripts or commands. The PoshNmap output "nmapResult" property is also stable, however all other properties should be considered "in flux" and may change in minor revisions "0.x.0" without notice until this project reaches 1.0.0

poshnmap's People

Contributors

justingrote avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

poshnmap's Issues

How to run scripts correctly in invoke-nmap?

How would I run this command within invoke-nmap?

nmap -Pn -sV --script ssl-enum-ciphers -p 3389 10.3.0.50

I've tried to run this command

invoke-nmap -computerName '10.3.0.50' -ArgumentList '--script ssl-enum-ciphers -p 3389' -OutFormat PSObject

But I cannot get the output that I need into a psobject..... i would like to consume the ciphers on a machine.

PORT STATE SERVICE
3389/tcp open ms-wbt-server
ssl-enum-ciphers:
TLSv1.0:
ciphers:
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (ecdh_x25519) - A
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (ecdh_x25519) - A
TLS_DHE_RSA_WITH_AES_256_CBC_SHA (dh 2048) - A
TLS_DHE_RSA_WITH_AES_128_CBC_SHA (dh 2048) - A
TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
TLS_RSA_WITH_3DES_EDE_CBC_SHA (rsa 2048) - C
TLS_RSA_WITH_RC4_128_SHA (rsa 2048) - C
TLS_RSA_WITH_RC4_128_MD5 (rsa 2048) - C
compressors:
NULL
cipher preference: server
warnings:
64-bit block cipher 3DES vulnerable to SWEET32 attack
Broken cipher RC4 is deprecated by RFC 7465
Ciphersuite uses MD5 for message integrity
TLSv1.1:
ciphers:
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (ecdh_x25519) - A
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (ecdh_x25519) - A
TLS_DHE_RSA_WITH_AES_256_CBC_SHA (dh 2048) - A
TLS_DHE_RSA_WITH_AES_128_CBC_SHA (dh 2048) - A
TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
TLS_RSA_WITH_3DES_EDE_CBC_SHA (rsa 2048) - C
TLS_RSA_WITH_RC4_128_SHA (rsa 2048) - C
TLS_RSA_WITH_RC4_128_MD5 (rsa 2048) - C
compressors:
NULL
cipher preference: server
warnings:
64-bit block cipher 3DES vulnerable to SWEET32 attack
Broken cipher RC4 is deprecated by RFC 7465
Ciphersuite uses MD5 for message integrity
TLSv1.2:
ciphers:
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (ecdh_x25519) - A
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (ecdh_x25519) - A
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (dh 2048) - A
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (dh 2048) - A
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (ecdh_x25519) - A
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (ecdh_x25519) - A
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (ecdh_x25519) - A
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (ecdh_x25519) - A
TLS_DHE_RSA_WITH_AES_256_CBC_SHA (dh 2048) - A
TLS_DHE_RSA_WITH_AES_128_CBC_SHA (dh 2048) - A
TLS_RSA_WITH_AES_256_GCM_SHA384 (rsa 2048) - A
TLS_RSA_WITH_AES_128_GCM_SHA256 (rsa 2048) - A
TLS_RSA_WITH_AES_256_CBC_SHA256 (rsa 2048) - A
TLS_RSA_WITH_AES_128_CBC_SHA256 (rsa 2048) - A
TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
TLS_RSA_WITH_3DES_EDE_CBC_SHA (rsa 2048) - C
TLS_RSA_WITH_RC4_128_SHA (rsa 2048) - C
TLS_RSA_WITH_RC4_128_MD5 (rsa 2048) - C
compressors:
NULL
cipher preference: server
warnings:
64-bit block cipher 3DES vulnerable to SWEET32 attack
Broken cipher RC4 is deprecated by RFC 7465
Ciphersuite uses MD5 for message integrity
least strength: C

Unable to find type [JsonConvert] on some Windows 10 systems

Reported from reddit:

PS C:\WINDOWS\system32> invoke-nmap www.google.com
Unable to find type [JsonConvert].
At C:\Program Files\WindowsPowerShell\Modules\PoshNmap\0.4.1\Public\ConvertFrom-NmapXML.ps1:43 char:30
+             $convertedJson = [JsonConvert]::SerializeXmlNode($nmapRun ...
+                              ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (JsonConvert:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

FormatNmapXml : This is not a valid Hashtable output from Convert-NmapXML
At C:\Program Files\WindowsPowerShell\Modules\PoshNmap\0.4.1\Public\ConvertFrom-NmapXML.ps1:64 char:86
+ ... esult | ConvertFrom-Json | ConvertPSObjectToHashtable | FormatNmapXml
+                                                             ~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (This is not a v...Convert-NmapXML:String) [FormatNmapXml], RuntimeExc
   eption
    + FullyQualifiedErrorId : This is not a valid Hashtable output from Convert-NmapXML,FormatNmapXml

Installation Process broken or needs some documentation

PS C:\WINDOWS\system32> Install-Module -Name PoshNmap
PS C:\WINDOWS\system32> Invoke-Nmap
Invoke-Nmap : The term 'Invoke-Nmap' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1
+ Invoke-Nmap
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Invoke-Nmap:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> Get-Host | Select-Object Version

Version
-------
5.1.19041.1320

PS C:\WINDOWS\system32> Get-InstalledModule

Version              Name                                Repository           Description
-------              ----                                ----------           -----------
1.4.3                PackageManagement                   PSGallery            PackageManagement (a.k.a. One...
2.2                  PowerShellGet                       PSGallery            PowerShell module with comman...
1.0.6.19             SnippetPx                           PSGallery            The SnippetPx module enhances...
2.2                  Posh-SSH                            PSGallery            Provide SSH and SCP functiona...
0.6.1                PoshNmap                            PSGallery            A wrapper for NMAP Network Di...

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.