This commit is contained in:
Michel Oosterhof
2015-08-25 13:49:38 +04:00
3 changed files with 12 additions and 18 deletions

View File

@@ -15,7 +15,6 @@ class command_netstat(HoneyPotCommand):
self.writeln('+NEW_ADDRT +RTF_IRTT +RTF_REJECT +FW_MASQUERADE +I18N')
self.writeln('AF: (inet) +UNIX +INET +INET6 +IPX +AX25 +NETROM +X25 +ATALK +ECONET +ROSE')
self.writeln('HW: +ETHER +ARC +SLIP +PPP +TUNNEL +TR +AX25 +NETROM +X25 +FR +ROSE +ASH +SIT +FDDI +HIPPI +HDLC/LAPB +EUI64')
self.exit()
def show_help(self):
self.writeln("""
@@ -52,7 +51,6 @@ usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}
inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
x25 (CCITT X.25)""")
self.exit()
def do_netstat_route(self):
self.honeypot.writeln("""Kernel IP routing table

View File

@@ -124,15 +124,19 @@ class AuthRandom(object):
Users will be authenticated after a random number of attempts.
"""
def __init__(self, cfg, parameters):
def __init__(self, cfg):
# Default values
self.mintry, self.maxtry, self.maxcache = 2, 5, 10
parlist = parameters.split(',')
if len(parlist) == 3:
self.mintry = int(parlist[0])
self.maxtry = int(parlist[1])
self.maxcache = int(parlist[2])
# Are there auth_class parameters?
if cfg.has_option('honeypot', 'auth_class_parameters'):
parameters = cfg.get('honeypot', 'auth_class_parameters')
parlist = parameters.split(',')
if len(parlist) == 3:
self.mintry = int(parlist[0])
self.maxtry = int(parlist[1])
self.maxcache = int(parlist[2])
if self.maxtry < self.mintry:
self.maxtry = self.mintry + 1
log.msg('maxtry < mintry, adjusting maxtry to: %d' % self.maxtry)
@@ -338,7 +342,6 @@ class HoneypotPasswordChecker:
def checkUserPass(self, theusername, thepassword, ip):
# UserDB is the default auth_class
authname = UserDB
parameters = self.cfg
# Is the auth_class defined in the config file?
if self.cfg.has_option('honeypot', 'auth_class'):
@@ -347,17 +350,10 @@ class HoneypotPasswordChecker:
# Check if authclass exists in this module
if hasattr(modules[__name__], authclass):
authname = getattr(modules[__name__], authclass)
# Are there auth_class parameters?
if self.cfg.has_option('honeypot', 'auth_class_parameters'):
parameters = self.cfg.get('honeypot', 'auth_class_parameters')
else:
log.msg('auth_class: %s not found in %s' % (authclass, __name__))
if parameters:
theauth = authname(parameters)
else:
theauth = authname()
theauth = authname(self.cfg)
if theauth.checklogin(theusername, thepassword, ip):
log.msg(eventid='KIPP0002',

View File

@@ -100,7 +100,7 @@ class DBLogger(dblog.DBLogger):
msg['type'] = msgtype
msg.addChild(xmsg)
body.addChild(msg)
self.muc.groupChat(to, None, children=[body])
self.muc.groupChat(jid.JID(to), body)
# We have to return an unique ID
def createSession(self, peerIP, peerPort, hostIP, hostPort):