Code Monkey home page Code Monkey logo

aionmap's Introduction

aionmap

A python aysncio package for nmap.

install

just run python3 setup.py

usage

scan result

The scan result parsed by libnmap.parser.NmapParser, so python-libnmap is required. and the parsed-result is libnmap.objects.NmapReport.

PortScanner

A port scanner similar to python-nmap PortScanner. It is run in a process and wait until process exit with yield from or await. eg:

import aionmap
import asyncio

async def main():
    scanner =  aionmap.PortScanner()
    print(await scanner.nmap_version())
    result = await scanner.listscan('192.168.0.0/24', False)
    print(result)
    result = await scanner.scan('localhost', None, '-sS -sV -n', sudo=True, sudo_passwd='xxx')
    print(result)
    
if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

PortScannerYield

A port scanner similar to python-nmap PortScannerYield, but async for instead. It can only run with environment where Python version greater than 3.5. The scanner run with multi processes at the same time, default is 3 processes, you can control it by argument batch_count when call function PortScannerYield.scan. eg:

import asyncio

import aionmap


async def main():
    scanner =  aionmap.PortScannerYield()
    async for result in scanner.scan('192.168.0.0/24', '80,22', '-sS -n --open', sudo=True, sudo_passwd='xxx'):
        if isinstance(result, Exception):
            print("error")
        else:
            print(result)

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

aionmap's People

Contributors

ranyixu avatar tandf avatar jim42251 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.