Package Halberd :: Module crew
[hide private]
[frames] | no frames]

Module crew

source code

Work crew pattern of parallel scanners

Overview

A work crew is instantiated passing a ScanTask object as a parameter, thus defining the target and the way the scanning should be done. After the initialization of the work crew it can be used to scan the target and get the obtained clues back.

>>> crew = WorkCrew(scantask)
>>> clues = crew.scan()

Requirements

These are the features that the WorkCrew must provide:

  1. There are 3 different types of consumers:
  2. We need a way to signal:

Types of scanning threads

The WorkCrew object spawns different kinds of threads. Here's a brief summary of what they do:

The following is a diagram showing the way it works:

                                    .--> Manager --.
                                    |              |
                                    +--> Scanner --+
       .----------.   .----------.  |              |   .-------.
IN --> | ScanTask |->-| WorkCrew |--+--> Scanner --+->-| Clues |--> OUT
       `----------'   `----------'  |              |   `-------'
                                    +--> Scanner --+
                                    |              |
                                    `--> Scanner --'
Classes [hide private]
  ScanState
Shared state among scanner threads.
  WorkCrew
Pool of scanners working in parallel.
  BaseScanner
Base class for load balancer scanning threads.
  Scanner
Scans the target host from the local machine.
  Manager
Performs management tasks during the scan.
Variables [hide private]
  __package__ = 'Halberd'