platypush.plugins.nmap

class platypush.plugins.nmap.NmapPlugin(**kwargs)[source]

Nmap network scanner/mapper integration.

__init__(**kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

scan(hosts: str, ports: str, args: str, sudo: bool = False) → Dict[str, Any][source]

Perform a port scan towards a certain host or network.

Parameters:
  • hosts – Host name/IP or IP subnet to scan (e.g. 192.168.1.0/24).
  • ports – Port number, (comma-separated) list or (dash-separated) range to scan (default: all).
  • args – Additional command line arguments for nmap.
  • sudo – Execute nmap as root through sudo (default: False).
Returns:

Scan results, as an ip -> host map.