Giter Site home page Giter Site logo

blacklanternsecurity / nmappalyzer Goto Github PK

View Code? Open in Web Editor NEW
12.0 5.0 2.0 34 KB

A lightweight Python 3 Nmap wrapper that doesn't try too hard. Gracefully handles any Nmap command, providing access to all output types (normal, greppable, xml), plus JSON!

License: GNU General Public License v3.0

Python 100.00%
scanner scanning python nmap wrapper wrapper-library library portscanner portscan

nmappalyzer's Introduction

nmappalyzer

License Python Version Build Status

A lightweight Python 3 Nmap wrapper that doesn't try too hard. Gracefully handles any Nmap command, providing access to all output types (normal, greppable, xml), plus JSON!

Installation

NOTE: Nmap must be installed.

$ pip install nmappalyzer

Usage

  1. Start the scan and wait for it to finish
from nmappalyzer import NmapScan

#                target            Nmap args (optional)
scan = NmapScan('scanme.nmap.org', ['-Pn', '-F', '-T4' '-sV', '--script=banner'])
  1. Access information about the scan
scan.command
"/usr/bin/nmap -oA /tmp/rhw2r_q9 -Pn -F -T4 -sV --script=banner scanme.nmap.org"

# Terminal output
scan.stdout
# Terminal errors
scan.stderr

# Normal output
scan.results.output_nmap
# Greppable output
scan.results.output_gnmap
# XML output
scan.results.output_xml
# Parsed XML (lxml etree):
scan.results.etree
# Python dictionary (converted from xml)
scan.results.json
  1. Access information about the hosts
for host in scan:
    host.status
    host.address
    host.scripts
    host.hostnames
    host.open_ports
    host.closed_ports
    host.filtered_ports

    # Parsed XML (lxml etree)
    host.etree

    # Python dictionary (converted from xml)
    host.json

nmappalyzer's People

Contributors

thetechromancer avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  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.