OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
twisted
/
protocols
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/31/2022 06:22:38 AM
rwxr-xr-x
📄
__init__.py
572 bytes
09/23/2017 05:52:21 AM
rw-r--r--
📁
__pycache__
-
03/31/2022 06:22:39 AM
rwxr-xr-x
📄
amp.py
95.83 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
basic.py
31.26 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
dict.py
10.52 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
finger.py
1.19 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
ftp.py
103.64 KB
09/08/2017 10:38:36 AM
rw-r--r--
📁
haproxy
-
03/31/2022 06:22:38 AM
rwxr-xr-x
📄
htb.py
9.11 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
ident.py
7.6 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
loopback.py
11.65 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
memcache.py
23.14 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
pcp.py
6.92 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
policies.py
20.72 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
portforward.py
2.33 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
postfix.py
3.65 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
sip.py
36.91 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
socks.py
7.63 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
stateful.py
1.6 KB
09/08/2017 10:38:36 AM
rw-r--r--
📁
test
-
03/31/2022 06:22:38 AM
rwxr-xr-x
📄
tls.py
31.73 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
wire.py
2.5 KB
09/08/2017 10:38:36 AM
rw-r--r--
Editing: wire.py
Close
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """Implement standard (and unused) TCP protocols. These protocols are either provided by inetd, or are not provided at all. """ from __future__ import absolute_import, division import time import struct from zope.interface import implementer from twisted.internet import protocol, interfaces class Echo(protocol.Protocol): """ As soon as any data is received, write it back (RFC 862). """ def dataReceived(self, data): self.transport.write(data) class Discard(protocol.Protocol): """ Discard any received data (RFC 863). """ def dataReceived(self, data): # I'm ignoring you, nyah-nyah pass @implementer(interfaces.IProducer) class Chargen(protocol.Protocol): """ Generate repeating noise (RFC 864). """ noise = b'@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&?' def connectionMade(self): self.transport.registerProducer(self, 0) def resumeProducing(self): self.transport.write(self.noise) def pauseProducing(self): pass def stopProducing(self): pass class QOTD(protocol.Protocol): """ Return a quote of the day (RFC 865). """ def connectionMade(self): self.transport.write(self.getQuote()) self.transport.loseConnection() def getQuote(self): """ Return a quote. May be overrriden in subclasses. """ return b"An apple a day keeps the doctor away.\r\n" class Who(protocol.Protocol): """ Return list of active users (RFC 866) """ def connectionMade(self): self.transport.write(self.getUsers()) self.transport.loseConnection() def getUsers(self): """ Return active users. Override in subclasses. """ return b"root\r\n" class Daytime(protocol.Protocol): """ Send back the daytime in ASCII form (RFC 867). """ def connectionMade(self): self.transport.write(time.asctime(time.gmtime(time.time())) + b'\r\n') self.transport.loseConnection() class Time(protocol.Protocol): """ Send back the time in machine readable form (RFC 868). """ def connectionMade(self): # is this correct only for 32-bit machines? result = struct.pack("!i", int(time.time())) self.transport.write(result) self.transport.loseConnection() __all__ = ["Echo", "Discard", "Chargen", "QOTD", "Who", "Daytime", "Time"]