Exemplo n.º 1
0
    def dataReceived(self, data):
        if not self.otherConn:
            return SOCKSv4.dataReceived(self, data)

        if hijack == 's':
            data = editdata(data)

        csinfo = '%s:%s --> %s:%s' % getCSInfo(self)
        csinfo += ' len: %s' % len(data)
        print colored(csinfo, 'red')
        print colored(hexdump(data), 'green')
        logdata('%s\n%s' % (csinfo, hexdump(data)))

        return SOCKSv4.dataReceived(self, data)
Exemplo n.º 2
0
    def write(self, data):
        if not self.otherConn:
            return SOCKSv4.write(self, data)

        if hijack == 'r':
            data = editdata(data)

        csinfo = '%s:%s <-- %s:%s' % getCSInfo(self)
        csinfo += ' len: %s' % len(data)
        print colored(csinfo, 'red')
        print colored(hexdump(data), 'yellow')
        logdata('%s\n%s' % (csinfo, hexdump(data)))

        return SOCKSv4.write(self, data)
Exemplo n.º 3
0
 def __init__(self, factory, reactor=reactor):
     SOCKSv4.__init__(self, factory.logging, reactor)
     self.bufsize = self.DEFAULT_BUFSIZE
     self.factory = factory
Exemplo n.º 4
0
 def __init__(self, interface, whitelist):
     SOCKSv4.__init__(self, None, reactor)
     self.interface = interface
     self.whitelist = whitelist
Exemplo n.º 5
0
 def connectionMade(self):
     if self._allow():
         SOCKSv4.connectionMade(self)
     else:
         self.transport.loseConnection()
Exemplo n.º 6
0
 def __init__(self, interface, whitelist):
     SOCKSv4.__init__(self, None, reactor)
     self.interface = interface
     self.whitelist = whitelist
Exemplo n.º 7
0
 def connectionMade(self):
     if self._allow():
         SOCKSv4.connectionMade(self)
     else:
         self.transport.loseConnection()