Halberd.clues.Clue.Clue

Halberd :: clues :: Clue :: Clue :: Class Clue |
[hide private]
[frames] | no frames]

# Class Clue

source code

A clue is what we use to tell real servers behind a virtual IP.

Clues are gathered during several connections to a web server and they allow us to try to identify patterns in its responses. Those patterns could allow us to find out which real servers are behind a VIP

Instance Methods | [hide private]
__init__(self) | source code
parse(self, headers) Extracts all relevant information from the MIME headers replied by the target. | source code
_updateDigest(self) Updates header fingerprint. | source code
`int` |
_calcDiff(self) Compute the time difference between the remote and local clocks. | source code
incCount(self, num=1) Increase the times this clue has been found. | source code
`int`. |
getCount(self) Retrieve the number of times the clue has been found | source code
setTimestamp(self, timestamp) Sets the local clock attribute. | source code
__eq__(self, other) | source code
__ne__(self, other) | source code
__repr__(self) | source code
_get_server(self, field) Server: | source code
_get_date(self, field) Date: | source code
_get_content_location(self, field) Content-location: | source code
_get_set_cookie(self, field) Set-cookie: | source code
_get_expires(self, field) Expires: | source code
_get_age(self, field) Age: | source code
_get_content_length(self, field) Content-length: | source code
_get_last_modified(self, field) Last-modified: | source code
_get_etag(self, field) ETag: | source code
_get_cache_expires(self, field) Cache-expires: | source code
_get_content_type(self, field) Content-type: | source code

Static Methods | [hide private]
`str` |
normalize(name) Normalize string. | source code

Method Details | [hide private]

### parse(self, headers) | source code
Extracts all relevant information from the MIME headers replied by the target. Parameters: `headers` (`str`, `list` or `tuple`) - A set of MIME headers (a string as replied by the webserver or a previously parsed sequence of name, value tuples). Raises: `TypeError` - If headers is neither a string nor a sequence.

### normalize(name) Static Method | source code
Normalize string. This method takes a string coming out of mime-fields and transforms it into a valid Python identifier. That's done by removing invalid non-alphanumeric characters and also numeric ones placed at the beginning of the string. Parameters: `name` (`str`) - String to be normalized. Returns: `str` Normalized string.

### _calcDiff(self) | source code
Compute the time difference between the remote and local clocks. Returns: `int` Time difference.

### incCount(self, num=1) | source code
Increase the times this clue has been found. Parameters: `num` (`int`) - A positive non-zero number of hits to increase. Raises: `ValueError` - in case `num` is less than or equal to zero.

### getCount(self) | source code
Retrieve the number of times the clue has been found Returns: `int`. Number of hits.

### setTimestamp(self, timestamp) | source code
Sets the local clock attribute. Parameters: `timestamp` (`int`) - The local time (expressed in seconds since the Epoch) when the connection to the target was successfully completed.