Skip to content

Instantly share code, notes, and snippets.

@DazWorrall
Created February 21, 2013 11:24
Show Gist options
  • Select an option

  • Save DazWorrall/5004071 to your computer and use it in GitHub Desktop.

Select an option

Save DazWorrall/5004071 to your computer and use it in GitHub Desktop.
Script to reproduce failed login bug in pyftpdlib 1.0 using the multiprocess ftp server
Connected to 172.16.137.140.
220 pyftpdlib 1.0.0 ready.
Name (172.16.137.140:daz): bad
331 Username ok, send password.
Password:
421 Service not available, remote server timed out. Connection closed.
ftp: Login failed
ftp>
[I 13-02-21 03:18:01] >>> starting FTP server on 0.0.0.0:2121 <<<
[I 13-02-21 03:18:01] poller: <class 'pyftpdlib.ioloop.Epoll'>
[I 13-02-21 03:18:01] masquerade (NAT) address: None
[I 13-02-21 03:18:01] passive ports: None
[I 13-02-21 03:18:01] use sendfile(2): False
[I 13-02-21 03:18:01] dispatcher: <class pyftpdlib.servers.MultiprocessFTPServer at 0x2a65598>
[I 13-02-21 03:18:03] 172.16.137.1:62979-[] FTP session opened (connect)
# Note the long gap here
[I 13-02-21 03:23:03] 172.16.137.1:62979-[] Control connection timed out.
[I 13-02-21 03:23:03] 172.16.137.1:62979-[] FTP session closed (disconnect).
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import MultiprocessFTPServer
a = DummyAuthorizer()
a.add_user('test', 'test', '/tmp')
handler = FTPHandler
handler.authorizer = a
server = MultiprocessFTPServer(("0.0.0.0", 2121), handler)
server.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment