these still referenced protocol.env

This commit is contained in:
Michel Oosterhof
2015-11-06 10:03:38 +00:00
parent 2c922fe1aa
commit 53a758a9f7
6 changed files with 12 additions and 12 deletions

View File

@@ -226,7 +226,7 @@ class command_passwd(HoneyPotCommand):
self.exit()
return
userdb = UserDB(self.protocol.env.cfg)
userdb = UserDB(self.protocol.cfg)
userdb.adduser(self.protocol.user.username,
self.protocol.user.uid, self.passwd)

View File

@@ -92,7 +92,7 @@ class command_curl(HoneyPotCommand):
self.url = url
self.limit_size = 0
cfg = self.protocol.env.cfg
cfg = self.protocol.cfg
if cfg.has_option('honeypot', 'download_limit_size'):
self.limit_size = int(cfg.get('honeypot', 'download_limit_size'))
@@ -128,8 +128,8 @@ class command_curl(HoneyPotCommand):
factory = HTTPProgressDownloader(
self, fakeoutfile, url, outputfile, *args, **kwargs)
out_addr = None
if self.protocol.env.cfg.has_option('honeypot', 'out_addr'):
out_addr = (self.protocol.env.cfg.get('honeypot', 'out_addr'), 0)
if self.protocol.cfg.has_option('honeypot', 'out_addr'):
out_addr = (self.protocol.cfg.get('honeypot', 'out_addr'), 0)
if scheme == 'https':
contextFactory = ssl.ClientContextFactory()

View File

@@ -165,7 +165,7 @@ gcc version %s (Debian %s-5)""" % (version, version_short, version_short, versio
data = ""
# TODO: make sure it is written to temp file, not downloads
safeoutfile = '%s/%s_%s' % \
(self.protocol.env.cfg.get('honeypot', 'download_path'),
(self.protocol.cfg.get('honeypot', 'download_path'),
time.strftime('%Y%m%d%H%M%S'),
re.sub('[^A-Za-z0-9]', '_', outfile))

View File

@@ -155,8 +155,8 @@ class command_iptables(HoneyPotCommand):
"""
# Create fresh tables on start
if not hasattr(self.protocol.env, 'iptables'):
setattr(self.protocol.env, 'iptables', {
if not hasattr(self.protocol.user.server, 'iptables'):
setattr(self.protocol.user.server, 'iptables', {
"raw": {
"PREROUTING": [],
"OUTPUT": []
@@ -183,7 +183,7 @@ class command_iptables(HoneyPotCommand):
})
# Get the tables
self.tables = getattr(self.protocol.env, 'iptables')
self.tables = getattr(self.protocol.user.server, 'iptables')
# Verify selected table
if not self.is_valid_table(table):

View File

@@ -9,7 +9,7 @@ commands = {}
class command_last(HoneyPotCommand):
def call(self):
fn = '%s/lastlog.txt' % self.protocol.env.cfg.get('honeypot', 'data_path')
fn = '%s/lastlog.txt' % self.protocol.cfg.get('honeypot', 'data_path')
if not os.path.exists(fn):
return
l = list(self.args)

View File

@@ -95,7 +95,7 @@ class command_wget(HoneyPotCommand):
self.url = url
self.limit_size = 0
cfg = self.protocol.env.cfg
cfg = self.protocol.cfg
if cfg.has_option('honeypot', 'download_limit_size'):
self.limit_size = int(cfg.get('honeypot', 'download_limit_size'))
@@ -132,8 +132,8 @@ class command_wget(HoneyPotCommand):
factory = HTTPProgressDownloader(
self, fakeoutfile, url, outputfile, *args, **kwargs)
out_addr = None
if self.protocol.env.cfg.has_option('honeypot', 'out_addr'):
out_addr = (self.protocol.env.cfg.get('honeypot', 'out_addr'), 0)
if self.protocol.cfg.has_option('honeypot', 'out_addr'):
out_addr = (self.protocol.cfg.get('honeypot', 'out_addr'), 0)
if scheme == 'https':
contextFactory = ssl.ClientContextFactory()