diff --git a/kippo.py b/kippo.py deleted file mode 100755 index 68a4ace5..00000000 --- a/kippo.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python - -from twisted.cred import portal, checkers -from twisted.conch.ssh import factory, keys -from twisted.internet import reactor -from twisted.python import log -from core import honeypot -import config - -if __name__ == "__main__": - log.startLogging(file('%s/kippo.log' % config.log_path, 'a')) - - sshFactory = honeypot.HoneyPotSSHFactory() - sshFactory.portal = portal.Portal(honeypot.HoneyPotRealm()) - - users = {'root': 'root'} - sshFactory.portal.registerChecker( - checkers.InMemoryUsernamePasswordDatabaseDontUse(**users)) - - pubKeyString, privKeyString = honeypot.getRSAKeys() - sshFactory.publicKeys = { - 'ssh-rsa': keys.Key.fromString(data=pubKeyString)} - sshFactory.privateKeys = { - 'ssh-rsa': keys.Key.fromString(data=privKeyString)} - - reactor.listenTCP(config.ssh_port, sshFactory) - reactor.run() - -# vim: set sw=4 et: diff --git a/kippo.tac b/kippo.tac new file mode 100644 index 00000000..72bf0a10 --- /dev/null +++ b/kippo.tac @@ -0,0 +1,21 @@ +from twisted.application import internet, service +from twisted.cred import portal, checkers +from twisted.conch.ssh import factory, keys +from core import honeypot +import config + +factory = honeypot.HoneyPotSSHFactory() +factory.portal = portal.Portal(honeypot.HoneyPotRealm()) + +pubKeyString, privKeyString = honeypot.getRSAKeys() +users = {'root': 'root'} +factory.portal.registerChecker( + checkers.InMemoryUsernamePasswordDatabaseDontUse(**users)) +factory.publicKeys = {'ssh-rsa': keys.Key.fromString(data=pubKeyString)} +factory.privateKeys = {'ssh-rsa': keys.Key.fromString(data=privKeyString)} + +application = service.Application('honeypot') +service = internet.TCPServer(config.ssh_port, factory) +service.setServiceParent(application) + +# vim: set ft=python sw=4 et: diff --git a/start.sh b/start.sh new file mode 100755 index 00000000..c6a1ff1b --- /dev/null +++ b/start.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +echo -n "Starting kippo..." + +if [ "$1" == "-f" ] +then + FOREGROUND=" -n" +else + echo -n " (background)" +fi +echo + +twistd -y kippo.tac -l log/kippo.log$FOREGROUND