mirror of
https://github.com/aljazceru/cowrie.git
synced 2025-12-17 22:14:19 +01:00
pass config file as parameter everywhere
This commit is contained in:
@@ -9,7 +9,7 @@ from twisted.application.service import IServiceMaker
|
||||
from twisted.application import internet, service
|
||||
from twisted.cred import portal
|
||||
|
||||
from cowrie.core.config import config
|
||||
from cowrie.core.config import readConfigFile
|
||||
from cowrie import core
|
||||
import cowrie.core.ssh
|
||||
|
||||
@@ -34,7 +34,7 @@ class CowrieServiceMaker(object):
|
||||
print 'ERROR: You must not run cowrie as root!'
|
||||
sys.exit(1)
|
||||
|
||||
cfg = readCfgFile(options["config"]))
|
||||
cfg = readConfigFile(options["config"])
|
||||
|
||||
if cfg.has_option('honeypot', 'listen_addr'):
|
||||
listen_addr = cfg.get('honeypot', 'listen_addr')
|
||||
@@ -49,10 +49,10 @@ class CowrieServiceMaker(object):
|
||||
else:
|
||||
listen_port = 2222
|
||||
|
||||
factory = core.ssh.HoneyPotSSHFactory(cfg))
|
||||
factory.portal = portal.Portal(core.ssh.HoneyPotRealm())
|
||||
factory.portal.registerChecker(core.auth.HoneypotPublicKeyChecker())
|
||||
factory.portal.registerChecker(core.auth.HoneypotPasswordChecker())
|
||||
factory = core.ssh.HoneyPotSSHFactory(cfg)
|
||||
factory.portal = portal.Portal(core.ssh.HoneyPotRealm(cfg))
|
||||
factory.portal.registerChecker(core.auth.HoneypotPublicKeyChecker(cfg))
|
||||
factory.portal.registerChecker(core.auth.HoneypotPasswordChecker(cfg))
|
||||
|
||||
top_service = top_service = service.MultiService()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user