mirror of
https://github.com/cowrie/cowrie.git
synced 2025-07-01 18:07:27 -04:00
git-svn-id: https://kippo.googlecode.com/svn/trunk@44 951d7100-d841-11de-b865-b3884708a8e2
31 lines
994 B
Python
31 lines
994 B
Python
# Copyright (c) 2009 Upi Tamminen <desaster@gmail.com>
|
|
# See the COPYRIGHT file for more information
|
|
|
|
import os, sys
|
|
sys.path.insert(0, os.path.abspath(os.getcwd()))
|
|
|
|
from twisted.application import internet, service
|
|
from twisted.cred import portal
|
|
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()
|
|
# Move this somewhere if we decide to use more passwords
|
|
users = (
|
|
('root', 'root'),
|
|
('root', '123456'),
|
|
)
|
|
factory.portal.registerChecker(honeypot.HoneypotPasswordChecker(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:
|