Table of contents Index
class PlugProxy - Wrapper for the builtin Plug proxy implemented in Zorp.
Declared in module Plug
Inheritance hierarchy:
Plug.PlugProxy
Proxy.Proxy
Synopsis
class PlugProxy(Proxy):
def Plug.PlugProxy.__init__(self, session) # Initialize a PlugProxy instance.
def Plug.PlugProxy.requestStack(self) # Query if something is to be stacked into this plug.
def Plug.PlugProxy.stackProxy(self, client_fd, server_fd) # Stack a proxy instance within this plug.
# Inherited from Zorp.ZorpProxy
def Zorp.ZorpProxy.__init__(self, name, session_id, client_stream) # Initialize a low level proxy instance.
# Inherited from Proxy.Proxy
def Proxy.Proxy.__init__(self, name, session) # Initializes a Proxy instance.
def Proxy.Proxy.addPolicy(self, klass) # Adds a policy to the proxy.
def Proxy.Proxy.connectServer(self, host, port) # Callback method called when a connection established
None stack_proxy = None
Description
Implements a general plug proxy, with optionally disabling
data transfer in either direction.
By default plug copies all data in both directions. To change
this set the copy_to_client or copy_to_server attributes
to FALSE.
Note: Copying out of band data is not supported.
Attributes:
-
copy_to_server
- Copy data in client->server direction
-
copy_to_client
- Copy data in server->client direction
-
bandwidth_to_client
- Readonly variable containing the utilized
bandwidth in server->client direction.
-
bandwidth_to_server
- Readonly variable containing the utilized
bandwidth in client->server direction.
-
packet_stats_interval
- The number of milliseconds between
two successive packetStats() events.
By default: 0.
NOTE: this is currently implemented as the
number of passing packages, not as
milliseconds.
-
stack_proxy
- the proxy class to stack into the connection
Notes:
packetStats() event is called whenever the time interval
elapses (or as currently implemented the given number of
packets were transmitted). this event receives packet
statistics as parameters. It's useful for terminating connections with excessive
bandwidth requirements (for instance to limit the impact of
the covert channel opened when using plug instead of a
protocol specific proxy) packetStats is defined as: def packetStats(self, client_bytes, client_pkts, server_bytes, server_pkts)
Plug.PlugProxy.__init__(self, session)
Initialize a PlugProxy instance.
- self
- this instance
- session
- session this instance belongs to
Create and set up a PlugProxy instance.
Plug.PlugProxy.requestStack(self)
Query if something is to be stacked into this plug.
- self
- this instance
Callback called by the underlying C proxy to query if
something is to be stacked.
Returns:
the class of the proxy to stack in
Stack a proxy instance within this plug.
- self
- this instance
- client_fd
- client fd
- server_fd
- server fd
Callback called by the underlying C proxy to actually
stack in something.
Copyright © 2000 BalaBit IT Ltd.
Written by: Balázs Scheidler