diff --git a/cowrie/core/auth.py b/cowrie/core/auth.py index 05b4798..6fe2dd4 100644 --- a/cowrie/core/auth.py +++ b/cowrie/core/auth.py @@ -1,12 +1,14 @@ # Copyright (c) 2009-2014 Upi Tamminen # See the COPYRIGHT file for more information +""" +This module contains ... +""" + import json from os import path from random import randint -from zope.interface import implements - from twisted.python import log # by Walter de Jong diff --git a/cowrie/core/checkers.py b/cowrie/core/checkers.py index f002a55..b4f8c99 100644 --- a/cowrie/core/checkers.py +++ b/cowrie/core/checkers.py @@ -1,6 +1,10 @@ # Copyright (c) 2009-2014 Upi Tamminen # See the COPYRIGHT file for more information +""" +This module contains ... +""" + from sys import modules from zope.interface import implements @@ -13,14 +17,14 @@ from twisted.python import log, failure from twisted.conch import error from twisted.conch.ssh import keys -from . import credentials -from . import auth +from cowrie.core import credentials +from cowrie.core import auth class HoneypotPublicKeyChecker: - implements(ICredentialsChecker) """ Checker that accepts, logs and denies public key authentication attempts """ + implements(ICredentialsChecker) credentialInterfaces = (ISSHPrivateKey,) @@ -36,10 +40,10 @@ class HoneypotPublicKeyChecker: return failure.Failure(error.ConchError('Incorrect signature')) class HoneypotNoneChecker: - implements(ICredentialsChecker) """ Checker that does no authentication check """ + implements(ICredentialsChecker) credentialInterfaces = (credentials.IUsername,) @@ -50,10 +54,10 @@ class HoneypotNoneChecker: return defer.succeed(credentials.username) class HoneypotPasswordChecker: - implements(ICredentialsChecker) """ Checker that accepts "keyboard-interactive" and "password" """ + implements(ICredentialsChecker) credentialInterfaces = (credentials.IUsernamePasswordIP, credentials.IPluggableAuthenticationModulesIP) diff --git a/cowrie/core/config.py b/cowrie/core/config.py index 8ee8365..8709476 100644 --- a/cowrie/core/config.py +++ b/cowrie/core/config.py @@ -1,6 +1,10 @@ # Copyright (c) 2009-2014 Upi Tamminen # See the COPYRIGHT file for more information +""" +This module contains ... +""" + import ConfigParser def readConfigFile(cfgfile): diff --git a/cowrie/core/connection.py b/cowrie/core/connection.py index acee9f3..4a7f507 100644 --- a/cowrie/core/connection.py +++ b/cowrie/core/connection.py @@ -26,6 +26,10 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. +""" +This module contains ... +""" + import struct from twisted.conch.ssh import connection, common diff --git a/cowrie/core/credentials.py b/cowrie/core/credentials.py index f743b54..0129ddb 100644 --- a/cowrie/core/credentials.py +++ b/cowrie/core/credentials.py @@ -26,6 +26,10 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. +""" +This module contains ... +""" + from zope.interface import implements from twisted.cred.credentials import IUsernamePassword, \ diff --git a/cowrie/core/dblog.py b/cowrie/core/dblog.py index c221faf..ebe22e3 100644 --- a/cowrie/core/dblog.py +++ b/cowrie/core/dblog.py @@ -1,6 +1,10 @@ # Copyright (c) 2009-2014 Upi Tamminen # See the COPYRIGHT file for more information +""" +This module contains ... +""" + import re import time import abc diff --git a/cowrie/core/exceptions.py b/cowrie/core/exceptions.py index e5697ae..5d6e150 100644 --- a/cowrie/core/exceptions.py +++ b/cowrie/core/exceptions.py @@ -1,6 +1,10 @@ # Copyright (c) 2009-2014 Upi Tamminen # See the COPYRIGHT file for more information +""" +This module contains ... +""" + class NotEnabledException(Exception): """ Feature not enabled """ diff --git a/cowrie/core/fs.py b/cowrie/core/fs.py index 8e3f62d..614d218 100644 --- a/cowrie/core/fs.py +++ b/cowrie/core/fs.py @@ -1,6 +1,10 @@ # Copyright (c) 2009-2014 Upi Tamminen # See the COPYRIGHT file for more information +""" +This module contains ... +""" + import os import time import fnmatch diff --git a/cowrie/core/honeypot.py b/cowrie/core/honeypot.py index d1dfad9..9651969 100644 --- a/cowrie/core/honeypot.py +++ b/cowrie/core/honeypot.py @@ -1,6 +1,10 @@ # Copyright (c) 2009-2014 Upi Tamminen # See the COPYRIGHT file for more information +""" +This module contains ... +""" + import os import shlex import re @@ -8,7 +12,7 @@ import copy from twisted.python import log -from . import fs +from cowrie.core import fs class HoneyPotCommand(object): diff --git a/cowrie/core/interact.py b/cowrie/core/interact.py index 6768f82..cc57621 100644 --- a/cowrie/core/interact.py +++ b/cowrie/core/interact.py @@ -1,12 +1,16 @@ # Copyright (c) 2009-2014 Upi Tamminen # See the COPYRIGHT file for more information +""" +This module contains ... +""" + import time from twisted.internet import protocol from twisted.conch import telnet, recvline -from . import ttylog +from cowrie.core import ttylog class Interact(telnet.Telnet): diff --git a/cowrie/core/output.py b/cowrie/core/output.py index d548f22..8a4f44a 100644 --- a/cowrie/core/output.py +++ b/cowrie/core/output.py @@ -26,6 +26,10 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. +""" +This module contains ... +""" + import abc import datetime import re diff --git a/cowrie/core/protocol.py b/cowrie/core/protocol.py index 4712a36..642a180 100644 --- a/cowrie/core/protocol.py +++ b/cowrie/core/protocol.py @@ -1,6 +1,10 @@ # Copyright (c) 2009-2014 Upi Tamminen # See the COPYRIGHT file for more information +""" +This module contains ... +""" + import os import time import socket @@ -12,9 +16,9 @@ from twisted.conch.insults import insults from twisted.python import log from twisted.protocols.policies import TimeoutMixin -from . import honeypot -from . import ttylog -from . import utils +from cowrie.core import honeypot +from cowrie.core import ttylog +from cowrie.core import utils class HoneyPotBaseProtocol(insults.TerminalProtocol, TimeoutMixin): diff --git a/cowrie/core/realm.py b/cowrie/core/realm.py index 1117374..5d03eae 100644 --- a/cowrie/core/realm.py +++ b/cowrie/core/realm.py @@ -26,15 +26,19 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. +""" +This module contains ... +""" + from zope.interface import implements import twisted from twisted.conch import interfaces as conchinterfaces from twisted.python import log -from . import protocol -from . import server -from . import ssh +from cowrie.core import protocol +from cowrie.core import server +from cowrie.core import ssh import sys import gc diff --git a/cowrie/core/server.py b/cowrie/core/server.py index 0e8a4ba..5c79cb5 100644 --- a/cowrie/core/server.py +++ b/cowrie/core/server.py @@ -26,12 +26,16 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. +""" +This module contains ... +""" + import pickle import twisted.python.log as log -from . import fs -from . import honeypot +from cowrie.core import fs +from cowrie.core import honeypot class CowrieServer: """ diff --git a/cowrie/core/ssh.py b/cowrie/core/ssh.py index 0f18c39..029d4ee 100644 --- a/cowrie/core/ssh.py +++ b/cowrie/core/ssh.py @@ -1,6 +1,10 @@ # Copyright (c) 2009-2014 Upi Tamminen # See the COPYRIGHT file for more information +""" +This module contains ... +""" + import os import time import struct @@ -18,12 +22,12 @@ from twisted.conch.openssh_compat import primes from twisted.conch.ssh.common import NS, getNS from twisted.internet import defer -from . import credentials -from . import auth -from . import connection -from . import honeypot -from . import protocol -from . import server +from cowrie.core import credentials +from cowrie.core import auth +from cowrie.core import connection +from cowrie.core import honeypot +from cowrie.core import protocol +from cowrie.core import server class HoneyPotSSHUserAuthServer(userauth.SSHUserAuthServer): diff --git a/cowrie/core/ttylog.py b/cowrie/core/ttylog.py index 0d622af..ccddc18 100644 --- a/cowrie/core/ttylog.py +++ b/cowrie/core/ttylog.py @@ -3,6 +3,10 @@ # Should be compatible with user mode linux +""" +This module contains ... +""" + import struct OP_OPEN, OP_CLOSE, OP_WRITE, OP_EXEC = 1, 2, 3, 4 diff --git a/cowrie/core/utils.py b/cowrie/core/utils.py index ac08fef..df2713b 100644 --- a/cowrie/core/utils.py +++ b/cowrie/core/utils.py @@ -1,6 +1,10 @@ # Copyright (c) 2010-2014 Upi Tamminen # See the COPYRIGHT file for more information +""" +This module contains ... +""" + def durationHuman(seconds): seconds = long(round(seconds)) minutes, seconds = divmod(seconds, 60)