2009-11-10 18:57:59 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
from twisted.cred import portal, checkers
|
|
|
|
from twisted.conch.ssh import factory, keys
|
|
|
|
from twisted.internet import reactor
|
2009-11-10 19:36:03 +00:00
|
|
|
from twisted.python import log
|
2009-11-10 18:57:59 +00:00
|
|
|
from core import Kippo
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2009-11-10 19:39:29 +00:00
|
|
|
log.startLogging(file('./log/kippo.log', 'a'))
|
2009-11-10 19:36:03 +00:00
|
|
|
|
2009-11-10 18:57:59 +00:00
|
|
|
sshFactory = factory.SSHFactory()
|
|
|
|
sshFactory.portal = portal.Portal(Kippo.HoneyPotRealm())
|
|
|
|
|
|
|
|
users = {'root': 'root'}
|
|
|
|
sshFactory.portal.registerChecker(
|
|
|
|
checkers.InMemoryUsernamePasswordDatabaseDontUse(**users))
|
|
|
|
|
|
|
|
pubKeyString, privKeyString = Kippo.getRSAKeys()
|
|
|
|
sshFactory.publicKeys = {
|
|
|
|
'ssh-rsa': keys.Key.fromString(data=pubKeyString)}
|
|
|
|
sshFactory.privateKeys = {
|
|
|
|
'ssh-rsa': keys.Key.fromString(data=privKeyString)}
|
|
|
|
|
|
|
|
reactor.listenTCP(2222, sshFactory)
|
|
|
|
reactor.run()
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|