Netcrawl Usage

Recursive Scan

netcrawl.core.recursive_scan(**kwargs)[source]

Starts a Recursive Scan (-sR) run. This is the main scanning method for netcrawl.

1. If a target kwarg is given, add that seed device to the list of pending deivces, even if it was already visited.

2. Create workers (subprocesses) to perform the scanning work, up to 16 per CPU core, or up to the processes kwarg per core if that kwarg was given.

3. Query the Pending table in the Main database for pending devices.

4. Autodetect the Netmiko platform for each device if needed.

5. Inventory the device using netcrawl.devices.base.NetworkDevice.process_device()

  1. Add each discovered device to the Inventory database
Keyword Arguments:
 
  • skip_named_duplicates (bool) –

    If True, this will cause netcrawl to skip neighbors which have the same hostname as a device that was previously visited.

    Note

    While this can potentially save a lot of time when scanning devices, if multiple different devices share the same hostname, they will not be scanned!

  • target (str) – The IP address of a seed device to add to the pending devices database
  • netmiko_platform (str) – The Netmiko platform of the target device, if one was given.
  • processes (int) – The number of worker processes to create, multiplied by the CPU count

Note

If there are any remaining keyword arguments in **kwargs, they will be passed to netcrawl.io_sql.main_db and netcrawl.io_sql.device_db

Single Scan

netcrawl.core.single_scan(target, netmiko_platform='unknown')[source]

Starts a Single Scan (-sS) run. This scan polls a single device and presents information about the device to the console. Useful for testing a connection, as well as getting a quick overview of the target.

Keyword Arguments:
 
  • target (str) – The network address of the device to scan
  • netmiko_platform (str) – The Netmiko platform of the target device. If one is not given, it will attempt to autodetect the device type.

Nmap Scan

netcrawl.core.nmap_scan(target, **kwargs)[source]

Ping each host in a given range one at a time. When a live host is found, add it to the pending hosts database.

Parameters:target (str) – An Nmap compatible target specifier as outlined in the Nmap documentation
Keyword Arguments:
 **kwargs – Arguments to pass to netcrawl.io_sql.main_db