Skip to main content

Nmap wrapper for python with complete Nmap DTD support

Project description

Nmap scan

Nmap wrapper for python with full Nmap DTD support, parallel scans and threaded callback methods support for faster analytics.

Copyright (c) 2020 Fabian Fröhlich mail@nmap-scan.de https://nmap-scan.de

Full License Information see LICENSE file in root directory of this source code and License section of this File.

Donate

This project needs donations. Please check out https://nmap-scan.de/Donate for details.

Quick setup

See our documentation for details.

Required

  • install python 3.7 (other versions may also work)
  • install python3-pip
  • install Nmap
  • pip3 install nmap-scan

Basic usage

Simple script to scan a network with parallel TCP and UDP scan and save the report into a file. Note that the callback_method is called asynchronous in the scanning thread of each scan method. If you don't need a callback on report finishing just remove the function call argument.

from nmap_scan.NmapArgs import NmapArgs
from nmap_scan.NmapScanMethods import NmapScanMethods
from nmap_scan.Scanner import Scanner

args = NmapArgs(['192.168.0.1/24'])
scanner = Scanner(args)

def callback_method(report, scan_method):
    filename = {
        NmapScanMethods.TCP: 'tcp',
        NmapScanMethods.UDP: 'udp',
    }

    report.save('reports/scan-' + filename.get(scan_method) + '.xml')


scanner.scan_udp_background(callback_method)
scanner.scan_tcp_background(callback_method)

scanner.wait_all()

License

This section contains the additional terms of the AGPLv3 license agreement, a copy of the AGPLv3 is included in the LICENSE file.

  1. Security analytic / "White had" use only.

  2. You are only allowed to use this tool, if you don't act against a law of your Country and if you don't planning a cyber attack on the scanned servers.

  3. You are only allowed to scan your own Servers and those, where you have the permission to do so.

  4. Adaptation of the README.md is prohibited. The file must also be included with each copy without any modification.

  5. Adjustments of any kind must be listed in the attached CHANGELOG.md file. It is sufficient to name the change and the reason for the change here and to give appropriate references to the processing in the source code at the appropriate place.

  6. All edited copies must be made available on github. You have to fork the original repository or use a fork from the original repository.

  7. You have to place the following link on your Homepage in a suitable place, if you using this software in a commercial way:

    We using server scan tools from <a href="https://nmap-scan.de">Fabian Fr&ouml;hlich</a>
    

    The wording is decisive here, so another language may be used. Attributes of the link may also be adjusted, but the link must be followable by web crawlers (e.g. Googlebot).

    Furthermore, the imprint has to include a clear reference to the original github repository https://github.com/f-froehlich/nmap-scan as well as the link mentioned above in the body text.

  8. You are not allowed to earn money with this tool.

Contributors

Name email info
Fabian Fröhlich mail@nmap-scan.de Main contributor and code owner

Changelog

1.0.0

  • Complete implementation of the nmap DTD
  • Parallel executed scans with threaded callbacks
  • Parallel analysed scan reports for performance boost
  • Some useful helper methods for Hosts, Ports, Services, ...
  • CLI callable with argparse
  • OS, Host, Service, Sequence, Trace and Stats support
  • specific script handling (Default script for other)
    • SSLEnumCiphers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

nmap_scan-1.0.0-py3-none-any.whl (106.6 kB view details)

Uploaded Python 3

File details

Details for the file nmap_scan-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: nmap_scan-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 106.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for nmap_scan-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1a21ce6ee2d2dbf4cef1e362cf7bb74856713245bccb0e09f786ecee8b25808
MD5 2d318ce1c6328e26c26727e2574f7e08
BLAKE2b-256 8a1ee5e04d5fa840aee432e21bf3e79e1cc1897d1e7b8a7f2f7bfd6adb3d310e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page