Exemple #1
0
def do_managed_server():

    log = logging.get_obfslogger()
    """Start the managed-proxy protocol as a server."""

    should_start_event_loop = False

    ptserver = ServerTransportPlugin()
    try:
        ptserver.init([FTE_PT_NAME])
    except EnvError, err:
        log.warning("Server managed-proxy protocol failed (%s)." % err)
        return
Exemple #2
0
def do_managed_server():

    log = logging.get_obfslogger()

    """Start the managed-proxy protocol as a server."""

    should_start_event_loop = False

    ptserver = ServerTransportPlugin()
    try:
        ptserver.init([FTE_PT_NAME])
    except EnvError, err:
        log.warning("Server managed-proxy protocol failed (%s)." % err)
        return
Exemple #3
0
Provides code to morph a chunk of data to a given probability distribution.

The class provides an interface to morph a network packet's length to a
previously generated probability distribution.  The packet lengths of the
morphed network data should then match the probability distribution.
"""

import random

import message
import probdist
import const

import obfsproxy.common.log as logging

log = logging.get_obfslogger()


class PacketMorpher(object):

    """
    Implements methods to morph data to a target probability distribution.

    This class is used to modify ScrambleSuit's packet length distribution on
    the wire.  The class provides a method to determine the padding for packets
    smaller than the MTU.
    """

    def __init__(self, dist=None):
        """
        Initialise the packet morpher with the given distribution `dist'.
Exemple #4
0
import Queue
import socket
import struct
import requesocks
import threading
from time import sleep
from random import randint

# WFPadTools imports
import obfsproxy.common.log as logging
from obfsproxy.transports.wfpadtools import const
from obfsproxy.test.tester import TransportsSetUp
from obfsproxy.transports.wfpadtools.util import genutil as gu
from obfsproxy.transports.wfpadtools.util import fileutil as fu

log = logging.get_obfslogger()


class CommInterfaceAbstract(TransportsSetUp):
    """Implement methods for a class with a CommunicationInterface instance.

    The instance must be named `commInterf`.
    """
    ENTRY_PORT = None
    EXIT_PORT = None
    SHIM_PORTS = None

    def setup(self):
        """Sets dummy and obfsproxy endpoints for bidirectional comm."""
        os.chdir(const.BASE_DIR)
        self.shim_commInterf = CommunicationInterface()