Hackfut Security File Manager
Current Path:
/usr/lib/python2.6/site-packages/supervisor/medusa
usr
/
lib
/
python2.6
/
site-packages
/
supervisor
/
medusa
/
📁
..
📄
__init__.py
(128 B)
📄
__init__.pyc
(277 B)
📄
__init__.pyo
(277 B)
📄
auth_handler.py
(4.63 KB)
📄
auth_handler.pyc
(4.41 KB)
📄
auth_handler.pyo
(4.41 KB)
📄
chat_server.py
(4.43 KB)
📄
chat_server.pyc
(6.28 KB)
📄
chat_server.pyo
(6.28 KB)
📄
counter.py
(1.41 KB)
📄
counter.pyc
(1.99 KB)
📄
counter.pyo
(1.99 KB)
📄
default_handler.py
(6.18 KB)
📄
default_handler.pyc
(4.92 KB)
📄
default_handler.pyo
(4.92 KB)
📄
event_loop.py
(2.91 KB)
📄
event_loop.pyc
(3.43 KB)
📄
event_loop.pyo
(3.43 KB)
📄
filesys.py
(10.94 KB)
📄
filesys.pyc
(13.28 KB)
📄
filesys.pyo
(13.28 KB)
📄
ftp_server.py
(39.6 KB)
📄
ftp_server.pyc
(33.91 KB)
📄
ftp_server.pyo
(33.91 KB)
📄
http_date.py
(3.33 KB)
📄
http_date.pyc
(3.39 KB)
📄
http_date.pyo
(3.39 KB)
📄
http_server.py
(24.63 KB)
📄
http_server.pyc
(20.96 KB)
📄
http_server.pyo
(20.96 KB)
📄
logger.py
(7.81 KB)
📄
logger.pyc
(10.73 KB)
📄
logger.pyo
(10.73 KB)
📄
m_syslog.py
(7.18 KB)
📄
m_syslog.pyc
(3.91 KB)
📄
m_syslog.pyo
(3.91 KB)
📄
medusa_gif.py
(2.71 KB)
📄
medusa_gif.pyc
(1.13 KB)
📄
medusa_gif.pyo
(1.13 KB)
📄
monitor.py
(10.79 KB)
📄
monitor.pyc
(12 KB)
📄
monitor.pyo
(12 KB)
📄
monitor_client.py
(3.2 KB)
📄
monitor_client.pyc
(5.26 KB)
📄
monitor_client.pyo
(5.26 KB)
📄
monitor_client_win32.py
(1.3 KB)
📄
monitor_client_win32.pyc
(2.04 KB)
📄
monitor_client_win32.pyo
(2.04 KB)
📄
producers.py
(9.22 KB)
📄
producers.pyc
(11.36 KB)
📄
producers.pyo
(11.36 KB)
📄
put_handler.py
(3.25 KB)
📄
put_handler.pyc
(3.43 KB)
📄
put_handler.pyo
(3.43 KB)
📄
redirecting_handler.py
(1.37 KB)
📄
redirecting_handler.pyc
(2.11 KB)
📄
redirecting_handler.pyo
(2.11 KB)
📄
resolver.py
(15.19 KB)
📄
resolver.pyc
(12.11 KB)
📄
resolver.pyo
(12.11 KB)
📄
rpc_client.py
(9.45 KB)
📄
rpc_client.pyc
(10.1 KB)
📄
rpc_client.pyo
(10.1 KB)
📄
rpc_server.py
(9.72 KB)
📄
rpc_server.pyc
(9.31 KB)
📄
rpc_server.pyo
(9.31 KB)
📄
script_handler.py
(6.4 KB)
📄
script_handler.pyc
(6.5 KB)
📄
script_handler.pyo
(6.5 KB)
📄
setup.py
(496 B)
📄
setup.pyc
(729 B)
📄
setup.pyo
(729 B)
📄
status_handler.py
(9.13 KB)
📄
status_handler.pyc
(9.45 KB)
📄
status_handler.pyo
(9.45 KB)
📄
unix_user_handler.py
(2.26 KB)
📄
unix_user_handler.pyc
(2.31 KB)
📄
unix_user_handler.pyo
(2.31 KB)
📄
virtual_handler.py
(1.68 KB)
📄
virtual_handler.pyc
(3.09 KB)
📄
virtual_handler.pyo
(3.09 KB)
📄
xmlrpc_handler.py
(2.88 KB)
📄
xmlrpc_handler.pyc
(3.7 KB)
📄
xmlrpc_handler.pyo
(3.7 KB)
Editing: chat_server.py
# -*- Mode: Python -*- # # Author: Sam Rushing <rushing@nightmare.com> # Copyright 1997-2000 by Sam Rushing # All Rights Reserved. # RCS_ID = '$Id: chat_server.py,v 1.1.1.1 2006/06/26 06:36:05 chrism Exp $' import string VERSION = string.split(RCS_ID)[2] import socket import asyncore import asynchat import status_handler class chat_channel (asynchat.async_chat): def __init__ (self, server, sock, addr): asynchat.async_chat.__init__ (self, sock) self.server = server self.addr = addr self.set_terminator ('\r\n') self.data = '' self.nick = None self.push ('nickname?: ') def collect_incoming_data (self, data): self.data = self.data + data def found_terminator (self): line = self.data self.data = '' if self.nick is None: self.nick = string.split (line)[0] if not self.nick: self.nick = None self.push ('huh? gimmee a nickname: ') else: self.greet() else: if not line: pass elif line[0] != '/': self.server.push_line (self, line) else: self.handle_command (line) def greet (self): self.push ('Hello, %s\r\n' % self.nick) num_channels = len(self.server.channels)-1 if num_channels == 0: self.push ('[Kinda lonely in here... you\'re the only caller!]\r\n') else: self.push ('[There are %d other callers]\r\n' % (len(self.server.channels)-1)) nicks = map (lambda x: x.get_nick(), self.server.channels.keys()) self.push (string.join (nicks, '\r\n ') + '\r\n') self.server.push_line (self, '[joined]') def handle_command (self, command): import types command_line = string.split(command) name = 'cmd_%s' % command_line[0][1:] if hasattr (self, name): # make sure it's a method... method = getattr (self, name) if type(method) == type(self.handle_command): method (command_line[1:]) else: self.push ('unknown command: %s' % command_line[0]) def cmd_quit (self, args): self.server.push_line (self, '[left]') self.push ('Goodbye!\r\n') self.close_when_done() # alias for '/quit' - '/q' cmd_q = cmd_quit def push_line (self, nick, line): self.push ('%s: %s\r\n' % (nick, line)) def handle_close (self): self.close() def close (self): del self.server.channels[self] asynchat.async_chat.close (self) def get_nick (self): if self.nick is not None: return self.nick else: return 'Unknown' class chat_server (asyncore.dispatcher): SERVER_IDENT = 'Chat Server (V%s)' % VERSION channel_class = chat_channel spy = 1 def __init__ (self, ip='', port=8518): asyncore.dispatcher.__init__(self) self.port = port self.create_socket (socket.AF_INET, socket.SOCK_STREAM) self.bind ((ip, port)) print '%s started on port %d' % (self.SERVER_IDENT, port) self.listen (5) self.channels = {} self.count = 0 def handle_accept (self): conn, addr = self.accept() self.count = self.count + 1 print 'client #%d - %s:%d' % (self.count, addr[0], addr[1]) self.channels[self.channel_class (self, conn, addr)] = 1 def push_line (self, from_channel, line): nick = from_channel.get_nick() if self.spy: print '%s: %s' % (nick, line) for c in self.channels.keys(): if c is not from_channel: c.push ('%s: %s\r\n' % (nick, line)) def status (self): lines = [ '<h2>%s</h2>' % self.SERVER_IDENT, '<br>Listening on Port: %d' % self.port, '<br><b>Total Sessions:</b> %d' % self.count, '<br><b>Current Sessions:</b> %d' % (len(self.channels)) ] return status_handler.lines_producer (lines) def writable (self): return 0 if __name__ == '__main__': import sys if len(sys.argv) > 1: port = string.atoi (sys.argv[1]) else: port = 8518 s = chat_server ('', port) asyncore.loop()
Upload File
Create Folder