From f50a85ca4b726850bf410e31b6f9e727c1d3b9f0 Mon Sep 17 00:00:00 2001 From: g0tmi1k Date: Thu, 10 Dec 2015 09:14:40 +0000 Subject: [PATCH] Clean up --- cowrie/commands/busybox.py | 4 ++-- cowrie/commands/ethtool.py | 18 +++++++++--------- cowrie/commands/nohup.py | 2 +- cowrie/commands/sudo.py | 4 ++-- cowrie/dblog/hpfeeds.py | 2 +- cowrie/output/dshield.py | 4 ++-- cowrie/output/elasticsearch.py | 2 +- cowrie/output/splunk.py | 4 ++-- utils/splunk/README.md | 1 - 9 files changed, 20 insertions(+), 21 deletions(-) diff --git a/cowrie/commands/busybox.py b/cowrie/commands/busybox.py index 1fbcfb49..3e88f2f3 100644 --- a/cowrie/commands/busybox.py +++ b/cowrie/commands/busybox.py @@ -60,7 +60,7 @@ class command_busybox(HoneyPotCommand): log.msg(eventid='KIPP0005', input=line, format='Command found: %(input)s') self.protocol.call_command(cmdclass, *args) else: - self.help() + self.help() else: - self.help() + self.help() commands['busybox'] = command_busybox diff --git a/cowrie/commands/ethtool.py b/cowrie/commands/ethtool.py index 6d621c57..c6fbfb47 100644 --- a/cowrie/commands/ethtool.py +++ b/cowrie/commands/ethtool.py @@ -30,19 +30,19 @@ For more information run ethtool -h """) def do_ethtool_eth0(self): self.protocol.writeln("""Settings for eth0: Supported ports: [ TP MII ] -Supported link modes: 10baseT/Half 10baseT/Full - 100baseT/Half 100baseT/Full - 1000baseT/Half 1000baseT/Full +Supported link modes: 10baseT/Half 10baseT/Full + 100baseT/Half 100baseT/Full + 1000baseT/Half 1000baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes -Advertised link modes: 10baseT/Half 10baseT/Full - 100baseT/Half 100baseT/Full - 1000baseT/Half 1000baseT/Full +Advertised link modes: 10baseT/Half 10baseT/Full + 100baseT/Half 100baseT/Full + 1000baseT/Half 1000baseT/Full Advertised pause frame use: Symmetric Receive-only Advertised auto-negotiation: Yes -Link partner advertised link modes: 10baseT/Half 10baseT/Full - 100baseT/Half 100baseT/Full - 1000baseT/Full +Link partner advertised link modes: 10baseT/Half 10baseT/Full + 100baseT/Half 100baseT/Full + 1000baseT/Full Link partner advertised pause frame use: Symmetric Receive-only Link partner advertised auto-negotiation: Yes Speed: 1000Mb/s diff --git a/cowrie/commands/nohup.py b/cowrie/commands/nohup.py index d2ef3115..d5b8ff88 100644 --- a/cowrie/commands/nohup.py +++ b/cowrie/commands/nohup.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- # Copyright (c) 2014 Peter Reuterås # See the COPYRIGHT file for more information diff --git a/cowrie/commands/sudo.py b/cowrie/commands/sudo.py index 4822c875..665bd9d3 100644 --- a/cowrie/commands/sudo.py +++ b/cowrie/commands/sudo.py @@ -98,8 +98,8 @@ Sudoers I/O plugin version 1.8.5p2''') self.protocol.call_command(cmdclass, *args) self.exit() else: - self.short_help() + self.short_help() else: - self.short_help() + self.short_help() commands['sudo'] = command_sudo diff --git a/cowrie/dblog/hpfeeds.py b/cowrie/dblog/hpfeeds.py index f37aaa4e..0cbcc8e9 100644 --- a/cowrie/dblog/hpfeeds.py +++ b/cowrie/dblog/hpfeeds.py @@ -42,7 +42,7 @@ def strpack8(x): def strunpack8(x): l = x[0] return x[1:1+l], x[1+l:] - + def msghdr(op, data): return struct.pack('!iB', 5+len(data), op) + data def msgpublish(ident, chan, data): diff --git a/cowrie/output/dshield.py b/cowrie/output/dshield.py index df5829e2..c9e2af4d 100644 --- a/cowrie/output/dshield.py +++ b/cowrie/output/dshield.py @@ -50,7 +50,7 @@ class Output(cowrie.core.output.Output): self.batch = [] def transmission_error(self, batch): - self.batch.extend(batch) + self.batch.extend(batch) if len(self.batch) > self.batch_size * 2: self.batch = self.batch[-self.batch_size:] @@ -72,7 +72,7 @@ class Output(cowrie.core.output.Output): attempt['user'], attempt['password']) nonce = base64.b64decode(_nonceb64) - digest = base64.b64encode(hmac.new('{0}{1}'.format(nonce, self.userid), + digest = base64.b64encode(hmac.new('{0}{1}'.format(nonce, self.userid), base64.b64decode(self.auth_key), hashlib.sha256).digest()) auth_header = 'credentials={0} nonce={1} userid={2}'.format(digest, _nonceb64, self.userid) headers = {'X-ISC-Authorization': auth_header, diff --git a/cowrie/output/elasticsearch.py b/cowrie/output/elasticsearch.py index ec5c81b7..16ac8a22 100644 --- a/cowrie/output/elasticsearch.py +++ b/cowrie/output/elasticsearch.py @@ -3,7 +3,7 @@ import os import json -import pyes +import pyes import cowrie.core.output diff --git a/cowrie/output/splunk.py b/cowrie/output/splunk.py index acacd918..da0bf78b 100644 --- a/cowrie/output/splunk.py +++ b/cowrie/output/splunk.py @@ -1,6 +1,6 @@ # -# Basic Splunk connector. -# Not recommended for production use. +# Basic Splunk connector. +# Not recommended for production use. # JSON log file is still recommended way to go # diff --git a/utils/splunk/README.md b/utils/splunk/README.md index 0268d478..a7dad161 100644 --- a/utils/splunk/README.md +++ b/utils/splunk/README.md @@ -1,4 +1,3 @@ # How to process Cowrie output with Splunk Please see: https://github.com/aplura/Tango -